Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw TypeErrors on invalid inputs to AnimationEffectTiming #426

Merged
merged 6 commits into from
Apr 20, 2016
Merged

Throw TypeErrors on invalid inputs to AnimationEffectTiming #426

merged 6 commits into from
Apr 20, 2016

Conversation

alancutter
Copy link
Contributor

This change adds TypeErrors to setters on AnimationEffectTiming for iterationStart, iterations, duration and easing.
Relevant spec: http://w3c.github.io/web-animations/#animationeffecttiming

@@ -74,12 +76,18 @@
return this._fill;
},
set iterationStart(value) {
if (value < 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this have an isNan check as well, like duration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added check, I realise now the NaN check is implicit in the IDL type.

for (var i = 0; i <= 1; i += 0.1) {
assert.equal(f(i), i, easing + ' is linear');
}
function assertThrows(easing) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make this test easier to read, I think this function name should be more explicit about what it does. This is a bit long but maybe something like assertThrowsOnConversionToTimingFunction? assertInvalidEasingThrows?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@suzyh
Copy link
Contributor

suzyh commented Apr 20, 2016

lgtm

@suzyh suzyh merged commit 7ec73f5 into web-animations:master Apr 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants