Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

* should also select shadow roots, a non-element node #8583

Closed
infinity0 opened this issue Dec 5, 2022 · 1 comment
Closed

* should also select shadow roots, a non-element node #8583

infinity0 opened this issue Dec 5, 2022 · 1 comment

Comments

@infinity0
Copy link

Original issue at https://bugzilla.mozilla.org/show_bug.cgi?id=1803927

Basically the bug is caused by * selecting only "element nodes", and not selecting the shadow-root "non-element node" [1] that is created by the definition of <details>. [2]

As I understand, and according to various other people's understanding of Shadow DOM as described in various web documents, shadow DOM is meant to provide encapsulation, e.g. so you can include other people's content in your own content without their scripts/styles breaking your scripts/styles, including browser UI elements. (Your scripts/styles OTOH can affect their scripts/styles, which makes sense as you are in control, and can write your scripts/styles in a way so as not to break theirs. All good.)

Normally when people use <details> however, there is no encapsulation intended. The content inside and outside the <details> is my own content, and I do not want there to be any separation. In particular, I want elements inside the <details> to inherit CSS rules as normal. Because * does not select the shadow-root, there is no way to have it pass through inherited properties like box-sizing, even though my CSS rules can reach into its children directly and apply there.

[1] https://www.w3.org/TR/css-scoping-1/#shadow-dom
[2] https://html.spec.whatwg.org/#the-details-and-summary-elements

@infinity0
Copy link
Author

closing in favour of w3c/csswg-drafts#8184 as I realised it was more CSS related, please post any comments there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant