Skip to content

[scroll-animations] ScrollTimeline.currentTime precision can easily surpass the recommended microseconds precision #4353

@majido

Description

@majido

In Web Animation spec, time values (e.g., duration, current time) etc, are specified in milliseconds. Additionally the specification recommends implementations to be able to support precision up to microseconds.

The web animation spec, work fine for regular wall-clock time based animations where
microseconds precision is plenty. This however, can quickly become problematic with ScrollTimeline.

The computation of ScrollTimeline current time depends on timeRange (in milliseconds) and scroll range. Specifically

current time = scroll offset / scroll range × effective time range

This means that with event a medium sized scroll range (e.g., 1000px) and a small timeRange (e.g., 1ms) it is possible to produce time values smaller than one microseconds. Which means having distinct scroll offsets that map to the same time values. This results in undesirable jitters for any animations that wants animation wants to position object relative to scroll offset as represented by ScrollTimeline.currentTime.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions