Bare `::part(foo)` CSS selector selects parts inside shadow roots
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: nolan, Unassigned)
References
(Regression, )
Details
(4 keywords)
Attachments
(1 file)
643 bytes,
text/html
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:94.0) Gecko/20100101 Firefox/94.0
Steps to reproduce:
Actual results:
The <span>
is blue.
Expected results:
The <span>
should be blue, because it's being targeted with the CSS selector ::part(foo)
, which should not work.
According to a comment in this WebKit bug, the fact that it appears blue in Firefox should be considered a bug. WebKit and Chrome do not have this behavior, although WebKit just added support for :host::part(foo)
.
From a web developer POV, I'd say that ::part(foo)
is problematic because it's ambiguous in cases where a custom element's shadow root contains another custom element with its own part that has the same name.
Reporter | ||
Comment 1•3 years ago
|
||
The
<span>
should be blue
Sorry, this is a typo. I meant "the <span>
should not be blue."
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Set release status flags based on info from the regressing bug 1624968
Updated•3 years ago
|
Can this be marked as a bug instead of wontfix? Please see: https://github.com/w3c/csswg-drafts/issues/9981 Thanks
Comment 4•8 months ago
|
||
The bug is still open. It was sent to wontfix for firefox 95/96, because we're not fixing it in those versions.
It's a bit tricky to fix but probably not too terrible... We either fix the matching of ::part() to make sure that if we're on the same tree we have a featureless host selector to the left, or fix the rule collector to not look at those rules.
Description
•