mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
Backed out changeset f09ea2712445 (bug 1229913
)
This commit is contained in:
parent
16cd1b6be9
commit
f04b97e3ce
@ -144,13 +144,6 @@ var AnimationsController = {
|
||||
// Expose actor capabilities.
|
||||
this.traits = yield getServerTraits(target);
|
||||
|
||||
// We want to handle animation mutation events synchronously to avoid race
|
||||
// conditions when there are many rapid mutations. So when a mutation occurs
|
||||
// and animations are removed, we don't release the corresponding actors
|
||||
// in a blocking way, we just release asynchronously and don't wait for
|
||||
// completion, but instead store the promise in this array.
|
||||
this.nonBlockingPlayerReleases = [];
|
||||
|
||||
if (this.destroyed) {
|
||||
console.warn("Could not fully initialize the AnimationsController");
|
||||
return;
|
||||
@ -183,9 +176,6 @@ var AnimationsController = {
|
||||
yield this.destroyAnimationPlayers();
|
||||
this.nodeFront = null;
|
||||
|
||||
// Finish releasing players that haven't been released yet.
|
||||
yield Promise.all(this.nonBlockingPlayerReleases);
|
||||
|
||||
if (this.animationsFront) {
|
||||
this.animationsFront.destroy();
|
||||
this.animationsFront = null;
|
||||
@ -341,7 +331,7 @@ var AnimationsController = {
|
||||
}
|
||||
}),
|
||||
|
||||
onAnimationMutations: function(changes) {
|
||||
onAnimationMutations: Task.async(function*(changes) {
|
||||
// Insert new players into this.animationPlayers when new animations are
|
||||
// added.
|
||||
for (let {type, player} of changes) {
|
||||
@ -350,8 +340,7 @@ var AnimationsController = {
|
||||
}
|
||||
|
||||
if (type === "removed") {
|
||||
// Don't wait for the release request to complete, we can do that later.
|
||||
this.nonBlockingPlayerReleases.push(player.release());
|
||||
yield player.release();
|
||||
let index = this.animationPlayers.indexOf(player);
|
||||
this.animationPlayers.splice(index, 1);
|
||||
}
|
||||
@ -359,7 +348,7 @@ var AnimationsController = {
|
||||
|
||||
// Let the UI know the list has been updated.
|
||||
this.emit(this.PLAYERS_UPDATED_EVENT, this.animationPlayers);
|
||||
},
|
||||
}),
|
||||
|
||||
/**
|
||||
* Get the latest known current time of document.timeline.
|
||||
|
Loading…
Reference in New Issue
Block a user