| OLD | NEW |
| 1 // Copyright 2014 Google Inc. All rights reserved. | 1 // Copyright 2014 Google Inc. All rights reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 tick(t); | 43 tick(t); |
| 44 applyPendingEffects(); | 44 applyPendingEffects(); |
| 45 } | 45 } |
| 46 | 46 |
| 47 function comparePlayers(leftPlayer, rightPlayer) { | 47 function comparePlayers(leftPlayer, rightPlayer) { |
| 48 return leftPlayer._sequenceNumber - rightPlayer._sequenceNumber; | 48 return leftPlayer._sequenceNumber - rightPlayer._sequenceNumber; |
| 49 } | 49 } |
| 50 | 50 |
| 51 function InternalTimeline() { | 51 function InternalTimeline() { |
| 52 this._players = []; | 52 this._players = []; |
| 53 this.currentTime = window.performance ? performance.now() : 0; | 53 // Android 4.3 browser has window.performance, but not window.performance.no
w |
| 54 this.currentTime = window.performance && performance.now ? performance.now()
: 0; |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 InternalTimeline.prototype = { | 57 InternalTimeline.prototype = { |
| 57 _play: function(source) { | 58 _play: function(source) { |
| 58 source._timing = shared.normalizeTimingInput(source.timing); | 59 source._timing = shared.normalizeTimingInput(source.timing); |
| 59 var player = new scope.Player(source); | 60 var player = new scope.Player(source); |
| 60 player._idle = false; | 61 player._idle = false; |
| 61 player._timeline = this; | 62 player._timeline = this; |
| 62 this._players.push(player); | 63 this._players.push(player); |
| 63 scope.restart(); | 64 scope.restart(); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 | 138 |
| 138 if (WEB_ANIMATIONS_TESTING) { | 139 if (WEB_ANIMATIONS_TESTING) { |
| 139 testing.tick = processRafCallbacks; | 140 testing.tick = processRafCallbacks; |
| 140 testing.isTicking = function() { return ticking; }; | 141 testing.isTicking = function() { return ticking; }; |
| 141 testing.setTicking = function(newVal) { ticking = newVal; }; | 142 testing.setTicking = function(newVal) { ticking = newVal; }; |
| 142 } | 143 } |
| 143 | 144 |
| 144 var timeline = new InternalTimeline(); | 145 var timeline = new InternalTimeline(); |
| 145 scope.timeline = timeline; | 146 scope.timeline = timeline; |
| 146 | 147 |
| 147 })(webAnimationsShared, webAnimationsMinifill, webAnimationsTesting); | 148 })(webAnimationsShared, webAnimations1, webAnimationsTesting); |
| OLD | NEW |