Skip to content

Commit

Permalink
Merge pull request #488 from ewilligers/strict
Browse files Browse the repository at this point in the history
Use strict
  • Loading branch information
alancutter authored Aug 4, 2016
2 parents 9779cac + 96e1cb6 commit 06550eb
Show file tree
Hide file tree
Showing 36 changed files with 48 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/apply-preserving-inline-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions src/apply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/box-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/color-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions src/deprecation.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';
(function(shared) {

var silenced = {};
Expand Down
1 change: 1 addition & 0 deletions src/dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
1 change: 1 addition & 0 deletions src/dimension-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/effect-callback.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions src/element-animatable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
1 change: 1 addition & 0 deletions src/font-weight-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/group-constructors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -116,7 +117,8 @@
},
remove: function() {
scope.removeMulti([this]);
}
},
_updateActiveDuration: function() {}
};

window.SequenceEffect.prototype = Object.create(constructor.prototype);
Expand Down
1 change: 1 addition & 0 deletions src/handler-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
1 change: 1 addition & 0 deletions src/interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
9 changes: 8 additions & 1 deletion src/keyframe-effect-constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
};
Expand All @@ -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.');
Expand All @@ -104,6 +108,9 @@
},
remove: function() {
scope.removeMulti([this]);
},
_updateActiveDuration: function() {
this._activeDuration = shared.calculateActiveDuration(this._timing);
}
};

Expand Down
1 change: 1 addition & 0 deletions src/keyframe-effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/keyframe-interpolations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/matrix-decomposition.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/matrix-interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/normalize-keyframes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down
1 change: 1 addition & 0 deletions src/number-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/position-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/property-interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
1 change: 1 addition & 0 deletions src/property-names.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
1 change: 1 addition & 0 deletions src/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {};
Expand Down
1 change: 1 addition & 0 deletions src/shadow-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/shape-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
2 changes: 1 addition & 1 deletion src/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions src/timing-utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -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('|');
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions src/transform-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/visibility-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/web-animations-bonus-cancel-events.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions src/web-animations-bonus-object-form-keyframes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/web-animations-next-animation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];

Expand Down
1 change: 1 addition & 0 deletions test/testharness-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down

0 comments on commit 06550eb

Please sign in to comment.