8000 [web-animations-2][css-animations-2] Should an animation be allowed to have multiple triggers associated? · Issue #12399 · w3c/csswg-drafts · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[web-animations-2][css-animations-2] Should an animation be allowed to have multiple triggers associated? #12399
Open
@DavMila

Description

@DavMila

I followed up #12119 where we resolved to treat AnimationTriggers as external controllers of Animations by filing #12397 where we should resolve on the explicit API by which Animations will be associated with triggers. One additional question that we should answer is what happens when that explicit API is used to associate an animation with multiple triggers., e.g.:

const anim = Animation();
const trigger1 = AnimationTrigger();
trigger1.addAnimation(anim);

const trigger2 = AnimationTrigger();
trigger2.addAnimation(anim);

In this example, when the animation is added to trigger2 should its association with trigger1 be terminated or left intact? (Is there another option?)

I propose that we leave the previous association intact, i.e. allow animations be associated with multiple triggers. This will enable use cases where an author wishes to orchestrate multiple sources which can trigger the playing of an animation whether they be scroll-based source or event/input-based sources.

Since it could happen that the associated triggers wish to perform conflicting operations, e.g. play() vs pause(), we should decide what the outcome should be in these scenarios. A simple proposal would be to let the outcome be the outcome of running each trigger's operation in the order in which the triggers were created. While it would be possible to construct cases where this doesn't play so well, I think it gives an author a simple conceptual model to work with. I would propose that we go with this simple model to start, and if we discover use cases that can't be done with this simple model, we can introduce ways of describing interactions between triggers on the same animation similar to how animation-composition was introduced for animation.

FYI @szager-chromium @flackr @ydaniv @birtles

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

      0