Re: [csswg-drafts] [web-animations-2][css-animations-2] Set of actions for animation triggers (#12611)

To clarify the discussion at the end of the meeting, the [repeat](https://drafts.csswg.org/css-animations-2/#valdef-animation-trigger-behavior-repeat) behavior that currently exists in the spec means "play on enter, reset on exit." In other words, it ties `play()` to the "enter" event and `reset` to "exit" event. This is captured by the `play` and `reset` keywords in the above table, e.g. `animation-trigger: --view-trigger play reset` or even `animation-trigger: --view-trigger replay reset`. 

`play-reset` (interpreted in similar fashion as `play-pause`) would serve a different purpose, tying a single event to the behavior of "play if reset, reset if playing." An example of that is `animation-trigger: --click-trigger play-reset` which ties `--click-trigger`'s "enter" event to `play-reset` so that if the animation is playing when clicked, it will be reset (paused and set to time 0). If it is reset/paused, it'll get played.

I'm not opposed to adding `play-reset`, I was only pointing out that the existing use case of [repeat](https://drafts.csswg.org/css-animations-2/#valdef-animation-trigger-behavior-repeat) is already handled. Thoughts @ydaniv ?

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


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

Received on Wednesday, 1 October 2025 17:20:50 UTC