Exportparts and ::part() selector leak internal component details
Categories
(Core :: CSS Parsing and Computation, defect, P3)
Tracking
()
People
(Reporter: vrugtehagel, Assigned: emilio)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/117.0
Steps to reproduce:
Let's say we have the following markup structure:
<style>my-bar::part(text) { color: red; }</style>
<my-foo>
#shadow-root
<my-bar exportparts="text">
#shadow-root
<span part="text">Hello!</span>
</my-bar>
</my-foo>
Here's a fiddle: https://jsfiddle.net/cj5z2kd9/
Actual results:
The text goes red.
Expected results:
The CSS rule should not apply; my-bar
is not in the document (only my-foo
is), so my-bar::part(text)
should not apply even though my-bar
is the tag name of the element that would be matched by ::part(text)
.
Comment 1•1 year ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::CSS Parsing and Computation' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Assignee | ||
Comment 2•1 year ago
|
||
Assignee | ||
Updated•1 year ago
|
Assignee | ||
Comment 3•1 year ago
|
||
We need to jump to an element in the correct scope just like ::slotted()
does.
Factor that code to its own function both so that it's easier to reason
about and so that the code for that function remains small. At the end
of the day other combinators like descendant or sibling get executed a
ton of times (while pseudo-elements only jump once).
Comment 6•1 year ago
|
||
bugherder |
Updated•1 year ago
|
Reproducible on a 2023-10-01 Nightly build on macOS 12.
Verified as fixed on Firefox 120.0b5 and Nightly 121.0a1 on macOS 12, Windows 10, Ubuntu 22.
Description
•