Skip to content

[scroll-animations] should an infinite duration yield an exception for effects associated with a progress-based animation? #11804

Open
@graouts

Description

@graouts

The WPT test scroll-animations/scroll-timelines/effect-updateTiming.html checks that setting Infinity for the duration of a keyframe effect associated with a progress-based animation throws:

// adapted for progress based animations
const gBadDurationValuesForProgressBased = [
  -1, NaN, Infinity, -Infinity, 'abc', '100'
];


for (const invalid of gBadDurationValuesForProgressBased) {
  test(t => {
    assert_throws_js(TypeError, () => {
      const anim = createScrollLinkedAnimationWithTiming(t,  { duration: invalid })
      anim.play();
    });
  }, 'Throws when setting invalid duration: '
     + (typeof invalid === 'string' ? `"${invalid}"` : invalid));
}

Web Animations Level 1 specifies duration thus:

The iteration duration, which is a real number greater than or equal to zero (including positive infinity) representing the time taken to complete a single iteration of the animation effect.

Reading through Web Animations Level 2 and Scroll-driven Animations Level 1 I cannot find any additional normative text that would indicate that Infinity is not a valid value for the duration of a progress-based animation.

Chrome throws in that scenario, so I expect it was the intention of Chromium engineers to specify this behavior.

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