Closed
Bug 121182
Opened 23 years ago
Closed 19 years ago
Can't copy values from computed style
Categories
(Other Applications :: DOM Inspector, enhancement)
Other Applications
DOM Inspector
Tracking
(Not tracked)
RESOLVED
FIXED
Future
People
(Reporter: timeless, Assigned: jason.barnabe)
Details
Attachments
(1 file, 2 obsolete files)
9.85 KB,
patch
|
Details | Diff | Splinter Review |
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.
Updated•23 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → Future
Comment 1•23 years ago
|
||
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.
Comment 2•21 years ago
|
||
Mass re-assigning bugs to dom.inspector@extensions.bugs
Assignee: hewitt → dom.inspector
Status: ASSIGNED → NEW
Comment 3•21 years ago
|
||
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.
Updated•21 years ago
|
Keywords: helpwanted
Updated•20 years ago
|
Product: Core → Other Applications
Comment 4•20 years ago
|
||
Show me how to properly utilize the clipboard, and I'll probably be interested
in fixing this.
Comment 5•20 years ago
|
||
Assignee | ||
Comment 6•19 years ago
|
||
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)
Assignee | ||
Updated•19 years ago
|
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+
Assignee | ||
Updated•19 years ago
|
Attachment #220482 -
Flags: superreview?(neil)
Assignee | ||
Comment 8•19 years ago
|
||
More fancy, less whitespace.
Attachment #220482 -
Attachment is obsolete: true
Attachment #221937 -
Flags: superreview?(neil)
Comment 9•19 years ago
|
||
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+
Assignee | ||
Comment 10•19 years ago
|
||
All uses of mOlBox removed.
Attachment #221937 -
Attachment is obsolete: true
Assignee | ||
Comment 11•19 years ago
|
||
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
Comment 12•19 years ago
|
||
>>+ this.mOlBox.view.selection.getRangeAt(i,start,end);
[Doh, this should have been (i, start, end); next time, Inspector, next time]
Comment 13•19 years ago
|
||
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.
Comment 14•19 years ago
|
||
and this function should be added to Bon Echo when the branch is reopened.
Assignee | ||
Comment 15•19 years ago
|
||
(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.
Updated•17 years ago
|
QA Contact: timeless → dom-inspector
You need to log in
before you can comment on or make changes to this bug.
Description
•