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

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

Issue 16561003: DevTools: Inspect element mode does not select element in ShadowDOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: For landing Created 7 years, 6 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
Index: Source/devtools/front_end/ElementsPanel.js
diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js
index b29c92d834a10130ee51be8416429790148706fb..2900a8bcdf2c7f2d01997d5ab9c9f59b0315bc9d 100755
--- a/Source/devtools/front_end/ElementsPanel.js
+++ b/Source/devtools/front_end/ElementsPanel.js
@@ -107,6 +107,7 @@ WebInspector.ElementsPanel = function()
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.NodeRemoved, this._nodeRemoved, this);
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdatedEvent, this);
WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.InspectElementRequested, this._inspectElementRequested, this);
+ WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));
if (WebInspector.domAgent.existingDocument())
this._documentUpdated(WebInspector.domAgent.existingDocument());
@@ -1065,6 +1066,9 @@ WebInspector.ElementsPanel.prototype = {
if (!node)
return;
+ while (!WebInspector.settings.showShadowDOM.get() && node && node.isInShadowTree())
+ node = node.parentNode;
+
WebInspector.domAgent.highlightDOMNodeForTwoSeconds(nodeId);
this.selectDOMNode(node, true);
},
@@ -1108,6 +1112,11 @@ WebInspector.ElementsPanel.prototype = {
this._splitVertically(vertically);
},
+ _showShadowDOMChanged: function()
+ {
+ this.treeOutline.update();
+ },
+
/**
* @param {boolean} vertically
*/

Powered by Google App Engine
This is Rietveld 408576698