Skip to content

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

@DavMila

Description

@DavMila

The css-animations-2 spec 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions