Closed Bug 913661 Opened 11 years ago Closed 7 years ago

[rule view] Adding two declarations with the same name causes the first to be dropped

Categories

(DevTools :: Inspector, defect, P3)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bgrins, Assigned: tromey)

References

Details

To reproduce: 

* Click on any element
* Add a new declaration like "background: red;"
* Add another declaration below it like "background: blue;"
* Click onto a different element in the markup view, then back onto the first
* The background: red property is missing

In addition to this, both properties will be dropped if the second one is empty:

* Click on any element
* Add a new declaration like "background: red;"
* Add another declaration below it like "background: ;"
* Click onto a different element in the markup view, then back onto the first
* The background property is missing

Additionally, if you do not add a second declaration, it converts "background: red;" into "background: none repeat scroll 0% 0% red" when clicking back onto the node.

This happens with both inline styles and ones declared from a stylesheet.  Ideally, the style attribute would keep the text as entered by the user, and be reparsed as such.  Could also wrap any disabled properties in /* */ comments.
Depends on: 984880
Taking this as part of as-authored.
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Priority: -- → P3
This was almost fixed by bug 1069829.

If I add two "background" properties, they both continue to exist.

However, if I edit the second one to give it an empty value (thus removing it),
the background color changes, but the rule view shows the "background: red" as
struck through, and with the checkbox empty.

If I then click the checkbox to enable the property I get an exception.
(However, the real bug is that the property isn't enabled in the first place)
This seems to work now, but I'm not sure what change made it work.
(As-authored made it work for style sheets, but now it works for inline styles as well;
and additionally I couldn't reproduce bug 1326984.)
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.