Closed
Bug 1328016
Opened 8 years ago
Closed 8 years ago
Ruleview breaks if there're invalid CSS (all rules are duplicated; editing works for wrong rules)
Categories
(DevTools :: Inspector: Rules, defect, P2)
Tracking
(firefox50 wontfix, firefox51 wontfix, firefox52 wontfix, firefox53 fixed)
RESOLVED
FIXED
Firefox 53
People
(Reporter: arni2033, Assigned: tromey)
References
Details
(Keywords: regression)
Attachments
(1 file)
>>> My Info: Win7_64, Nightly 49, 32bit, ID 20160526082509
STR_1:
1. Open url [1]
2. Open devtools -> inspector -> ruleview, inspect <div>
3. Click on text "50px" in line "width: 50px;" to start editing the value
4. Press Shift+Up to change value from "50px" to "60px"
AR: The black rectangle moves by 10px to the right (i.e. browser changes "left" instead of "width")
ER: The black rectangle should increase width by 10px
STR_2:
1. Open url [1]
2. Open devtools -> inspector -> ruleview, inspect <div>
3. Click on text "translateY(0px)" to start editing the value
4. Type "gray"
AR: The black rectangle becomes gray (i.e. browser changes "background" instead of "transform")
ER: No visible changes
STR_3:
1. Open url [1]
2. Open devtools -> inspector -> ruleview, inspect <div>
3. {Click on text "50px" in line "height: 50px;". Press Escape to cancel} several times (N times)
4. Switch to another node and back
5. Open style editor
AR: CSS rules in ruleview and style editor are duplicated N times. I.e. there're 6*2^N rules
ER: No visible changes
> [1] data:text/html,<div><style>div{position:absolute;top50px;height:50px;left:50px;width:50px;background:black;transform:translateY(0px)}@ Tom Tromey :tromey:
It seems that this is a regresion caused by your change. Please have a look.
Assignee | ||
Comment 1•8 years ago
|
||
The bug here is that Rule._getTextProperties filters out properties that have no name
(according to parseDeclarations), but other code does not.
Assignee | ||
Comment 2•8 years ago
|
||
I think the cleanest way to deal with this is probably to filter out nameless properties
in parseDeclarations.
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8823401 [details]
Bug 1328016 - add parseNamedDeclarations and use in rule view;
https://reviewboard.mozilla.org/r/101934/#review102838
Looks good to me.
::: devtools/shared/css/parsing-utils.js:458
(Diff revision 1)
> + * have a name.
> + */
> +function parseNamedDeclarations(isCssPropertyKnown, inputString,
> + parseComments = false) {
> + return parseDeclarations(isCssPropertyKnown, inputString, parseComments)
> + .filter((item) => !!item.name);
nit: I would perhaps vertically align the second line with the start of parseDeclaration.
And maybe remove the () around item argument in the arrow function.
Attachment #8823401 -
Flags: review?(pbrosset) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 7•8 years ago
|
||
Fix an eslint nit.
Comment hidden (mozreview-request) |
Pushed by ttromey@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/acaf6a89c4dd
add parseNamedDeclarations and use in rule view; r=pbro
Updated•8 years ago
|
status-firefox50:
--- → wontfix
status-firefox51:
--- → affected
status-firefox52:
--- → affected
status-firefox53:
--- → affected
Version: Trunk → 48 Branch
Comment 10•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 53
Comment 11•8 years ago
|
||
Worth considering for uplift to Aurora/Beta? If so, please nominate accordingly :)
Flags: needinfo?(ttromey)
Assignee | ||
Comment 12•8 years ago
|
||
After thinking about it a while, I feel that this is a low-impact bug.
It only affects users with a certain kind of invalid CSS. So, I think I
will not nominate it.
Flags: needinfo?(ttromey)
Updated•8 years ago
|
Updated•8 years ago
|
Keywords: regressionwindow-wanted
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•