Skip to content

[web-animations-2] animation (or effect) start and iteration events #4461

Open
@liamdebeasi

Description

@liamdebeasi

From what I understand, Web Animations do not emit animationstart and animationiteration events like CSS Animations do. Would it be possible to get some clarification as to what the Web Animation alternatives to those should be?

I see there are onfinish and oncancel event handlers here: https://www.w3.org/TR/web-animations-1/#dom-animation-onfinish

Here is an example of what I am referring to: https://codepen.io/liamdebeasi/pen/RwwZpeZ

The top square is animated using Web Animations, and the bottom square is animated using CSS Animations. If you open up the console, notice that animationstart and animationiteration events fire for the CSS Animation square, but not for the Web Animation square.

It would be helpful to know when the animation has started as well as when the animation is iterating from the context of syncing animations with the rest of a user's app. Ideally I would just be able to do animation.onstart and animation.oniteration like I can with animation.onfinish, but even just being able to listen for the native events would be great too.

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