Skip to content

[web-animations-2] Should AnimationTrigger properties be readonly? #11918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
DavMila opened this issue Mar 11, 2025 · 2 comments
Open

[web-animations-2] Should AnimationTrigger properties be readonly? #11918

DavMila opened this issue Mar 11, 2025 · 2 comments
Labels

Comments

@DavMila
Copy link
Contributor

DavMila commented Mar 11, 2025

The AnimationTrigger interface is specified in the web-animations-2 spec. JavaScript can get and set the trigger property of an animation. This means that multiple animations can be associated with the same trigger. Should AnimationTrigger properties then be readonly?

If they are not readonly, then we need to specify how setting the properties of an AnimationTrigger works when multiple animations are associated with that trigger.

Specifically:

  1. If an author writes:
trigger = animation.trigger;
trigger.type = new_type;

should the change affect all the animations associated with this trigger or none (do a copy-on-write for all animations associated with this trigger), orphaning the trigger?

  1. If an author writes animation.trigger.type = new_type, should this affect all the other animations associated with this trigger or just the one referenced in the expression (do a copy-on-write for all other animations associated with this trigger)?

(By copy-on-write, I mean make a copy (or copies) of the old trigger and associate it (or them) with the other animations, leaving them unaffected.)

I propose we make AnimationTrigger’s properties readonly. We can relax this constraint and answer the above questions in the future if the need arises.

@ydaniv ydaniv added the web-animations-2 Current Work label Mar 13, 2025
@ydaniv
Copy link
Contributor

ydaniv commented Mar 14, 2025

I propose we make AnimationTrigger’s properties readonly. We can relax this constraint and answer the above questions in the future if the need arises.

If this won't be blocked later by compat concerns and it will simplify implementation then I'm fine with the proposal + deferring.

@ydaniv
Copy link
Contributor

ydaniv commented Mar 27, 2025

Proposal: make properties of AnimationTrigger read-only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Regular agenda
Development

No branches or pull requests

2 participants