[csswg-drafts] [web-animations-2] Should ‘state’ triggers cancel() their animation(s) outside the exit range if the animation finished? (#11915)

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

== [web-animations-2] Should ‘state’ triggers cancel() their animation(s) outside the exit range if the animation finished? ==
`state` animation [triggers](https://drafts.csswg.org/web-animations-2/#triggers) [play or resume](https://drafts.csswg.org/web-animations-2/#:~:text=triggering%20or%20resuming) their related animation when within their trigger range and pause them when outside their exit range. If, after being played, the animation [finishes](https://drafts.csswg.org/web-animations-1/#finishing-an-animation-section) prior to the trigger’s exit condition being met (being outside the exit range), should `state` triggers reset the animation when the exit condition is met?

Resetting the animation allows the trigger to naturally restart the animation the next time its trigger condition is met, making it a special case of a `repeat` trigger. 

Not resetting the animation means after it finishes, subsequently meeting the trigger condition won’t replay the animation, making it a special case of a `once` trigger.

I propose not resetting the animation after it finishes. If an author would like a `state` trigger to  restart after “finishing” they can specify `animation-iteration-count: infinite`.
OTOH, if we specify that the exit condition resets a finished animation, and the author does not want the animation to restart, they can simply nuke the trigger, i.e. `animation.trigger = null`.. Though this feels less clean IMO.

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


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

Received on Tuesday, 11 March 2025 18:37:54 UTC