Intent to Implement: Scroll Timeline for Web Animations (JS only)

Skip to first unread message

Stephen Mcgruer

Dec 18, 2018, 9:03:02 AM12/18/18
to, Robert Flack

Contact emails,

Design doc/Spec


TAG Review:


Implement support for Scroll Timeline backed Web Animations. This will cover only the JavaScript portion of the Scroll Timeline spec, and will not support the CSS portion.

Previously we have implemented a large portion of the Scroll Timeline spec as part of the Animation Worklet Intent to Experiment ( Currently Scroll Timeline only supports Animation Worklet, but a lot of progress has been made on the spec and implementation recently and we are ready to start integrating it into the wider Web Animations functionality.

Note that the portion of Web Animations which has shipped (element.animate()) does not allow setting the timeline. Setting the timeline requires the (unshipped) Animation interface. The ScrollTimeline support for Web Animations will further be behind another flag (so that shipping Web Animations does not imply shipping ScrollTimeline).


The ability to base an animation on a scroll position is required for effects such as Twitter's header bar, animating content as you scroll (popular with bootstrap-style websites), or animated parallax. An incomplete set of examples can be found at

Currently web developers implement scroll-based animations either via scroll listeners or requestAnimationFrame reading the scroll position. These approaches are both main-thread heavy and may also fail in the presence of asynchronous scrolling. ScrollTimeline provides a way for the user agent to reduce the JavaScript performance overhead and potentially accelerate the effect on the compositor (which solves both the performance issue and the synchronization issue).


Interoperability and Compatibility

Edge: No signals

Firefox: Public support (they are an editor on the spec, have recently engaged in positive conversations regarding moving it forward)

Safari: Public support (they are an editor on the spec, have recently engaged in positive conversations regarding moving it forward)

Web / Framework developers: Positive based on requests from AMP team and other web teams inside Google, expected positive in the general web too.


The ergonomics risk should be low. ScrollTimelines should be at worst as expensive as the current approach web developers take for scroll-linked animations (and are often much better!).


I do not foresee activation risk. Developers can use this API by simply constructing a ScrollTimeline object and passing it into the appropriate Web Animations API instead of the (default) DocumentTimeline.

Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?


Is this feature fully tested by web-platform-tests?

Tests for ScrollTimeline in general already exist in WPT. Tests regarding how it interoperates with Web Animations will be added as the implementation moves forward.

Link to entry on the feature dashboard

Requesting approval to ship?


Reply all
Reply to author
0 new messages