Bug 1468711 - Part 1: Send a proper element for pseudo element to nsDOMWindowUtils::ComputeAnimationDistance. r?pbro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Wed, 27 Jun 2018 10:22:06 +0900
changeset 811187 b39c3e56da87bcbe6c5c8f485c834b87f33e0346
parent 811103 1c235a552c32ba6c97e6030c497c49f72c7d48a8
child 811188 e1b9a09a0e8b5349cce0e45e78de36abdd9630b2
push id114222
push userbmo:dakatsuka@mozilla.com
push dateWed, 27 Jun 2018 05:20:14 +0000
reviewerspbro
bugs1468711
milestone63.0a1
Bug 1468711 - Part 1: Send a proper element for pseudo element to nsDOMWindowUtils::ComputeAnimationDistance. r?pbro MozReview-Commit-ID: 4xTST1tBeEW
devtools/server/actors/animation.js
--- a/devtools/server/actors/animation.js
+++ b/devtools/server/actors/animation.js
@@ -525,18 +525,18 @@ var AnimationPlayerActor = protocol.Acto
     // Calculate the distance.
     for (const property of properties) {
       const propertyName = property.name;
       const maxObject = { distance: -1 };
       for (let i = 0; i < property.values.length - 1; i++) {
         const value1 = property.values[i].value;
         for (let j = i + 1; j < property.values.length; j++) {
           const value2 = property.values[j].value;
-          const distance = this.getDistance(this.player.effect.target, propertyName,
-                                            value1, value2, DOMWindowUtils);
+          const distance =
+            this.getDistance(this.node, propertyName, value1, value2, DOMWindowUtils);
           if (maxObject.distance >= distance) {
             continue;
           }
           maxObject.distance = distance;
           maxObject.value1 = value1;
           maxObject.value2 = value2;
         }
       }
@@ -550,18 +550,18 @@ var AnimationPlayerActor = protocol.Acto
           return current;
         }, property.values[0]);
         continue;
       }
       const baseValue =
         maxObject.value1 < maxObject.value2 ? maxObject.value1 : maxObject.value2;
       for (const values of property.values) {
         const value = values.value;
-        const distance = this.getDistance(this.player.effect.target, propertyName,
-                                          baseValue, value, DOMWindowUtils);
+        const distance =
+          this.getDistance(this.node, propertyName, baseValue, value, DOMWindowUtils);
         values.distance = distance / maxObject.distance;
       }
     }
     return properties;
   },
 
   /**
    * Get the animation types for a given list of CSS property names.