Skip to content

[web-animations-1] Handling non-monotonically increasing timelines when setting the timeline of an animation. #5422

Open
@kevers-google

Description

@kevers-google

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'.

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