Skip to content

[web-animations-1] Should setting the startTime of a play-pending animation to null have side effects? #2691

Closed
@birtles

Description

@birtles

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 null applications can perform a synchronous pause.

However, if an animation is play-pending its start time will already be unresolved (null).

If the animation is play-pending when script sets the start time to null what should happen?

a. The change is redundant and should be ignored. (Seems intuitive from a JS point of view, redundant changes have no side effects.), or
b. The pending play task is canceled. (Currently speced behavior. Allows applications to perform a synchronous pause even in the play-pending state.)

i.e.

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.)

/cc @stephenmcgruer @flackr @graouts @dadaa

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