Skip to content

[web-animations-2][css-animations-2] Set of actions for animation triggers #12611

@DavMila

Description

@DavMila

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 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()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions