Re: [csswg-drafts] [css-shared-element-transitions-1] Define "active animation" used to signal end of transition (#7785)

> Each of the animation APIs above provide an event that the developer can use to detect if the animation was finished or cancelled:
> 
> * CSS Transition : [transitionend](https://drafts.csswg.org/css-transitions/#transitionend) and [transitioncancel](https://drafts.csswg.org/css-transitions/#transitioncancel).
> 
> * CSS Animation : [animationend](https://w3c.github.io/csswg-drafts/css-animations-1/#eventdef-globaleventhandlers-animationend) and [animationcancel](https://w3c.github.io/csswg-drafts/css-animations-1/#eventdef-globaleventhandlers-animationcancel).
> 
> * Web Animation : finish, cancel and remove events as defined [here](https://w3c.github.io/csswg-drafts/web-animations-1/#animation-playback-event-types).

CSS animations and CSS transitions are built on top of Web Animations so _all_ of these animations will produce a corresponding `Animation` and _all_ animation events should use the common [pending animation event queue](https://w3c.github.io/csswg-drafts/web-animations-1/#pending-animation-event-queue).

It should be enough to wait until there are no `Animation`s in the [running state](https://w3c.github.io/csswg-drafts/web-animations-1/#running-play-state) and the pending animation event queue is empty (and no new animations have been generated as a result). (The running state includes animations that have yet to start due to being in their delay phase but excludes animations that are paused/idle/finished.)

The processing of the pending animation event queue is handled in the [update animations and send events](https://w3c.github.io/csswg-drafts/web-animations-1/#update-animations-and-send-events) procedure which is referenced as part of [update the rendering](https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering).

Bear in mind that animations can be triggered to repeat indefinitely and you might need to determine if they should be included in scope or not. Also, presumably you'll want to exclude scroll-based animations from this definition too.

Also, there are SMIL/SVG animations which ultimately were intended to be implemented in terms of Web Animations but we never got around to it. These can also trigger new animations when they finish in a declarative manner (syncbase timing and event-based timing).

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7785#issuecomment-1256833324 using your GitHub account


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

Received on Saturday, 24 September 2022 02:03:38 UTC