The default bug view has changed. See this FAQ.

"Copy Rule" in the rule view includes expanded shorthand properties

RESOLVED FIXED in Firefox 14

Status

()

Firefox
Developer Tools: Inspector
P1
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: dcamp, Assigned: miker)

Tracking

10 Branch
Firefox 14
x86
Mac OS X
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [ruleview][fixed-in-fx-team])

Attachments

(1 attachment, 4 obsolete attachments)

(Reporter)

Description

5 years ago
* Point the inspector at an element with a shorthand property
* Use "Copy Rule" from the context menu
* Paste the resulting text

All the expanded shorthand properties are included.
(Reporter)

Updated

5 years ago
Blocks: 740606
Created attachment 610843 [details] [diff] [review]
Made "Copy Rule" more robust

Seems like this must be an OSX issue only as it works fine on Linux & Windows.

I have made the copy rule & declaration methods a little more robust so it should hopefully fix the problem.
Attachment #610843 - Flags: review?(dcamp)
Status: NEW → ASSIGNED
Blocks: 736014
(Reporter)

Comment 2

5 years ago
Comment on attachment 610843 [details] [diff] [review]
Made "Copy Rule" more robust

Review of attachment 610843 [details] [diff] [review]:
-----------------------------------------------------------------

Needs tests for the things that were failing.
Attachment #610843 - Flags: review?(dcamp) → review-
Created attachment 612371 [details] [diff] [review]
Added test

Dave, I am asking for feedback from you as discussed.

See:
https://tbpl.mozilla.org/?tree=Try&rev=1c403040a6db

There are timing issues relating to the rule view ... it seems like the DOM is not fully initialized at the time the rule view sends out it's ready notifier.
Attachment #610843 - Attachment is obsolete: true
Attachment #612371 - Flags: feedback?(dcamp)
(Reporter)

Comment 4

5 years ago
Comment on attachment 612371 [details] [diff] [review]
Added test

OK, between synthesizing the mouse click on the property name and working on its editor, you need to wait for the editor to be created.  The browser_ruleview_ui.js test has a method that will wait for an editor to be created, you should be able to use something like that.
Created attachment 613558 [details] [diff] [review]
Patch now includes wait for editor focus and blur

This was held up by a hard to find leak (fixed by somebody else somewhere).

Patch works fine locally but need to wait for try:
https://tbpl.mozilla.org/?tree=Try&rev=0f011861fc57
Attachment #612371 - Attachment is obsolete: true
Attachment #612371 - Flags: feedback?(dcamp)
Attachment #613558 - Flags: review?(dcamp)
dcamp: Seems like my latest patch is already attached
Created attachment 614163 [details] [diff] [review]
Now green on try

Fixed oranges and timing issues. If we can get this into Aurora then we would not need to disable the copy menus.
Attachment #613558 - Attachment is obsolete: true
Attachment #613558 - Flags: review?(dcamp)
Attachment #614163 - Flags: review?(dcamp)
Whiteboard: [ruleview][has-patch]
(Reporter)

Comment 8

5 years ago
Comment on attachment 614163 [details] [diff] [review]
Now green on try

Review of attachment 614163 [details] [diff] [review]:
-----------------------------------------------------------------

::: browser/devtools/styleinspector/CssRuleView.jsm
@@ +1021,1 @@
>  

Is it ever possible for node to be null here?  If so, please protect against that.
Attachment #614163 - Flags: review?(dcamp) → review+
Created attachment 615300 [details] [diff] [review]
Addressed reviewers comments

(In reply to Dave Camp (:dcamp) from comment #8)
> Comment on attachment 614163 [details] [diff] [review]
> Now green on try
> 
> Review of attachment 614163 [details] [diff] [review]:
> -----------------------------------------------------------------
> 
> ::: browser/devtools/styleinspector/CssRuleView.jsm
> @@ +1021,1 @@
> >  
> 
> Is it ever possible for node to be null here?  If so, please protect against
> that.
Attachment #614163 - Attachment is obsolete: true
Whiteboard: [ruleview][has-patch] → [ruleview][land-in-fx-team]
https://hg.mozilla.org/integration/fx-team/rev/f1f9579b3eea
Whiteboard: [ruleview][land-in-fx-team] → [ruleview][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/f1f9579b3eea
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
You need to log in before you can comment on or make changes to this bug.