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

RESOLVED FIXED

Status

()

Firefox
Developer Tools: Inspector
P3
normal
RESOLVED FIXED
4 years ago
a year ago

People

(Reporter: bgrins, Assigned: tromey)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
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.
(Reporter)

Updated

3 years ago
Depends on: 984880
(Assignee)

Comment 1

3 years ago
Taking this as part of as-authored.
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Priority: -- → P3
(Assignee)

Comment 2

2 years ago
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)
(Assignee)

Updated

a year ago
Duplicate of this bug: 1326984
(Assignee)

Comment 4

a year ago
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.)
(Assignee)

Updated

a year ago
Status: ASSIGNED → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.