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); |