Skip to content

[scroll-animations] Should animation events fire every time active range is left / reentered? #4324

@flackr

Description

@flackr

web-animations 4.4.19.2 suggests that a finish event (i.e. animationend) is queued whenever the animation enters the finished play state. Similarly a cancel event (i.e. animationcancel) is queued whenever the animation enters the idle play state.

ScrollTimeline based animations would technically enter one of these states any time the user scrolls past the active range. Does this mean we should be emitting animationend / animationcancel every time you leave the active range and animationstart everytime it is reentered? It's possible developers could use this to trigger post animation range updates.

If so, what about scrolling backwards when current time <= 0 but the animation's effective playback rate is still > 0? Should this generate a finish event since effectively we were playing the animation in reverse?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Commenter SatisfiedCommenter has indicated satisfaction with the resolution / edits.scroll-animations-1Current Work

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions