Backed out changeset f09ea2712445 (bug 1229913)

This commit is contained in:
Carsten "Tomcat" Book 2016-02-04 16:41:33 +01:00
parent 16cd1b6be9
commit f04b97e3ce

View File

@ -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.