-
Notifications
You must be signed in to change notification settings - Fork 30
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
Conversation
@@ -74,12 +76,18 @@ | |||
return this._fill; | |||
}, | |||
set iterationStart(value) { | |||
if (value < 0) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
lgtm |
This change adds TypeErrors to setters on AnimationEffectTiming for
iterationStart
,iterations
,duration
andeasing
.Relevant spec: http://w3c.github.io/web-animations/#animationeffecttiming