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

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

Issue 23201018: DevTools: add "Jump to Relayout Boundary" context menu item in Elements panel (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 874d83e766fcb7ebfd3d881c0ccc2a3480874655..f50b3e9ceb7723ff3e160767aac726970cd58f18 100644
--- a/Source/devtools/front_end/ElementsPanel.js
+++ b/Source/devtools/front_end/ElementsPanel.js
@@ -395,12 +395,37 @@ WebInspector.ElementsPanel.prototype = {
this.selectDOMNode(node, true);
},
+ /**
+ * @param {WebInspector.ContextMenu} contextMenu
+ * @param {WebInspector.DOMNode} node
+ */
_populateContextMenu: function(contextMenu, node)
{
// Add debbuging-related actions
contextMenu.appendSeparator();
var pane = WebInspector.domBreakpointsSidebarPane;
pane.populateNodeContextMenu(node, contextMenu);
+ contextMenu.appendSeparator();
+ contextMenu.appendItem(WebInspector.UIString("Jump to Relayout Boundary"), this._jumpToRelayoutBoundary.bind(this, node));
pfeldman 2013/09/06 13:35:51 I don't think it makes sense putting it here. Lets
+
+ },
+
+ /**
+ * @param {WebInspector.DOMNode} node
+ */
+ _jumpToRelayoutBoundary: function(node)
+ {
+ /**
+ * @param {?Protocol.Error} error
+ * @param {DOMAgent.NodeId=} nodeId
+ */
+ function callback(error, nodeId)
+ {
+ if (error || !nodeId)
+ return;
+ this.revealAndSelectNode(nodeId);
+ }
+ node.findRelayoutBoundary(callback.bind(this));
},
_getPopoverAnchor: function(element)

Powered by Google App Engine
This is Rietveld 408576698