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

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

== [css-view-transitions-1] How should scroll timeline animations be treated? ==
A view transition is removed when all constituent animations are no longer running or paused. However, [the spec only defines this](https://www.w3.org/TR/css-view-transitions-1/#handle-transition-frame) for document timelines:

> 2. Let hasActiveAnimations be a boolean, initially false. 
> 3. For each element of transition’s transition root pseudo-element's inclusive descendants:
>   1. 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](https://twitter.com/bramus/status/1749461852726112341) 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?

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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 2 February 2024 21:28:18 UTC