[csswg-drafts] ScrollTimeline.currentTime precision can easily surpass the recommended microseconds precision (#4353)

majido has just created a new issue for https://github.com/w3c/csswg-drafts:

== ScrollTimeline.currentTime precision can easily surpass the recommended microseconds precision ==
In Web Animation spec, time values (e.g., duration, current time) etc, are specified in milliseconds. Additionally the specification [recommends](https://drafts.csswg.org/web-animations/#precision-of-time-values) 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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4353 using your GitHub account

Received on Thursday, 19 September 2019 05:42:58 UTC