Re: [csswg-drafts] [css-animations-2] Specify the animation-trigger property (#10128)

> I was thinking about the Web Animations DOM interfaces. Just like we have the [Animation interface](https://drafts.csswg.org/web-animations-1/#the-animation-interface) I assume we'll have an AnimationTrigger interface?

I opened an issue with a rough proposal [here](https://github.com/w3c/csswg-drafts/issues/10229).
I could add that in already, as an initial proposal for API. I thought to wait with that for a later PR, since we only resolved on adding an initial draft and going with it back to the group for approval.

> That also makes me wonder how authors would expect to be able to inspect these from script. Is there some way to fetch the triggers in a document? Or the trigger driving a particular Animation?

I missed that part, I guess I could add that in. Regarding additional APIs, like getting all triggers from document, I guess we could always add these later on demand?

> Yeah, I was thinking that we need to review the whole section to check for other references that need to be updated like the sentence I mentioned and other definitions like this one:
> 
>> An [animation effect](https://drafts.csswg.org/web-animations-1/#animation-effect), effect, is associated with a timeline, timeline, if effect is [associated with an animation](https://drafts.csswg.org/web-animations-1/#animation-effect-associated-animation) which, in turn, is associated with timeline.
> 
> Presumably that needs to be updated to include triggers too?

I checked everything and didn't find anything else. I think since triggers only affect playback state and are associated with a timeline, it should be enough to check/update their state according to the timeline, since the trigger's spec describes what to do on state change.

>This is a pretty fundamental change to the whole timing hierarchy so we need to be careful about it. I wonder if it would be better to introduce an abstract concept that covers both animations and animation triggers like "timeline subscribers" or somesuch.

Agreed. I tried simplifying it on the last change.

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


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

Received on Sunday, 5 May 2024 16:39:58 UTC