Skip to content

[web-animations-1] Setting the target effect to null on a play-pending animation should probably not make it paused #2077

Closed
@birtles

Description

@birtles

From @birtles on November 20, 2017 7:7

const anim = div.animate({ marginLeft: [ '0px', '100px' ] }, 1000);
// Currently play-pending. Now, drop the effect...
anim.effect = null;
console.log(anim.playState);
// "paused"?!?

That's because in the procedure to update the target effect we have this step:

If new effect is null and old effect is not null, run the procedure to reset an animation’s pending tasks on animation.

So, whereas we would previously have had a pending task and reported either "pending" (prior to recent spec changes) or "running" we now find ourselves without a pending task, with a current time, and without a start time, i.e. paused.

Intuitively though if we drop the effect we should either remain pending (i.e. "running") or go to the "finished" state -- probably depending on what happens when we subsequently attach a valid effect.

Copied from original issue: w3c/web-animations#207

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