Re: [csswg-drafts] [web-animations-1] Expect iterationStart to not be NaN (#5507)

> `iterations` and `duration` are expected to not be `NaN`, but not `iterationStart`. Is there a reason for this or is it just missing?

Yes, `iterations` and `duration` have type [`unrestricted double`](https://heycam.github.io/webidl/#idl-unrestricted-double) so they can take values like `Infinity` and `NaN`. That's because those values need to be able to represent infinity.

`iterationStart`, however, has type `double` so it can't take such values. Validation that `iterationStart` is not `NaN` happens at the WebIDL binding layer and so no additional spec text is required.

> ```js
> new KeyframeEffect($0, { opacity: [0, 1] }, { iterations: NaN })
> // Uncaught TypeError: Failed to construct 'KeyframeEffect': iterationCount must be non-negative
> ```

(That's odd that Chrome reports an error for `iterationCount` when validating `iterations`.)

-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5507#issuecomment-690777125 using your GitHub account


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

Received on Thursday, 10 September 2020 23:05:06 UTC