Skip to content

[animation-triggers-1] Update animation triggers spec - #14199

Open
ydaniv wants to merge 4 commits into
w3c:mainfrom
ydaniv:triggers-update
Open

[animation-triggers-1] Update animation triggers spec#14199
ydaniv wants to merge 4 commits into
w3c:mainfrom
ydaniv:triggers-update

Conversation

@ydaniv

@ydaniv ydaniv commented Jul 18, 2026

Copy link
Copy Markdown
Member

Include latest resolutions and some pending issues as proposals.

DavMila and others added 4 commits June 10, 2026 15:57
This adds missing </dfn> and </div> tags.
This moves the details of AnimationTrigger to the animation-triggers-1
spec.

This is mostly a copy-paste of the content from web-animations-2, with
a few adjustments:

- Drops the Animation frame loop update portion
- Drops the Animation mixin interface update portions
- Drops the KeyframeAnimationOptions 'trigger' addition
(these were structured as ammendments to web-animations-1 but are no
longer relevant anyway.)
- Adjusts the level of some headings so bikeshed is happy.
All triggers have a <dfn export for=CSS>trigger name</dfn>.
Once a trigger is defined, a <dfn export for=CSS>trigger instance</dfn> is
created in the scope managed by the 'trigger-scope' property.
For each specified triggering element, a <dfn export for=CSS>trigger attachment</dfn>

@DavMila DavMila Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has to do with "combining" triggers that declare the same name right? The resolution was that, at least to start, we would do this for event triggers but not for timeline triggers. Could we have separate subsections describing how event-trigger names are handled and how timeline-trigger names are handled?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, that's why I wrote above "and some pending issues as proposals" (:
See issue: #14089
So I went ahead and proposed a syntax, but this is still WIP, of course

If multiple elements define [=triggers=] with the same [=trigger name=],
the [=trigger=] defined by the later element in [=tree order=] is used.
If multiple elements declare [=triggers=] with the same [=trigger name=]
they are combined together as separate [=trigger attachment|attachments=] for [=trigger instances=]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar request as with the trigger name section above: could we have separate sections clarifying how the names are treated differently?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above. I think it's important to resolve this issue sooner rather than later

## Timeline Trigger Ranges ## {#timeline-trigger-ranges}

A [=timeline trigger=] attachment can have one or more associated timelines.
When <em>all</em> of the [=trigger attachment|attachment=]'s associated

@DavMila DavMila Jul 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that for timeline triggers, since we aren't combining the names, there isn't a difference between attachment and instance?

Side note: I think I agree with the below that with multiple timelines, activation requires all the timelines but deactivation requires only a single timeline to exit the active range.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in case we don't hoist the state to the top of the scope then they practically become the same


<pre class='idl'>
[Exposed=Window]
interface AnimationTrigger {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is just a copy-paste and it's fine to update this in a follow-up patch.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please (:

@DavMila DavMila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for uploading this.
Mostly LGTM.
We should clarify that timeline-trigger names are treated differently from event-trigger names.
The copy-pasted interface needs to be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants