Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
var silenced = {};

shared.isDeprecated = function(feature, date, advice, plural) {
if (WEB_ANIMATIONS_TESTING) {
return true;
}

var auxVerb = plural ? 'are' : 'is';
var today = new Date();
var expiry = new Date(date);
Expand Down
12 changes: 8 additions & 4 deletions src/timing-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
this._easingFunction = linear;
}

function isInvalidTimingDeprecated() {
return shared.isDeprecated('Invalid timing inputs', '2016-03-02', 'TypeError exceptions will be thrown instead.', true);
}

AnimationEffectTiming.prototype = {
_setMember: function(member, value) {
this['_' + member] = value;
Expand Down Expand Up @@ -76,7 +80,7 @@
return this._fill;
},
set iterationStart(value) {
if (isNaN(value) || value < 0) {
if ((isNaN(value) || value < 0) && isInvalidTimingDeprecated()) {
throw new TypeError('iterationStart must be a non-negative number, received: ' + timing.iterationStart);
}
this._setMember('iterationStart', value);
Expand All @@ -85,7 +89,7 @@
return this._iterationStart;
},
set duration(value) {
if (value != 'auto' && (isNaN(value) || value < 0)) {
if (value != 'auto' && (isNaN(value) || value < 0) && isInvalidTimingDeprecated()) {
throw new TypeError('duration must be non-negative or auto, received: ' + value);
}
this._setMember('duration', value);
Expand All @@ -107,7 +111,7 @@
return this._easing;
},
set iterations(value) {
if (isNaN(value) || value < 0) {
if ((isNaN(value) || value < 0) && isInvalidTimingDeprecated()) {
throw new TypeError('iterations must be non-negative, received: ' + value);
}
this._setMember('iterations', value);
Expand Down Expand Up @@ -228,7 +232,7 @@
styleForCleaning.animationTimingFunction = easing;
var validatedEasing = styleForCleaning.animationTimingFunction;

if (validatedEasing == '') {
if (validatedEasing == '' && isInvalidTimingDeprecated()) {
throw new TypeError(easing + ' is not a valid value for easing');
}

Expand Down