User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a) Gecko/20040505 Firefox/0.8.0+ Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8a) Gecko/20040505 Firefox/0.8.0+ Copy in the right-click menu in the DOM inspector nodeName/nodeValue doesn't work. Reproducible: Always Steps to Reproduce: 1. Go to http://www.google.com/ and open the DOM inspector 2. See the node #document -> HTML -> HEAD -> META 3. Hilight a row, "content" or "http-equiv" in the nodeName/nodeValue grid 4. Right-click and select Copy Actual Results: The clipboard contains nothing Expected Results: The clipboard should contain a nodeName/nodeValue pair.
On Linux with nightly version 20040812 of Mozilla. When I do "Copy" from the context menu and paste into KEdit, the previous contents of the clipbard are returned.... in my case "http://www.google.com/". If I do copy XML, the following is returned: "<META content="text/html; charset=UTF-8" http-equiv="content-type"/>" This appears to be correct.
Reporter: Please explain what you expect to be in the clipboard. The clipboard can only be reasonably expected to hold one thing at a time. Do you mean something like: "target='foo'"? Also, why should this block aviary1.1?
(In reply to comment #2) > Reporter: Please explain what you expect to be in the clipboard. The clipboard > can only be reasonably expected to hold one thing at a time. Do you mean > something like: > > "target='foo'"? I think it's sufficient ("target='foo'"). But when you choose "Edit" in the same context menu, the edit box only picks up nodeValue. > Also, why should this block aviary1.1? Because there's "Copy" in the context menu and it does nothing. VERY apparent bug, IMHO.
(In reply to comment #3) > Because there's "Copy" in the context menu and it does nothing. VERY apparent > bug, IMHO. Actually, it does do something. The node is copied and can be pasted elsewhere. If you select a node in the document tree and then "copy", that node can be pasted at another location in the tree. When copying a node in the object pane, that node can be pasted to another object. It seems copy and paste only work within the scope of the DOM inspector.
Alex, The clipboard can hold multiple flavors of a piece of data at the same time (see [Introduction To The Clipboard and Drag & Drop](http://www.mozilla.org/xpfe/xptoolkit/introClipDD.html) and [Using the Clipboard](http://www.xulplanet.com/tutorials/xultu/clipboard.html)). Right now, DOM Inspector only uses one flavor at a time, in this case "inspector/dom-node". Fixing this bug entails adding additional data to the clipboard when name/value pairs are copied from the DOM Node view, with a flavor of "text/unicode" and data like "foo='bar'". In the future, you may also want to make panelset's clipboard attributes aware of multi-flavored data, but this does not seem to be necessary (yet).
Created attachment 213413 [details] [diff] [review] patch v1 The DOM Inspector doesn't actually use the clipboard for moving attributes around itself - it just stores them in variables. I was going to make it use the clipboard for all clipboard operations, but nsITransferable requires that you provide the length of the data to copy, and how do you get the length of a DOM node? Instead, this patch keeps the DOM node as an internal variable but also copies a string in the form nodeName="nodeValue" to the clipboard. This patch also cleans up some stuff related to Undo. It makes Undo not affect the clipboard and makes Copy not count as a transaction that can be Undone.
Assignee: dom-inspector → jason_barnabe
Status: NEW → ASSIGNED
Attachment #213413 - Flags: review?(timeless)
Created attachment 213505 [details] [diff] [review] patch v2 timeless give r+ over IRC on the condition that I move the clipboard helper and charTable somewhere that they don't have to be recreated every time.
Comment on attachment 213505 [details] [diff] [review] patch v2 >+var kEntityConverter; Please change this back to gEntityConverter; k is for Konstant. >+ const entityVersion = Components.interfaces.nsIEntityConverter.entityW3C; It looks odd to declare this after it's used! >+ var str = text; No idea what this is for; please fix to use the same variable throughout.
Attachment #213505 - Flags: superreview?(neil) → superreview+
Created attachment 214094 [details] [diff] [review] patch v3 Updated to comments.
Attachment #213505 - Attachment is obsolete: true
Comment on attachment 214094 [details] [diff] [review] patch v3 mozilla/extensions/inspector/resources/content/viewers/domNode/domNode.js 1.18 mozilla/extensions/inspector/resources/content/viewers/dom/dom.js 1.38 mozilla/extensions/inspector/resources/content/utils.js 1.12 mozilla/extensions/inspector/resources/content/inspector.xml 1.19
Attachment #214094 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
*** Bug 328201 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.