Skip to content

[css-view-transitions-1] How should scroll timeline animations be treated? #9901

@bokand

Description

@bokand

A view transition is removed when all constituent animations are no longer running or paused. However, the spec only defines this for document timelines:

  1. Let hasActiveAnimations be a boolean, initially false.
  2. For each element of transition’s transition root pseudo-element's inclusive descendants:
  3. For each animation whose timeline is a document timeline associated with document, and contains at least one associated effect whose effect target is element, set hasActiveAnimations to true if any of the following conditions is true:
    • animation’s play state is paused or running.
    • document’s pending animation event queue has any events associated with animation.

We should at least define what happens for other kinds of timelines.

However, as @bramus found it might be more useful to keep a view transition alive while it has a scroll timeline regardless of its current state, since it can be reversed by the user (unlike a document timeline). If we do that, I think authors can finish the view transition manually by calling cancel() on the transition animations? Perhaps we could make this more convenient via the ViewTransition object?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Thursday afternoon

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions