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

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

== [web-animations-2][css-animations-2] Set of actions for animation triggers ==
A probable outcome of #12336 is having animation triggers specify a set of actions which they will perform on their attached animations.
I think @tabatkins [table](https://github.com/w3c/csswg-drafts/issues/12336#issuecomment-3130028269) is a good place to start so I'll copy-paste it here with slight modifications:

Keyword | Initial | Playing | Paused | Finished
-- | -- | -- | -- | --
play-forwards | Set playback rate positive, play() | Set playback rate positive | (same as initial) | (same as initial)
play-backwards | Set playback rate negative, play() | Set playback rate negative | (same as initial) | (same as initial)
play-alternate |  play() | Negates playback rate | play() | Negates playback rate, play()
pause | nothing | pause() | nothing | nothing
play-pause | play() | pause() | play() | play()
reset | nothing | set progress to 0, pause() | (same as playing) | (same as playing)
restart/replay | play() | set progress to 0 | set progress to 0, play() | set progress to 0, play()

To highlight the differences between Tab's table and the above:

- `reset` on a `playing` animation will, in addition to setting progress to 0, pause the animation.

I think  it might also be useful to have a `play` keyword:
Keyword | Initial | Playing | Paused | Finished
-- | -- | -- | -- | --
play | play() | nothing | play() | play()


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


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

Received on Friday, 15 August 2025 20:19:33 UTC