Backed out changeset 17bcfd0ff1df (bug 1179111)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 07 Jul 2015 14:21:39 +0200
changeset 271796 ceeae7a0a4f51ca7f5ee9b470de667dca8fc2f90
parent 271795 a46c51f88f7c9f6ba9a2aafea50fbc6f1830e862
child 271797 0f256f2b3cf40c25740064441624224a1b97f573
push id8304
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 19:25:01 +0000
treeherdermozilla-aurora@7308dd0a6c3b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1179111
milestone42.0a1
backs out17bcfd0ff1df274c81e3c543d0d014f4f7f9d8f7
Backed out changeset 17bcfd0ff1df (bug 1179111)
toolkit/devtools/server/actors/animation.js
--- a/toolkit/devtools/server/actors/animation.js
+++ b/toolkit/devtools/server/actors/animation.js
@@ -108,24 +108,16 @@ let AnimationPlayerActor = ActorClass({
     }
 
     let data = this.getCurrentState();
     data.actor = this.actorID;
 
     return data;
   },
 
-  isAnimation: function(player=this.player) {
-    return player instanceof this.tabActor.window.CSSAnimation;
-  },
-
-  isTransition: function(player=this.player) {
-    return player instanceof this.tabActor.window.CSSTransition;
-  },
-
   /**
    * Some of the player's properties are retrieved from the node's
    * computed-styles because the Web Animations API does not provide them yet.
    * But the computed-styles may contain multiple animations for a node and so
    * we need to know which is the index of the current animation in the style.
    * @return {Number}
    */
   getPlayerIndex: function() {
@@ -143,42 +135,25 @@ let AnimationPlayerActor = ActorClass({
 
     // If there's only one name.
     if (names.includes(",") === -1) {
       return 0;
     }
 
     // If there are several names, retrieve the index of the animation name in
     // the list.
-    let playerName = this.getName();
     names = names.split(",").map(n => n.trim());
     for (let i = 0; i < names.length; i++) {
-      if (names[i] === playerName) {
+      if (names[i] === this.player.effect.name) {
         return i;
       }
     }
   },
 
   /**
-   * Get the name associated with the player. This is used to match
-   * up the player with values in the computed animation-name or
-   * transition-property property.
-   * @return {String}
-   */
-  getName: function() {
-    if (this.isAnimation()) {
-      return this.player.animationName;
-    } else if (this.isTransition()) {
-      return this.player.transitionProperty;
-    } else {
-      return  "";
-    }
-  },
-
-  /**
    * Get the animation duration from this player, in milliseconds.
    * Note that the Web Animations API doesn't yet offer a way to retrieve this
    * directly from the AnimationPlayer object, so for now, a duration is only
    * returned if found in the node's computed styles.
    * @return {Number}
    */
   getDuration: function() {
     let durationText;
@@ -254,17 +229,17 @@ let AnimationPlayerActor = ActorClass({
     // add the corresponding property in the AnimationPlayerFront' initialState
     // getter.
     let newState = {
       // startTime is null whenever the animation is paused or waiting to start.
       startTime: this.player.startTime,
       currentTime: this.player.currentTime,
       playState: this.player.playState,
       playbackRate: this.player.playbackRate,
-      name: this.getName(),
+      name: this.player.effect.name,
       duration: this.getDuration(),
       delay: this.getDelay(),
       iterationCount: this.getIterationCount(),
       // isRunningOnCompositor is important for developers to know if their
       // animation is hitting the fast path or not. Currently only true for
       // Firefox OS (where we have compositor animations enabled).
       // Returns false whenever the animation is paused as it is taken off the
       // compositor then.
@@ -647,21 +622,18 @@ 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));
+          return a.player.effect.name === player.effect.name &&
+                 a.player.effect.target === player.effect.target;
         });
         if (index !== -1) {
           eventData.push({
             type: "removed",
             player: this.actors[index]
           });
           this.actors.splice(index, 1);
         }