Bug 1174060 - 1 - Fix auto-removed animations that have the same name but different targets; r=miker
authorPatrick Brosset <pbrosset@mozilla.com>
Fri, 28 Aug 2015 11:42:58 +0200
changeset 293778 10a7429d7ed573890a4618e173fbdfb06372dc76
parent 293777 76ee6c1608fa9c911c344bf326b3ab215119a764
child 293779 688b108cdfe0cdf4efb333ee2ea0241a2a29bc32
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmiker
bugs1174060
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1174060 - 1 - Fix auto-removed animations that have the same name but different targets; r=miker
toolkit/devtools/server/actors/animation.js
--- a/toolkit/devtools/server/actors/animation.js
+++ b/toolkit/devtools/server/actors/animation.js
@@ -684,21 +684,24 @@ let AnimationsActor = exports.Animations
         // it out when it was reported as removed. So filter it out here too.
         if (this.actors.find(a => a.player === player)) {
           continue;
         }
         // If the added player has the same name and target node as a player we
         // already have, it means it's a transition that's re-starting. So send
         // a "removed" event for the one we already have.
         let index = this.actors.findIndex(a => {
-          return a.player.constructor === player.constructor &&
-                 ((a.isAnimation() &&
-                   a.player.animationName === player.animationName) ||
-                  (a.isTransition() &&
-                   a.player.transitionProperty === player.transitionProperty));
+          let isSameType = a.player.constructor === player.constructor;
+          let isSameName = (a.isAnimation() &&
+                            a.player.animationName === player.animationName) ||
+                           (a.isTransition() &&
+                            a.player.transitionProperty === player.transitionProperty);
+          let isSameNode = a.player.effect.target === player.effect.target;
+
+          return isSameType && isSameNode && isSameName;
         });
         if (index !== -1) {
           eventData.push({
             type: "removed",
             player: this.actors[index]
           });
           this.actors.splice(index, 1);
         }