From 431636d12a0259c873e418e64e18fc07e954342e Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Fri, 18 Oct 2019 09:07:42 +0000 Subject: [PATCH] Bug 1577783 - Use inspectorFront's getNodeFrontFromNodeGrip function in WebConsole's openNodeInInspector. r=pbro,rcaliman. We retrieve the right NodeFront from a given grip, which we can then tell the inspector panel to select. Differential Revision: https://phabricator.services.mozilla.com/D48810 --HG-- extra : moz-landing-system : lando --- devtools/client/webconsole/webconsole.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/devtools/client/webconsole/webconsole.js b/devtools/client/webconsole/webconsole.js index 0d560451dae8..ec1fca542ee2 100644 --- a/devtools/client/webconsole/webconsole.js +++ b/devtools/client/webconsole/webconsole.js @@ -437,17 +437,18 @@ class WebConsole { "inspector", "inspect_dom" ); - // TODO: Bug1574506 - Use the contextual WalkerFront for gripToNodeFront. - const walkerFront = (await this.toolbox.target.getFront("inspector")) - .walker; - const onGripNodeToFront = walkerFront.gripToNodeFront(grip); - const [front, inspector] = await Promise.all([ - onGripNodeToFront, + + const onNodeFront = this.toolbox.target + .getFront("inspector") + .then(inspectorFront => inspectorFront.getNodeFrontFromNodeGrip(grip)); + + const [nodeFront, inspectorPanel] = await Promise.all([ + onNodeFront, onSelectInspector, ]); - const onInspectorUpdated = inspector.once("inspector-updated"); - const onNodeFrontSet = this.toolbox.selection.setNodeFront(front, { + const onInspectorUpdated = inspectorPanel.once("inspector-updated"); + const onNodeFrontSet = this.toolbox.selection.setNodeFront(nodeFront, { reason: "console", });