Join GitHub today
[web-animations-1] Should setting the startTime of a play-pending animation to `null` have side effects? #2691
Typically setting the start time of an animation should cancel any pending tasks. This provides applications with a way to synchronously seek/sync animations. Furthermore, by setting the start time to
However, if an animation is play-pending its start time will already be unresolved (
If the animation is play-pending when script sets the start time to
a. The change is redundant and should be ignored. (Seems intuitive from a JS point of view, redundant changes have no side effects.), or
const anim = elem.animate(...); // anim.pending === true // anim.startTime === null // anim.currentTime === 0 anim.startTime = null; // Is the animation still play-pending here?
(Firefox actually does (a) as an optimization but the spec says we should do (b) and I'm wondering which to fix.)
Part of the reasoning is that this not only makes it easy to synchronously pause without having to check the pending state, but it is also consistent with the fact that setting the
Firefox will be updated in Mozilla bug 1478213 where I will also add a test for this.