Bug 1568874 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

In the main panel file: animation.js

```
  _getAnimationsFront() {
    if (this.animationsFrontPromise) {
      return this.animationsFrontPromise;
    }
    this.animationsFrontPromise = (async () => {
      const target = this.inspector.currentTarget;
      const front = await target.getFront("animations");
      front.setWalkerActor(this.inspector.walker);
      return front;
    })();
    return this.animationsFrontPromise;
  }
```

will need to be changed. This is called just once when the panel starts.
This is wrong for 2 reasons:

* with fission, there will be process switches on navigation, so we need to use the `TargetList` API to react to new top-level targets and get the new animations front when that happens
* but also, we want to get the animations that are running inside the frame of the currently selected element, so we might as well get the animations front only when a new node is selected, using `selection.nodeFront.targetFront.getFront("animations")` instead.
In the main panel file: [animation.js](https://searchfox.org/mozilla-central/source/devtools/client/inspector/animation/animation.js), this function

```
  _getAnimationsFront() {
    if (this.animationsFrontPromise) {
      return this.animationsFrontPromise;
    }
    this.animationsFrontPromise = (async () => {
      const target = this.inspector.currentTarget;
      const front = await target.getFront("animations");
      front.setWalkerActor(this.inspector.walker);
      return front;
    })();
    return this.animationsFrontPromise;
  }
```

will need to be changed. This is called just once when the panel starts.
This is wrong for 2 reasons:

* with fission, there will be process switches on navigation, so we need to use the `TargetList` API to react to new top-level targets and get the new animations front when that happens
* but also, we want to get the animations that are running inside the frame of the currently selected element, so we might as well get the animations front only when a new node is selected, using `selection.nodeFront.targetFront.getFront("animations")` instead.

Back to Bug 1568874 Comment 3