зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1109390 part 4 - Make DevTools animation actor wait for asynchronous pause; r=pbrosset
Although pause() is not yet asynchronous, any time we finish calling it the ready promise should be resolved so we can safely wait on the ready promise after calling pause already. This way, once pause() becomes async later in this bug, code relying on this actor will continue to work.
This commit is contained in:
Родитель
511c419852
Коммит
17d6d8b8b2
|
@ -250,6 +250,7 @@ let AnimationPlayerActor = ActorClass({
|
|||
*/
|
||||
pause: method(function() {
|
||||
this.player.pause();
|
||||
return this.player.ready;
|
||||
}, {
|
||||
request: {},
|
||||
response: {}
|
||||
|
@ -513,10 +514,13 @@ let AnimationsActor = exports.AnimationsActor = ActorClass({
|
|||
* Pause all animations in the current tabActor's frames.
|
||||
*/
|
||||
pauseAll: method(function() {
|
||||
let readyPromises = [];
|
||||
for (let player of this.getAllAnimationPlayers()) {
|
||||
player.pause();
|
||||
readyPromises.push(player.ready);
|
||||
}
|
||||
this.allAnimationsPaused = true;
|
||||
return promise.all(readyPromises);
|
||||
}, {
|
||||
request: {},
|
||||
response: {}
|
||||
|
|
Загрузка…
Ссылка в новой задаче