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

graouts has just created a new issue for https://github.com/w3c/csswg-drafts:

== [scroll-animations] should an infinite duration yield an exception for effects associated with a progress-based animation? ==
The WPT test [scroll-animations/scroll-timelines/effect-updateTiming.html](https://github.com/web-platform-tests/wpt/blob/7bd6ffc4ff276671e5ea688631aaeb2b0bda0388/scroll-animations/scroll-timelines/effect-updateTiming.html#L371-L384) checks that setting `Infinity` for the `duration` of a keyframe effect associated with a progress-based animation throws:

```javascript
// 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](https://drafts.csswg.org/web-animations-1/#dom-effecttiming-duration) thus:

> The [iteration duration](https://drafts.csswg.org/web-animations-1/#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](https://drafts.csswg.org/web-animations-1/#animation-effect).

Reading through [Web Animations Level 2](https://drafts.csswg.org/web-animations-2) and [Scroll-driven Animations Level 1](https://drafts.csswg.org/scroll-animations-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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/11804 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 28 February 2025 21:02:22 UTC