|
42 | 42 | this._easingFunction = linear;
|
43 | 43 | }
|
44 | 44 |
|
| 45 | + function isInvalidTimingDeprecated() { |
| 46 | + return shared.isDeprecated('Invalid timing inputs', '2016-03-02', 'TypeError exceptions will be thrown instead.', true); |
| 47 | + } |
| 48 | + |
45 | 49 | AnimationEffectTiming.prototype = {
|
46 | 50 | _setMember: function(member, value) {
|
47 | 51 | this['_' + member] = value;
|
|
76 | 80 | return this._fill;
|
77 | 81 | },
|
78 | 82 | set iterationStart(value) {
|
79 |
| - if (isNaN(value) || value < 0) { |
| 83 | + if ((isNaN(value) || value < 0) && isInvalidTimingDeprecated()) { |
80 | 84 | throw new TypeError('iterationStart must be a non-negative number, received: ' + timing.iterationStart);
|
81 | 85 | }
|
82 | 86 | this._setMember('iterationStart', value);
|
|
85 | 89 | return this._iterationStart;
|
86 | 90 | },
|
87 | 91 | set duration(value) {
|
88 |
| - if (value != 'auto' && (isNaN(value) || value < 0)) { |
| 92 | + if (value != 'auto' && (isNaN(value) || value < 0) && isInvalidTimingDeprecated()) { |
89 | 93 | throw new TypeError('duration must be non-negative or auto, received: ' + value);
|
90 | 94 | }
|
91 | 95 | this._setMember('duration', value);
|
|
107 | 111 | return this._easing;
|
108 | 112 | },
|
109 | 113 | set iterations(value) {
|
110 |
| - if (isNaN(value) || value < 0) { |
| 114 | + if ((isNaN(value) || value < 0) && isInvalidTimingDeprecated()) { |
111 | 115 | throw new TypeError('iterations must be non-negative, received: ' + value);
|
112 | 116 | }
|
113 | 117 | this._setMember('iterations', value);
|
|
228 | 232 | styleForCleaning.animationTimingFunction = easing;
|
229 | 233 | var validatedEasing = styleForCleaning.animationTimingFunction;
|
230 | 234 |
|
231 |
| - if (validatedEasing == '') { |
| 235 | + if (validatedEasing == '' && isInvalidTimingDeprecated()) { |
232 | 236 | throw new TypeError(easing + ' is not a valid value for easing');
|
233 | 237 | }
|
234 | 238 |
|
|
0 commit comments