Bug 1450526 - Part 1: Make pseudo element to be available in new animatoin inspector. r?pbro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 03 Apr 2018 17:15:51 +0900
changeset 776545 c1ae94928cf0924292a1a2d69e6b0ca92022b670
parent 776544 57b242c243caa484362480748eba82f4716a6def
child 776546 ab06e5a8bc856339e1f11f436ee058e26a6991e6
push id104903
push userbmo:dakatsuka@mozilla.com
push dateTue, 03 Apr 2018 10:10:29 +0000
reviewerspbro
bugs1450526
milestone61.0a1
Bug 1450526 - Part 1: Make pseudo element to be available in new animatoin inspector. r?pbro MozReview-Commit-ID: ID9ciTjflem
devtools/client/inspector/animation/animation.js
--- a/devtools/client/inspector/animation/animation.js
+++ b/devtools/client/inspector/animation/animation.js
@@ -95,16 +95,17 @@ class AnimationInspector {
       toggleElementPicker,
     } = this;
 
     const target = this.inspector.target;
     this.animationsFront = new AnimationsFront(target.client, target.form);
 
     this.animationsCurrentTimeListeners = [];
     this.isCurrentTimeSet = false;
+    this.currentWalker = null;
 
     const provider = createElement(Provider,
       {
         id: "newanimationinspector",
         key: "newanimationinspector",
         store: this.inspector.store
       },
       App(
@@ -163,16 +164,17 @@ class AnimationInspector {
 
     if (this.simulatedAnimationForKeyframesProgressBar) {
       this.simulatedAnimationForKeyframesProgressBar.cancel();
       this.simulatedAnimationForKeyframesProgressBar = null;
     }
 
     this.stopAnimationsCurrentTimeTimer();
 
+    this.currentWalker = null;
     this.inspector = null;
     this.win = null;
   }
 
   get state() {
     return this.inspector.store.getState().animations;
   }
 
@@ -525,16 +527,21 @@ class AnimationInspector {
 
   toggleElementPicker() {
     this.inspector.toolbox.highlighterUtils.togglePicker();
   }
 
   async update() {
     const done = this.inspector.updating("newanimationinspector");
 
+    if (this.currentWalker !== this.inspector.walker) {
+      await this.animationsFront.setWalkerActor(this.inspector.walker);
+      this.currentWalker = this.inspector.walker;
+    }
+
     const selection = this.inspector.selection;
     const nextAnimations =
       selection.isConnected() && selection.isElementNode()
       ? await this.animationsFront.getAnimationPlayersForNode(selection.nodeFront)
       : [];
     const currentAnimations = this.state.animations;
 
     if (!currentAnimations || !isAllAnimationEqual(currentAnimations, nextAnimations)) {