Closed
Description
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