Closed Bug 2012412 Opened 2 months ago Closed 1 month ago

[computed panel] nested media query declaration isn't displayed in matched selector section

Categories

(DevTools :: Inspector, defect, P3)

defect

Tracking

(firefox149 fixed)

RESOLVED FIXED
149 Branch
Tracking Status
firefox149 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

Details

Attachments

(2 files)

Attached file test case

Steps to reproduce

  1. Open attached test case
  2. Open inspector
  3. Select the <body> element
  4. Select Computed panel
  5. Expand background-color item

Expected results

In the matched selector list, I can see the hotpink declaration (in a media query) that is actually applied

Actual results

The only declaration we see is the gold declaration, which isn't applied

Note that this is related to nesting as with the following CSS, we do see the 2 declarations displayed:

body {
  background-color: gold;
}

@media (width > 1px) {
  body {
    background-color: hotpink;
  }
}

We fails short in https://searchfox.org/firefox-main/rev/69888f58354c8d44e854945761a9e8fa954512d1/devtools/server/actors/inspector/css-logic.js#1143,1148-1149,1151-1153

get selectors() {
...
  // Parse the CSSStyleRule.selectorText string.
  this.#selectors = [];
...
  if (!this.domRule.selectorText) {
    return this.#selectors;
  }

as CSSNestedDeclarations doesn't have a selectorText property, so we just return an empty array, which makes the rule being ignored later down the road.

Assignee: nobody → nchevobbe
Attachment #9540326 - Attachment description: WIP: Bug 2012412 - [devtools] Include CSSNestedDeclarations in computed panel matching selectors. r=#devtools. → Bug 2012412 - [devtools] Include CSSNestedDeclarations in computed panel matching selectors. r=#devtools.
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P3
Pushed by nchevobbe@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b82000fe14a5 https://hg.mozilla.org/integration/autoland/rev/89b62a642e80 [devtools] Include CSSNestedDeclarations in computed panel matching selectors. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch
QA Whiteboard: [qa-triage-done-c150/b149]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: