Closed Bug 121182 Opened 23 years ago Closed 19 years ago

Can't copy values from computed style

Categories

(Other Applications :: DOM Inspector, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: timeless, Assigned: jason.barnabe)

Details

Attachments

(1 file, 2 obsolete files)

run inspector inspect navigator dig down to window>toolbox>xul:vbox>#navbar>xul:hbox>#navbar-buttons>toolbarbutton select view computed style select -moz-binding try to edit>copy try to right-click>copy try to ctrl-c [copy] expect the style and value to be copied to the clipboard. bonus points: copy the pair in a tabular/collumn format for html, and tab separated for text/plain.
Status: NEW → ASSIGNED
Target Milestone: --- → Future
I think it would be better to copy these values in a format ready for dropping into a CSS rule. Eg: following the steps in comment 0, the following would be on the clipboard: -moz-binding: url(chrome://foo/bar.xml#binding); I can see having more practical uses for that, since I can copy a value that I haven't specified yet, add it to my document's specified stylesheet, make modifications to its specified value, and see what effect ot has on the original document.
Mass re-assigning bugs to dom.inspector@extensions.bugs
Assignee: hewitt → dom.inspector
Status: ASSIGNED → NEW
And in addition to copying one rule, be able to copy a selection of multiple rules (ready de drop into CSS). One practicel use of such feature would be to facilitate the developpment of theme-independant stylesheets for applications : develop one the basis of one theme, copy all the resulting CSS rules : your styles won't change if the theme changes.
Keywords: helpwanted
Product: Core → Other Applications
Show me how to properly utilize the clipboard, and I'll probably be interested in fixing this.
Attached patch patch v1 (obsolete) — Splinter Review
This copies the declarations to the clipboard in the format described in comment 1. It supports multiple selection; each declaration will be seperated by a newline.
Assignee: dom-inspector → jason_barnabe
Status: NEW → ASSIGNED
Attachment #220482 - Flags: review?(timeless)
Keywords: helpwanted
Comment on attachment 220482 [details] [diff] [review] patch v1 You could get fancy and have function InCSSDecl(prop, val) { this.property=prop; this.value=val; } InCSSDecl.prototype.toString = function() { return this.property + ": " + this.value + ";"; } and then return new InCSSDecl(view.getCellText(aIndex, {id: "olcStyleName"}), value: view.getCellText(aIndex, {id: "olcStyleValue"}); and later: viewer.pane.panelset.setClipboardData(copiedDeclarations, "inspector/css-declarations", copiedDeclarations.join("\n")); Note: some of your lines have trailing whitespace, it'd be nice if that didn't make it into cvs (or future patches ;-).
Attachment #220482 - Flags: superreview?(neil)
Attachment #220482 - Flags: review?(timeless)
Attachment #220482 - Flags: review+
Attachment #220482 - Flags: superreview?(neil)
Attached patch patch v2 (obsolete) — Splinter Review
More fancy, less whitespace.
Attachment #220482 - Attachment is obsolete: true
Attachment #221937 - Flags: superreview?(neil)
Comment on attachment 221937 [details] [diff] [review] patch v2 >+ var rangeCount = this.mTree.view.selection.getRangeCount(); >+ this.mOlBox.view.selection.getRangeAt(i,start,end); Please consistently use this.mTree.view throughout. sr=me with this fixed.
Attachment #221937 - Flags: superreview?(neil) → superreview+
Attached patch patch v3Splinter Review
All uses of mOlBox removed.
Attachment #221937 - Attachment is obsolete: true
timeless checked this in mozilla/extensions/inspector/resources/content/viewers/computedStyle/computedStyle.js 1.12 mozilla/extensions/inspector/resources/content/viewers/computedStyle/computedStyle.xul 1.13
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
>>+ this.mOlBox.view.selection.getRangeAt(i,start,end); [Doh, this should have been (i, start, end); next time, Inspector, next time]
As a themer, I want to thank you for adding this function. Thank you. Thank you. Thank you. The multiline block select works: I can select several statements in a row. Also, I can use ctrl-click and select non-contiguous lines, and copy them (!). For "next time": When pasting a multiline selection, the line break does not work in Notepad (a Windows accessory) but does work in Microsoft Word and Wordpad. Although the context-menu copy function works, the ctrl-C keyboard function does not work. That would be a lovely addition. But this is wonderful as it is.
and this function should be added to Bon Echo when the branch is reopened.
(In reply to comment #12) > >>+ this.mOlBox.view.selection.getRangeAt(i,start,end); > [Doh, this should have been (i, start, end); next time, Inspector, next time] I copied that line from somewhere else, so you could say it's the prevailing style :) (In reply to comment #13) > Although the context-menu copy function works, the ctrl-C keyboard function > does not work. That would be a lovely addition. Works for me.
QA Contact: timeless → dom-inspector
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: