Skip to content

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

Open
@DavMila

Description

@DavMila

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Regular agenda

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions