Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Unified Diff: Source/devtools/front_end/ElementsPanel.js

Issue 177653004: DevTools: Get rid of redundant default selection during inspectElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/inspector.js » ('j') | Source/devtools/front_end/inspector.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/ElementsPanel.js
diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js
index 8f66a85f372ea8123eb8d13c98caa3a11dbd1872..ea1745d9a023d254c9999f3945fd9b25cc4d2396 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
@@ -1351,6 +1364,6 @@ WebInspector.ElementsPanel.DOMNodeRevealer.prototype = {
reveal: function(node)
{
if (node instanceof WebInspector.DOMNode)
- /** @type {!WebInspector.ElementsPanel} */ (WebInspector.showPanel("elements")).revealAndSelectNode(node.id);
+ /** @type {!WebInspector.ElementsPanel} */ (WebInspector.panel("elements")).revealAndSelectNode(node.id);
}
}
« no previous file with comments | « no previous file | Source/devtools/front_end/inspector.js » ('j') | Source/devtools/front_end/inspector.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698