Allow to export multiple parts with a single part name (was: Cannot export shadow part with an alias)
Categories
(Core :: CSS Parsing and Computation, task)
Tracking
()
People
(Reporter: csvn.dev, Assigned: emilio)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0
Steps to reproduce:
- Create an element with a shadowRoot that has a Shadow part named
foo - Create a parent element with a shadowRoot, that includes the element mentioned above.
- Set the
exportpartsattribute on the parent to export and export+rename the part:"foo, foo: bar" - Create CSS to style
::part(foo)and::part(bar)separately
Reproduction example:
https://jsfiddle.net/957hns23/2/
Actual results:
Only the first instance of the part will work with the styling, foo if "foo, foo: bar", bar if "foo: bar, foo".
Expected results:
Both parts foo and bar should work with the styling
Comment 1•6 years ago
|
||
I was able to reproduce the issue on Firefox 73.0.1 and Firefox 75.0a1
I'm setting a component in order to involve the development team in reviewing this issue.
Thank you for reporting!
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
| Assignee | ||
Comment 2•6 years ago
|
||
Other browsers allow this and the spec doesn't really disallow it, so fix it,
add a test and carry on.
Updated•6 years ago
|
| Assignee | ||
Updated•6 years ago
|
Thanks Emilio, I was not certain if this was explicitly stated in the spec. I just thought it might be a common use case (see below), and that It was possible to do this in Chrome when I tested it there too.
<x-post>
#shadow
<x-profile exportparts="avatar"></x-profile>
</x-profile>
<x-user>
#shadow
<x-profile exportparts="avatar user"></x-profile>
</x-profile>
<style>
::part(avatar) {
border-radius: 50%;
}
::part(avatar user) {
border-color: red;
}
</style>
| Assignee | ||
Comment 4•6 years ago
|
||
Yeah, Safari allows this too. Too bad none of the other two engines landed a web-platform-test, otherwise I would've caught this when implementing shadow parts. Oh well...
If it gets reviewed soonish it should land in Firefox 75, otherwise 76 it is.
Comment 8•6 years ago
|
||
| bugherder | ||
Comment 10•6 years ago
|
||
Does this need a Beta approval request or can this ride 76 to release?
Updated•6 years ago
|
| Assignee | ||
Comment 11•6 years ago
|
||
I think it can ride the trains. It's a minor bug-fix / feature.
Updated•6 years ago
|
Description
•