[csswg-drafts] [css-animations-2] Add method to expose triggers declared in CSS (#13120)

DavMila has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-animations-2] Add method to expose triggers declared in CSS ==
The css-animations-2 [spec](https://drafts.csswg.org/css-animations-2/#timeline-trigger-shorthand) includes properties which instantiate AnimationTrigger objects, e.g. the `timeline-trigger` property which instantiates a TimelineTrigger. However, there is no way for an author to access and inspect the trigger instantiated by this property. I think we should add a method to expose this trigger object similar to how `Element.getAnimations` exposes the CSSAnimation instantiated by an `animation` declaration. This would be useful, combined with `AnimationTrigger.getAnimations()`, as a debugging tool for authors.

I propose that we add the following methods:
  i. `Element.getAnimationTriggers()` which returns the triggers that were declared by `timeline-trigger` or `event-trigger` on this element.
  ii. `document.getAnimationTriggers()` which returns all the triggers present on the page (this would be similar to `document.getAnimations()`).

FYI @ydaniv , @flackr , @tabatkins 

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13120 using your GitHub account


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

Received on Wednesday, 19 November 2025 14:52:01 UTC