Re: [csswg-drafts] [animation-triggers-1] Add method to expose triggers declared in CSS (#13120)

The CSS Working Group just discussed `[animation-triggers-1] Add method to expose triggers declared in CSS`, and agreed to the following:

* `RESOLVED: Add a getTriggers() method on the Animation object.`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> DavidA: I mention two methods in the issue, but I think I would only propose a single method, document.getAnimationTriggers()<br>
&lt;flackr> q+<br>
&lt;fantasai> DavidA: I think it should take an Animation parameter<br>
&lt;fantasai> DavidA: So it will return any triggers associated with that animation.<br>
&lt;ydaniv> q+<br>
&lt;astearns> ack flackr<br>
&lt;fantasai> flackr: If we're making something to get triggers for an animation, shouldn't it just be on the Animation interface?<br>
&lt;fantasai> DavidA: That's also an option.<br>
&lt;astearns> q+<br>
&lt;fantasai> DavidA: Leaning away from that because triggers are separate thing that controls the Animation ... so didn't want to modify the Animation API<br>
&lt;astearns> ack ydaniv<br>
&lt;fantasai> DavidA: Getting from document or element, getting it from the DOM could also be useful.<br>
&lt;fantasai> flackr: But if it takes an Animation as input, then it *is* from an Animation<br>
&lt;fantasai> DavidA: Goal is if I have an Animation, and it has triggers attached to it, I can get those<br>
&lt;bramus> +1 on adding this to Animation<br>
&lt;fantasai> DavidA: I would be ok with method on Animation<br>
&lt;fantasai> +1<br>
&lt;fantasai> astearns: [getting things from other things]<br>
&lt;fantasai> DavidA: You could have triggers not just in CSS, but create some in script<br>
&lt;fantasai> DavidA: Want to see all triggers associated with an animation<br>
&lt;fantasai> astearns: Should we redesign to put it on Animation?<br>
&lt;fantasai> &lt;fantasai> sgtm<br>
&lt;fantasai> flackr: sgtm<br>
&lt;fantasai> ydaniv: I think both are useful. Shouldn't need to give an Animation to get the triggers.<br>
&lt;fantasai> astearns: If you ask an element "what are your triggers", then want to know the animations<br>
&lt;flackr> q+<br>
&lt;bramus> q+<br>
&lt;astearns> ack astearns<br>
&lt;astearns> ack flackr<br>
&lt;fantasai> flackr: I see this as analogous to animation timelines<br>
&lt;fantasai> flackr: where the timeline driving a particular animation is a thing associated with that aniation<br>
&lt;fantasai> flackr: there are also timelines declared by elements (e.g. scroll and view timelines) which we do not have a getter to access<br>
&lt;fantasai> flackr: I don't think it makes sense to have a getter for timelines associated [missed]<br>
&lt;fantasai> flackr: You go for timelines associated with an animatin<br>
&lt;fantasai> flackr: Triggers and timelines are for animations, which you already have a getter to get.<br>
&lt;fantasai> flackr: While I'm not opposed to getTriggers method, I think it should be for named triggers and named timelines, not the triggers and timelines running animations on that element<br>
&lt;fantasai> &lt;fantasai> +1 flackr<br>
&lt;fantasai> flackr: If we had element.getTriggers or document.getTriggers it would be for the triggers, not for the triggers associated with running an animation<br>
&lt;astearns> ack fantasai<br>
&lt;ydaniv> fantasai: I agree with flackr<br>
&lt;astearns> ack bramus<br>
&lt;ydaniv> ... my suggestion we resovle on getTriggers, and if we want triggeres defined by an element it's different by what we're discussing<br>
&lt;fantasai> bramus: getTriggers() on Animation we really need<br>
&lt;fantasai> bramus: the other getTriggers() methods is optional<br>
&lt;fantasai> bramus: Main case where it would be useful is tooling authors.<br>
&lt;fantasai> bramus: They can observe all the triggers on the document or someting<br>
&lt;fantasai> bramus: But that's a lesser use case than Animation.getTriggers()<br>
&lt;fantasai> PROPOSED: Add a getTriggers() method on the Animation object.<br>
&lt;fantasai> astearns: and we'll leave aside getting triggers from documents for later<br>
&lt;fantasai> astearns: objections?<br>
&lt;fantasai> RESOLVED: Add a getTriggers() method on the Animation object.<br>
</details>


-- 
GitHub Notification of comment by css-meeting-bot
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13120#issuecomment-4442833323 using your GitHub account


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

Received on Wednesday, 13 May 2026 15:54:23 UTC