Re: [csswg-drafts] [web-animations-2] Add web-animation animation events equivalent to css-animations and css-transitions. (#8544)

> When using a non-monotonically increasing timeline you can go from active to the before phase even when `playbackRate > 0`. This is not considered finished, so that event is not fired. The css-animations `end` event _is_ fired because it only looks at the change in phase. So we need an end event so that developers can observe this change. This is exemplified in my linked demo when you enable scroll linked animations.

Thanks, I'm just curious about the use cases. I can imagine the event being useful, I was just wondering if there are specific use cases we've come across that need this.

> I suppose we could add these events to the effect instead. Then the developer can directly observe each effect. Alternately, the event itself could include the effect.
> 
> Repeated effects would just follow the same logic as the css-animations-2 dispatch table, right? Any issues with this? Wouldn't we have to do this for group effects constructed via css too?

Yes, I'm just wondering if it's weird that, for example, if a parent group repeats causing a child to finish, then start again, that there are no events dispatched.

If we're ok with this, then I think it's fine. As you mention, unless we add further steps to handle groups in the CSS animations event dispatch definitions, this is the situation we'll arrive at there anyway.

It's a good question, however, as to whether these events should be dispatched at effects or animations (but with an `effect` member).

It looks like we _could_ define the event such that it has an [event path](https://dom.spec.whatwg.org/#event-path) that flows from an effect to its animation (via any parent effects, once introduced) by overriding the [get the parent](https://dom.spec.whatwg.org/#get-the-parent) definition for animation effects. That probably makes the most logical sense, but we should [get advice](https://dom.spec.whatwg.org/#defining-event-interfaces) before going ahead with that.

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


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

Received on Saturday, 11 March 2023 00:37:59 UTC