Index: Source/devtools/front_end/ElementsPanel.js |
diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js |
index 707c4c0ff64b47ba3e7857bab59b416825513225..53e762263411ce3f65225e20474270a63eef364b 100644 |
--- a/Source/devtools/front_end/ElementsPanel.js |
+++ b/Source/devtools/front_end/ElementsPanel.js |
@@ -119,9 +119,6 @@ WebInspector.ElementsPanel = function() |
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdatedEvent, this); |
WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this)); |
- if (WebInspector.domAgent.existingDocument()) |
- this._documentUpdated(WebInspector.domAgent.existingDocument()); |
- |
WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled, this._updateSidebars, this); |
} |
@@ -168,7 +165,10 @@ WebInspector.ElementsPanel.prototype = { |
this.treeOutline.setVisible(true); |
if (!this.treeOutline.rootDOMNode) |
- WebInspector.domAgent.requestDocument(); |
+ if (WebInspector.domAgent.existingDocument()) |
+ this._documentUpdated(WebInspector.domAgent.existingDocument()); |
+ else |
+ WebInspector.domAgent.requestDocument(); |
}, |
willHide: function() |
@@ -188,6 +188,16 @@ WebInspector.ElementsPanel.prototype = { |
this._updateTreeOutlineVisibleWidth(); |
}, |
+ omitDefaultSelection: function() |
+ { |
+ this._omitDefaultSelection = true; |
+ }, |
+ |
+ stopOmittingDefaultSelection: function() |
+ { |
+ delete this._omitDefaultSelection; |
+ }, |
+ |
/** |
* @param {!DOMAgent.NodeId} nodeId |
* @param {string} pseudoClass |
@@ -312,6 +322,9 @@ WebInspector.ElementsPanel.prototype = { |
selectNode.call(this, node); |
} |
+ if (this._omitDefaultSelection) |
+ return; |
+ |
if (this._selectedPathOnReset) |
WebInspector.domAgent.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this)); |
else |
@@ -1350,7 +1363,14 @@ WebInspector.ElementsPanel.DOMNodeRevealer.prototype = { |
*/ |
reveal: function(node) |
{ |
- if (node instanceof WebInspector.DOMNode) |
- /** @type {!WebInspector.ElementsPanel} */ (WebInspector.showPanel("elements")).revealAndSelectNode(node.id); |
+ if (!(node instanceof WebInspector.DOMNode)) |
+ return; |
+ |
+ if (WebInspector.inspectElementModeController && WebInspector.inspectElementModeController.enabled()) { |
+ InspectorFrontendHost.bringToFront(); |
+ WebInspector.inspectElementModeController.disable(); |
+ } |
+ |
+ /** @type {!WebInspector.ElementsPanel} */ (WebInspector.panel("elements")).revealAndSelectNode(node.id); |
} |
} |