Ability to serialize an element subtree (into clipboard?) from the DOM inspector This would be very useful when debugging SVGs. if a piece is not rendering (especially when it's rendered by javascript), the ability to just select that piece and serialize it to the clipboard would be very useful. Then I can paste it into a new file and debug.
Created attachment 17165 [details] Patch
Created attachment 17166 [details] Patch
Comment on attachment 17166 [details] Patch r=me with the comment clarification Alexey mentioned in #webkit.
Comment on attachment 17166 [details] Patch + and it's subtree is copied to the clipboard. If the node has no Typo: it's -> its + var data = this.focusedDOMNode.outerHTML; + if (!data) + data = this.focusedDOMNode.nodeValue; You should be able to use || for this. + if (this.currentFocusElement.handleCopyEvent) + event.preventDefault(); + else if (this.currentFocusElement.id && this.currentFocusElement.id.length && WebInspector[this.currentFocusElement.id + "Copy"]) + event.preventDefault(); I think this would be clearer with || instead of else if, though I suppose this way the code is more similar to documentCopy. r=me
Landed in r27663. http://trac.webkit.org/projects/webkit/changeset/27663
I've been playing with this feature to see if it lets one copy text from password fields (it apparently doesn't), and noticed a quirk - copying via a context menu gives different results than copying via a keyboard shortcut. E.g. when copying an input element from the tree, I just get "input".
Right clicking selects the word under the mouse. And since there is a selection, we allow the normal copy path. I guess we should make this smarter somehow, but it will be tricky.
The word being selected on right-click is actually in the breadcrumb, not right under the mouse!