diff --git a/src/animation.js b/src/animation.js index e9f6482..0d22978 100644 --- a/src/animation.js +++ b/src/animation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { shared.sequenceNumber = 0; @@ -191,7 +192,6 @@ this._inEffect = false; this._idle = true; this._paused = false; - this._isFinished = true; this._finishedFlag = true; this._currentTime = 0; this._startTime = null; diff --git a/src/apply-preserving-inline-style.js b/src/apply-preserving-inline-style.js index 795be36..020ccf0 100644 --- a/src/apply-preserving-inline-style.js +++ b/src/apply-preserving-inline-style.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { var styleAttributes = { diff --git a/src/apply.js b/src/apply.js index 3200f96..3d8c33e 100644 --- a/src/apply.js +++ b/src/apply.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { scope.apply = function(element, property, value) { diff --git a/src/box-handler.js b/src/box-handler.js index 3399263..456cef0 100644 --- a/src/box-handler.js +++ b/src/box-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { function consumeLengthPercentOrAuto(string) { return scope.consumeLengthOrPercent(string) || scope.consumeToken(/^auto/, string); diff --git a/src/color-handler.js b/src/color-handler.js index b32a889..c5d96ce 100644 --- a/src/color-handler.js +++ b/src/color-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { var canvas = document.createElementNS('http://www.w3.org/1999/xhtml', 'canvas'); diff --git a/src/deprecation.js b/src/deprecation.js index 6bdb4a2..48fa2c8 100644 --- a/src/deprecation.js +++ b/src/deprecation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared) { var silenced = {}; diff --git a/src/dev.js b/src/dev.js index a5e225c..640d0ad 100644 --- a/src/dev.js +++ b/src/dev.js @@ -12,5 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; var WEB_ANIMATIONS_TESTING = false; var webAnimationsTesting = null; diff --git a/src/dimension-handler.js b/src/dimension-handler.js index 15e4d0a..78a1330 100644 --- a/src/dimension-handler.js +++ b/src/dimension-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { function parseDimension(unitRegExp, string) { diff --git a/src/effect-callback.js b/src/effect-callback.js index 3051a59..29b5954 100644 --- a/src/effect-callback.js +++ b/src/effect-callback.js @@ -11,6 +11,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + +'use strict'; (function(shared, scope, testing) { var nullTarget = document.createElementNS('http://www.w3.org/1999/xhtml', 'div'); diff --git a/src/element-animatable.js b/src/element-animatable.js index 765edf0..2b274c2 100644 --- a/src/element-animatable.js +++ b/src/element-animatable.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope) { window.Element.prototype.animate = function(effectInput, options) { var id = ''; diff --git a/src/font-weight-handler.js b/src/font-weight-handler.js index 4760486..1dc50bf 100644 --- a/src/font-weight-handler.js +++ b/src/font-weight-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope) { function parse(string) { var out = Number(string); diff --git a/src/group-constructors.js b/src/group-constructors.js index e5c0a10..446db40 100644 --- a/src/group-constructors.js +++ b/src/group-constructors.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { function groupChildDuration(node) { @@ -116,7 +117,8 @@ }, remove: function() { scope.removeMulti([this]); - } + }, + _updateActiveDuration: function() {} }; window.SequenceEffect.prototype = Object.create(constructor.prototype); diff --git a/src/handler-utils.js b/src/handler-utils.js index d9f05e1..be71c87 100644 --- a/src/handler-utils.js +++ b/src/handler-utils.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope) { // consume* functions return a 2 value array of [parsed-data, '' or not-yet consumed input] diff --git a/src/interpolation.js b/src/interpolation.js index ba63ed3..c1a2c33 100644 --- a/src/interpolation.js +++ b/src/interpolation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { function interpolate(from, to, f) { diff --git a/src/keyframe-effect-constructor.js b/src/keyframe-effect-constructor.js index 3d0f1bd..13eb2ec 100644 --- a/src/keyframe-effect-constructor.js +++ b/src/keyframe-effect-constructor.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { var disassociate = function(effect) { @@ -70,7 +71,7 @@ this._normalizedKeyframes = new KeyframeList(effectInput); } this._keyframes = effectInput; - this.activeDuration = shared.calculateActiveDuration(this._timing); + this._updateActiveDuration(); this._id = id; return this; }; @@ -93,6 +94,9 @@ get parent() { return this._parent; }, + get activeDuration() { + return this._activeDuration; + }, clone: function() { if (typeof this.getFrames() == 'function') { throw new Error('Cloning custom effects is not supported.'); @@ -104,6 +108,9 @@ }, remove: function() { scope.removeMulti([this]); + }, + _updateActiveDuration: function() { + this._activeDuration = shared.calculateActiveDuration(this._timing); } }; diff --git a/src/keyframe-effect.js b/src/keyframe-effect.js index f6813d8..c69b9ad 100644 --- a/src/keyframe-effect.js +++ b/src/keyframe-effect.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { function EffectTime(timing) { diff --git a/src/keyframe-interpolations.js b/src/keyframe-interpolations.js index cab801e..f57d6b4 100644 --- a/src/keyframe-interpolations.js +++ b/src/keyframe-interpolations.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { scope.convertEffectInput = function(effectInput) { diff --git a/src/matrix-decomposition.js b/src/matrix-decomposition.js index 357df9c..57e787b 100644 --- a/src/matrix-decomposition.js +++ b/src/matrix-decomposition.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { var decomposeMatrix = (function() { function determinant(m) { diff --git a/src/matrix-interpolation.js b/src/matrix-interpolation.js index 9a35de3..c19dde5 100644 --- a/src/matrix-interpolation.js +++ b/src/matrix-interpolation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { var composeMatrix = (function() { function multiply(a, b) { diff --git a/src/normalize-keyframes.js b/src/normalize-keyframes.js index 1fd0254..6137c84 100644 --- a/src/normalize-keyframes.js +++ b/src/normalize-keyframes.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, testing) { var shorthandToLonghand = { background: [ diff --git a/src/number-handler.js b/src/number-handler.js index 7509373..95ae461 100644 --- a/src/number-handler.js +++ b/src/number-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { function numberToString(x) { diff --git a/src/position-handler.js b/src/position-handler.js index 18cea43..32b9593 100644 --- a/src/position-handler.js +++ b/src/position-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope) { function negateDimension(dimension) { diff --git a/src/property-interpolation.js b/src/property-interpolation.js index 2e2c5e0..4005507 100644 --- a/src/property-interpolation.js +++ b/src/property-interpolation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { var propertyHandlers = {}; diff --git a/src/property-names.js b/src/property-names.js index c52d990..557fccd 100644 --- a/src/property-names.js +++ b/src/property-names.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { var aliased = {}; diff --git a/src/scope.js b/src/scope.js index c824880..9bab6b6 100644 --- a/src/scope.js +++ b/src/scope.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; var webAnimationsShared = {}; var webAnimations1 = {}; var webAnimationsNext = {}; diff --git a/src/shadow-handler.js b/src/shadow-handler.js index 3f8201d..531b1b9 100644 --- a/src/shadow-handler.js +++ b/src/shadow-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope) { function consumeShadow(string) { diff --git a/src/shape-handler.js b/src/shape-handler.js index 6bbf79f..1ad5048 100644 --- a/src/shape-handler.js +++ b/src/shape-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope) { var consumeLengthOrPercent = scope.consumeParenthesised.bind(null, scope.parseLengthOrPercent); diff --git a/src/tick.js b/src/tick.js index 08b0a14..6d8f7ac 100644 --- a/src/tick.js +++ b/src/tick.js @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. - +'use strict'; (function(shared, scope, testing) { var originalRequestAnimationFrame = window.requestAnimationFrame; var rafCallbacks = []; diff --git a/src/timeline.js b/src/timeline.js index 2b213b5..605a54d 100644 --- a/src/timeline.js +++ b/src/timeline.js @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. - +'use strict'; (function(shared, scope, testing) { var originalRequestAnimationFrame = window.requestAnimationFrame; window.requestAnimationFrame = function(f) { diff --git a/src/timing-utilities.js b/src/timing-utilities.js index 2f16f3b..ffbe008 100644 --- a/src/timing-utilities.js +++ b/src/timing-utilities.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, testing) { var fills = 'backwards|forwards|both|none'.split('|'); @@ -52,7 +53,7 @@ if (this._effect) { this._effect._timingInput[member] = value; this._effect._timing = shared.normalizeTimingInput(this._effect._timingInput); - this._effect.activeDuration = shared.calculateActiveDuration(this._effect._timing); + this._effect._updateActiveDuration(); if (this._effect._animation) { this._effect._animation._rebuildUnderlyingAnimation(); } @@ -143,7 +144,7 @@ if ((property == 'direction') && (directions.indexOf(timingInput[property]) == -1)) { return; } - if (property == 'playbackRate' && timingInput[property] !== 1 && shared.isDeprecated('AnimationEffectTiming.playbackRate', '2014-11-28', 'Use Animation.playbackRate instead.')) { + if (property == 'playbackRate') { return; } timing[property] = timingInput[property]; diff --git a/src/transform-handler.js b/src/transform-handler.js index c448296..ad227f5 100644 --- a/src/transform-handler.js +++ b/src/transform-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { // This returns a function for converting transform functions to equivalent diff --git a/src/visibility-handler.js b/src/visibility-handler.js index 53f2953..31e8d77 100644 --- a/src/visibility-handler.js +++ b/src/visibility-handler.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(scope, testing) { function merge(left, right) { diff --git a/src/web-animations-bonus-cancel-events.js b/src/web-animations-bonus-cancel-events.js index 3905496..2e9cf1f 100644 --- a/src/web-animations-bonus-cancel-events.js +++ b/src/web-animations-bonus-cancel-events.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function() { if (document.createElement('div').animate([]).oncancel !== undefined) { diff --git a/src/web-animations-bonus-object-form-keyframes.js b/src/web-animations-bonus-object-form-keyframes.js index c1b6ecd..8aeebcb 100644 --- a/src/web-animations-bonus-object-form-keyframes.js +++ b/src/web-animations-bonus-object-form-keyframes.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared) { // If the polyfill is being loaded in a context where Element.animate is // supported but object-form syntax is not, then creating an animation diff --git a/src/web-animations-next-animation.js b/src/web-animations-next-animation.js index 698532c..4738694 100644 --- a/src/web-animations-next-animation.js +++ b/src/web-animations-next-animation.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function(shared, scope, testing) { scope.animationsWithPromises = []; diff --git a/test/testharness-runner.js b/test/testharness-runner.js index 1a9a909..71e9ddb 100644 --- a/test/testharness-runner.js +++ b/test/testharness-runner.js @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +'use strict'; (function() { var assert = chai.assert; mocha.setup({ ui: 'tdd' });