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

My thoughts were around the same questions as you so I'll add them inline:

> [@fantasai](https://github.com/fantasai) & [@tabatkins](https://github.com/tabatkins), thanks so much for your review!
> 
> I'll add my comments/questions, in random order:
> 
> 1. Currently triggers, mostly relevant to timeline triggers, contain the state of the effect they apply on the animation's playback. With separate triggers used for start/end, where does that state lives? Or perhaps this design makes them stateless?

My feeling is both timeline-trigger and animation-trigger might have to keep independent notions of state. timeline-trigger for the purpose of determining when it's in the range and when it's out of the range; animation-trigger, perhaps, to ensure that we first respond to a "start" event before we respond to a "stop" event.

> 3. We probably want `animation-start-trigger-action` to just be `once | always`, since the alternating behavior is part of the exit/end triggering. Then you have the following mapping: `once -> once`, `repeat -> always / reset`, `alternate -> always / direction`, `state -> always / pause`.

Same as I was thinking. 

> 5. I don't get what `self` is? What does it do?

My reading of it was this allows an element refer to a timeline-trigger which has been declared on the same element but hasn't been given a name.

> 6. I assume wherever you put a trailing `|` that means a `<dashed-ident>` can be used, right?
> 7. If an animation has both a `start` timeline trigger with a `continue` range , and an `end` trigger with its own range, which one is used?

At first I thought -range and -continue each specified one end of a range and each timeline-trigger would be associated with a single range, but i think your reading is correct: each timeline-trigger specifying two ranges, which makes me have the same question as you.

I think it would also be good to think in terms of the JS interface. As a rough place to start,  I suppose we would have the following classes:
EventTrigger, TimelineTrigger and AnimationTrigger. Then each AnimationTrigger will have a "startSource" and a "stopSource", both of which could either be an EventTrigger or a TimelineTrigger.

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


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

Received on Monday, 21 July 2025 14:29:33 UTC