Closed Bug 1840116 Opened 2 years ago Closed 2 years ago

Can't modify nested selector of constructed stylesheet in the rule view

Categories

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

defect

Tracking

(firefox116 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: nchevobbe, Assigned: nchevobbe)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Steps to reproduce

  1. Navigate to data:text/html,<meta charset=utf8><h1>Hello</h1><script>const s = new CSSStyleSheet();s.replaceSync("body {h1 { color: red }}");document.adoptedStyleSheets.push(s);</script>
  2. Inspect the Hello element
  3. There should be a h1 selector above the rule, modify it to h2

Expected results

The selector updates to h2

Actual results

The selector does not update and stays h1


When updating a selector in a constructed stylesheet,
we looked through the stylesheet cssRules to properly
insert the new rule at the right position.
But for nested rules, we'd never find them, and the
modification of the selector wouldn't happen.

Depends on D181676

Assignee: nobody → nchevobbe
Status: NEW → ASSIGNED
Pushed by nchevobbe@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b332adf20b98 [devtools] Fix modifying selector of child rule via CSSOM. r=devtools-reviewers,ochameau.
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: