Closed
Bug 939098
Opened 11 years ago
Closed 11 years ago
Output parser parses color names out of context in markup panel
Categories
(DevTools :: Inspector, defect)
Tracking
(firefox26 unaffected, firefox27 fixed, firefox28 fixed)
RESOLVED
FIXED
Firefox 28
Tracking | Status | |
---|---|---|
firefox26 | --- | unaffected |
firefox27 | --- | fixed |
firefox28 | --- | fixed |
People
(Reporter: miker, Assigned: miker)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file, 2 obsolete files)
9.83 KB,
patch
|
jwalker
:
review+
bajaj
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
So in the markup panel:
class="someclass background someotherclass red"
Is converted to:
class="someclass #6363CE someotherclass #F00"
Assignee | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #832939 -
Flags: review?(jwalker)
Comment 2•11 years ago
|
||
Comment on attachment 832939 [details] [diff] [review]
color-names-out-of-context-939098.patch
Review of attachment 832939 [details] [diff] [review]:
-----------------------------------------------------------------
When would we want onlyParseColorsAfterSupportingCSSProperty=false ?
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Joe Walker [:jwalker] from comment #2)
> Comment on attachment 832939 [details] [diff] [review]
> color-names-out-of-context-939098.patch
>
> Review of attachment 832939 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> When would we want onlyParseColorsAfterSupportingCSSProperty=false ?
When the value string doesn't contain a property name e.g. from CSS tools. It needs to be true to correctly parse html attributes in the markup view.
Assignee | ||
Comment 4•11 years ago
|
||
Obligatory try run:
https://tbpl.mozilla.org/?tree=Try&rev=08666cd7a005
Comment 5•11 years ago
|
||
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #3)
> (In reply to Joe Walker [:jwalker] from comment #2)
> > Comment on attachment 832939 [details] [diff] [review]
> > color-names-out-of-context-939098.patch
> >
> > Review of attachment 832939 [details] [diff] [review]:
> > -----------------------------------------------------------------
> >
> > When would we want onlyParseColorsAfterSupportingCSSProperty=false ?
>
> When the value string doesn't contain a property name e.g. from CSS tools.
> It needs to be true to correctly parse html attributes in the markup view.
So the name should reflect that difference then?
Assignee | ||
Comment 6•11 years ago
|
||
(In reply to Joe Walker [:jwalker] from comment #5)
> (In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #3)
> > (In reply to Joe Walker [:jwalker] from comment #2)
> > > Comment on attachment 832939 [details] [diff] [review]
> > > color-names-out-of-context-939098.patch
> > >
> > > Review of attachment 832939 [details] [diff] [review]:
> > > -----------------------------------------------------------------
> > >
> > > When would we want onlyParseColorsAfterSupportingCSSProperty=false ?
> >
> > When the value string doesn't contain a property name e.g. from CSS tools.
> > It needs to be true to correctly parse html attributes in the markup view.
>
> So the name should reflect that difference then?
I have renamed it to isHTMLAttribute and reversed the logic. I have also added a descriptive comment.
Attachment #832939 -
Attachment is obsolete: true
Attachment #832939 -
Flags: review?(jwalker)
Attachment #832967 -
Flags: review?(jwalker)
Comment 7•11 years ago
|
||
Comment on attachment 832967 [details] [diff] [review]
color-names-out-of-context-939098.patch
Review of attachment 832967 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/devtools/output-parser.js
@@ +193,2 @@
> }
> }
Isn't this the same code twice?
Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Joe Walker [:jwalker] from comment #7)
> Comment on attachment 832967 [details] [diff] [review]
> color-names-out-of-context-939098.patch
>
> Review of attachment 832967 [details] [diff] [review]:
> -----------------------------------------------------------------
>
> ::: toolkit/devtools/output-parser.js
> @@ +193,2 @@
> > }
> > }
>
> Isn't this the same code twice?
Yes it was.
Working around this has meant making a couple of changes to the parser itself as I don't like having more than one local function if it can be avoided:
- Replaced dirty flag with break and continue to enhance performance.
- Moved max iteration check to start of loop so that it is also checked.
- Simplified max iteration check.
- Moved local functions to OutputParser Prototype. Admittedly, _trimMatchFromStart is now a one liner but it does make the parser easier to read.
I have created a try run but all tests pass locally.
Try:
https://tbpl.mozilla.org/?tree=Try&rev=f27cbfc10758
Attachment #832967 -
Attachment is obsolete: true
Attachment #832967 -
Flags: review?(jwalker)
Attachment #8333881 -
Flags: review?(jwalker)
Updated•11 years ago
|
Attachment #8333881 -
Flags: review?(jwalker) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Comment 10•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → Firefox 28
Assignee | ||
Comment 12•11 years ago
|
||
Comment on attachment 8333881 [details] [diff] [review]
Removed dirty flag, moved local functions to prototype
[Approval Request Comment]
Bug caused by (feature/regressing bug #): DevTools output parser
User impact if declined: Class names in markup panel could be replaced by color swatches.
Testing completed (on m-c, etc.): Yes
Risk to taking this patch (and alternatives if risky): Low
String or IDL/UUID changes made by this patch: None
Attachment #8333881 -
Flags: approval-mozilla-aurora?
Comment 14•11 years ago
|
||
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #12)
> Comment on attachment 8333881 [details] [diff] [review]
> Removed dirty flag, moved local functions to prototype
>
> [Approval Request Comment]
> Bug caused by (feature/regressing bug #): DevTools output parser
> User impact if declined: Class names in markup panel could be replaced by
> color swatches.
> Testing completed (on m-c, etc.): Yes
> Risk to taking this patch (and alternatives if risky): Low
> String or IDL/UUID changes made by this patch: None
what is the blocking/regressing bug here ?
Assignee | ||
Comment 15•11 years ago
|
||
(In reply to bhavana bajaj [:bajaj] from comment #14)
> (In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #12)
> > Comment on attachment 8333881 [details] [diff] [review]
> > Removed dirty flag, moved local functions to prototype
> >
> > [Approval Request Comment]
> > Bug caused by (feature/regressing bug #): DevTools output parser
> > User impact if declined: Class names in markup panel could be replaced by
> > color swatches.
> > Testing completed (on m-c, etc.): Yes
> > Risk to taking this patch (and alternatives if risky): Low
> > String or IDL/UUID changes made by this patch: None
>
> what is the blocking/regressing bug here ?
This bug was introduced when the output parser was created in bug 918716.
Until this is fixed in Aurora class names in markup panel may be replaced by color swatches e.g. class="red" would be displayed as class="#F00", class="inherit" would be displayed as class="black", CSS shortcut properties such as border: 1px solid red will not receive color swatches plus various other issues.
Updated•11 years ago
|
Attachment #8333881 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•11 years ago
|
Assignee | ||
Comment 16•11 years ago
|
||
There was a lot of rebasing needed to get this to apply on Aurora so I have created a try run:
https://tbpl.mozilla.org/?tree=Try&rev=2ddb2ec6837b
Comment 17•11 years ago
|
||
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•