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

Unified Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js

Issue 1403853002: Devtools: DOM inspection follows inspect cursor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 5 years, 2 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: third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
index e9beaa2bf49508b291e392f5363fb0d1ecf74e7f..a401a39d08c926795e3598073413b8e892a9f689 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -99,6 +99,7 @@ WebInspector.ElementsPanel = function()
WebInspector.targetManager.observeTargets(this);
WebInspector.moduleSetting("showUAShadowDOM").addChangeListener(this._showUAShadowDOMChanged.bind(this));
WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.DocumentUpdated, this._documentUpdatedEvent, this);
+ WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeHighlightedInOverlay, this._highlightNode, this);
WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this);
}
@@ -696,6 +697,18 @@ WebInspector.ElementsPanel.prototype = {
},
/**
+ * @param {!WebInspector.Event} event
+ */
+ _highlightNode: function(event)
+ {
+ var domNode = /** @type {!WebInspector.DOMNode} */ (event.data);
+ for (var i = 0; i < this._treeOutlines.length; ++i) {
+ var treeOutline = this._treeOutlines[i];
+ treeOutline.highlightNode(treeOutline.domModel() === domNode.domModel() ? domNode : null);
+ }
+ },
+
+ /**
* @param {!WebInspector.DOMNode} node
* @param {boolean=} focus
*/

Powered by Google App Engine
This is Rietveld 408576698