Closed Bug 1824652 Opened 11 months ago Closed 7 months ago

incorrect property is displayed as active with @layers + !important

Categories

(DevTools :: Inspector: Rules, defect, P2)

defect

Tracking

(firefox117 verified, firefox118 verified)

VERIFIED FIXED
117 Branch
Tracking Status
firefox117 --- verified
firefox118 --- verified

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

Details

Attachments

(1 file)

Steps to reproduce

  1. Navigate to data:text/html,<meta charset=utf8><style>@layer A, B;body {color: red !important;}@layer A {body {color: green !important;}}@layer B {body {color: blue !important;}}</style>Hello
  2. Open the inspector, select the body

Expected results

In the rule view, the color: green !important is the one that is tagged as active (as we can see the text on the page is green)

Actual results

In the rule view, the color: red !important is the one that is tagged as active

Severity: -- → S3
Priority: -- → P2
Depends on: 1824653

This is where we handle the "overridden" flag for properties in the rule view https://searchfox.org/mozilla-central/rev/c244b16815d1fc827d141472b9faac5610f250e7/devtools/client/inspector/rules/models/element-style.js#311-367

The issue is that we seem to loop through the rules in the order they're displayed in the rule view and then we try to compute the proper order (but here fail because layers change how properties are considered)
We should rather try to re-use what we do in the computed property when we expand a property (where we do, or at least should, show the correct order of the properties/rules)

See Also: → 1837790
Duplicate of this bug: 1837790

important properties in rules inside layers take precedence over rules
which are not in layers, so we need to account for that.

A test is added to ensure we cover various cases.

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b545926f1ae2
[devtools] Check rules layers for setting properties as overridden in the rules view. r=devtools-reviewers,jdescottes.
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 117 Branch
Flags: qe-verify+

Reproducible on a 2023-07-18 Nightly build on macOS 12.
Verified as fixed on Firefox 117.0b2(build ID: 20230801180159) and Nightly 118.0a1(build ID: 20230802220030) on macOS 12, Windows 10, Ubuntu 22.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.