Description
The procedure for setting the timeline does not fully align with the expected behavior for scroll timelines. Notably:
- When switching to a scroll timeline or between scroll timelines, start time should to updated to ensure that current time is in sync with the scroll position.
- When switching from a scroll timeline to a document timeline, current time should be preserved.
https://drafts.csswg.org/web-animations-1/#setting-the-timeline
Presently we have logic in play and pause to handle specific requirements for non-monotonically increasing (scroll) timelines. The proposed behavior would ensure that the following two methods for starting a scroll linked animation produce the same effect:
const animation = elem.animate(...);
animation.timeline = scrollTimeline;
and
const animation = new Animation(..., scrollTimeline);
animation.play();
At present, Blink only supports the second option, but development is underway to support mutable timelines, which is required for supporting the CSS property 'animation-timeline'.