Bug 1249219 - Part 8: Avoid adding animations on pseudo elements for Inspector temporary. r=pbro
authorBoris Chiou <boris.chiou@gmail.com>
Mon, 21 Mar 2016 16:49:51 +0800
changeset 289649 0c90d5d3f78dfd7d98a4a4c75c70f3d1ae4908c0
parent 289648 cc5d40fcf830cadbfd3cc02730a663c71217111c
child 289650 f17a9b5483168647a9c50cd2ab0ef1534d9d0715
push id73934
push userryanvm@gmail.com
push dateMon, 21 Mar 2016 18:22:04 +0000
treeherdermozilla-inbound@0c90d5d3f78d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbro
bugs1249219
milestone48.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 1249219 - Part 8: Avoid adding animations on pseudo elements for Inspector temporary. r=pbro
devtools/server/actors/animation.js
--- a/devtools/server/actors/animation.js
+++ b/devtools/server/actors/animation.js
@@ -617,32 +617,50 @@ var AnimationsActor = exports.Animations
         // actually removed from the node (e.g. css class removed) or when they
         // are finished and don't have forwards animation-fill-mode.
         // In the latter case, we don't send an event, because the corresponding
         // animation can still be seeked/resumed, so we want the client to keep
         // its reference to the AnimationPlayerActor.
         if (player.playState !== "idle") {
           continue;
         }
+        // FIXME: In bug 1249219, we support the animation mutation for pseudo
+        // elements. However, the timeline may not be ready yet to
+        // display those correctly. Therefore, we add this check to bails out if
+        // the mutation target is a pseudo-element.
+        // Note. Only CSSPseudoElement object has |type| attribute, so if type
+        // exists, it is a CSSPseudoElement object.
+        if (player.effect.target.type) {
+          continue;
+        }
         let index = this.actors.findIndex(a => a.player === player);
         if (index !== -1) {
           eventData.push({
             type: "removed",
             player: this.actors[index]
           });
           this.actors.splice(index, 1);
         }
       }
 
       for (let player of addedAnimations) {
         // If the added player already exists, it means we previously filtered
         // it out when it was reported as removed. So filter it out here too.
         if (this.actors.find(a => a.player === player)) {
           continue;
         }
+        // FIXME: In bug 1249219, we support the animation mutation for pseudo
+        // elements. However, the timeline may not be ready yet to
+        // display those correctly. Therefore, we add this check to bails out if
+        // the mutation target is a pseudo-element.
+        // Note. Only CSSPseudoElement object has |type| attribute, so if type
+        // exists, it is a CSSPseudoElement object.
+        if (player.effect.target.type) {
+          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 => {
           let isSameType = a.player.constructor === player.constructor;
           let isSameName = (a.isCssAnimation() &&
                             a.player.animationName === player.animationName) ||
                            (a.isCssTransition() &&