Re: [csswg-drafts] [css-animations-2] Move scroll and event animation triggers to independent namespace (#12336)

I definitely see the draw in making everything consistent in a single "everything is an event" model, but I think there's value in keeping common things simpler, and I think the view/scroll timelines having a somewhat specialized syntax is worthwhile. The vast majority of the time when you're using a view/scroll timeline, you want it to play/stop based on entering/exitting a chunk of the timeline. 

It's also the case that timeline triggers have slightly different configuration knobs than events. You *can* squeeze them all into a single model, but only at the expense of making the overall idea more complex, I think. If we put all the "configuration" options on the element defining the trigger (rather than the one running the animation), then it works out nicely to have timeline and events using a different set of properties.

(I don't disagree that it might make sense to *expose* viewenter/viewleave as events *as well*, but in the common case I think we shouldn't force authors to have to think about the event model just to play an animation while an element is on screen.)

The *only* real downside of doing it this way, I think, is that the trigger namespace is overloaded with two different things, and we have to handle collisions. This is nothing new, though - if an element declares two timeline triggers on itself with the same name, or two event triggers with the same name, we also have to handle that collision; this is common to many name-defining properties. We'd just define that one of the sets of properties wins over the other when they both try to define the same name; it's an error case for authors to do that anyway.

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


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

Received on Friday, 15 August 2025 21:26:09 UTC