Re: [csswg-drafts] [web-animations-2] Should there be events on target elements to detect started web animations? (#9011)

I've also seen this confusing developers expecting DOM events to simply trigger.

It's also very important for libraries and/or large systems where events may be tracked in a generic way, separate from the mechanism that's in charge of doing the animations.

> I guess we'd dispatch start/end events any time a leaf KeyframeEffect went to/from the active phase?

That would be great.

> Should we try to stick to reporting about animations?

I'd say definitely yes. The only thing that may be interesting is perhaps on the timeline-level, but IMHO events on group animations should also cover most of these.

> Another idea is an animation observer interface. 

If I'm not mistaken, the main motivation of moving from events to observers was mostly about solving implementation issues with events. Do we have any of these here? Or is there any other benefit to moving to an observer (perf, API)?
One good reason I can think of is that this can be easily detected by authors to know whether DOM events are triggered in response to web animations.

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


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

Received on Sunday, 2 July 2023 15:37:23 UTC