Selector highlighter doesn't work for nested rules
Categories
(DevTools :: Inspector: Rules, defect, P1)
Tracking
(firefox116 fixed)
Tracking | Status | |
---|---|---|
firefox116 | --- | fixed |
People
(Reporter: nchevobbe, Assigned: nchevobbe)
References
(Blocks 2 open bugs)
Details
Attachments
(2 files)
If you have the following
body {
& main {
…
}
}
clicking on the highlighter icon next to main
won't highlight the <main>
element.
It looks like this is because we're using the rule selector directly (& main
), but &
can't be used to query an element, we need to substitute it with the parent selector (and if the parent selector also has &
, we need to substitute it with its parent selector as well, and so on)
From the spec (https://www.w3.org/TR/css-nesting-1/#nest-selector) :
The nesting selector can be desugared by replacing it with the parent style rule’s selector, wrapped in an
:is()
selector.
So for our case, & main
should be turned into :is(body) main
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 1•1 year ago
|
||
Depends on D181606
Assignee | ||
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 2•1 year ago
|
||
Depends on D181109
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 4•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/64a5444bc816
https://hg.mozilla.org/mozilla-central/rev/a6f44dc492b0
Description
•