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

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

Issue 75253002: DevTools: [Elements] Implement "Copy CSS Path" context menu item for elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Improve JsDoc Created 7 years, 1 month 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/ElementsTreeOutline.js
diff --git a/Source/devtools/front_end/ElementsTreeOutline.js b/Source/devtools/front_end/ElementsTreeOutline.js
index 7ddbfac7bbc670037fbbf911331c42205f508c52..1c583df8649e162f1385a652f6b8a4760ee3c3ff 100644
--- a/Source/devtools/front_end/ElementsTreeOutline.js
+++ b/Source/devtools/front_end/ElementsTreeOutline.js
@@ -1333,7 +1333,6 @@ WebInspector.ElementsTreeElement.prototype = {
this._populateForcedPseudoStateItems(pseudoSubMenu);
contextMenu.appendSeparator();
}
-
this._populateNodeContextMenu(contextMenu);
this.treeOutline._populateContextMenu(contextMenu, this._node);
this._populateScrollIntoView(contextMenu);
@@ -1371,6 +1370,10 @@ WebInspector.ElementsTreeElement.prototype = {
var openTagElement = this.treeOutline.getCachedTreeElement(this.representedObject) || this;
contextMenu.appendItem(WebInspector.UIString("Edit as HTML"), openTagElement._editAsHTML.bind(openTagElement));
contextMenu.appendItem(WebInspector.UIString("Copy as HTML"), this._copyHTML.bind(this));
+
+ // Place it here so that all "Copy"-ing items stick together.
+ if (this.representedObject.nodeType() === Node.ELEMENT_NODE)
+ contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Copy CSS path" : "Copy CSS Path"), this._copyCSSPath.bind(this));
contextMenu.appendItem(WebInspector.UIString("Copy XPath"), this._copyXPath.bind(this));
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Delete node" : "Delete Node"), this.remove.bind(this));
contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Inspect DOM properties" : "Inspect DOM Properties"), this._inspectDOMProperties.bind(this));
@@ -2184,6 +2187,11 @@ WebInspector.ElementsTreeElement.prototype = {
this._node.copyNode();
},
+ _copyCSSPath: function()
+ {
+ this._node.copyCSSPath(true);
+ },
+
_copyXPath: function()
{
this._node.copyXPath(true);
« Source/devtools/front_end/DOMAgent.js ('K') | « Source/devtools/front_end/DOMAgent.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698