-
Notifications
You must be signed in to change notification settings - Fork 679
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
[css-scoping-1] should shadow-piercing descendant combinator (>>>) still be in specification #640
Comments
The '>>>' combinator was discussed at TPAC 2016 and Google still wants to try it People agreed on removing it from dynamic profile, though. FYI, Chromium's issue for '>>>' is |
Does the '>>>' combinator select shadow DOM nodes? I cannot get the Google implementation in Chrome 56 to select anything but the light DOM nodes that have been slotted into the shadow DOM. For example, if you go to this page http://dylanb.github.io/Axponents/web_components.html and try the following code in the console I am asking about the intended behavior because we are trying to decide whether to use this feature in future code and I don't want a potential bug or partial implementation in the Google code to adversely affect that decision. |
ok, so after reading the linked-to Chrome issue, I see that their code does not support v0 and does work for me in v1 shadow DOM. Is this combinator intended to work in both v0 and v1? |
There are no plans to add any new features to v0, or improve it at all; we'll be removing it as that becomes possible. It's definitely in a "security fixes only" state. |
@tabatkins so can I take that as a "this will never work in v0"? |
If it doesn't work now, there's no intention of making it work in the future, no. v0 is a dead-end tech. |
@dylanb as you already saw, Chrome implements If you find |
We are trying to figure out how to create an address for elements that violate an accessibility rule in the axe-core project. The address needs to work for light and shadow elements. We normally create CSS selectors for this purpose and are looking at the |
So I just figured out that we cannot use this combinator to achieve what we want. If you'd like to follow along, please take a look at this page: http://dylanb.github.io/shadowDOM/v1_menu_example.html If you run this code: You can create a unique selector to select the last two of these elements, these selectors are:
however there is no unique selector for the first one. In other words, when you have shadow DOM inside shadow DOM, you can only be guaranteed to uniquely address elements in the shadow DOM that are direct descendants of a light DOM node AND have no children with shadow roots. For all other elements in the shadow DOM, there is no selector that can be guaranteed to be unique. What I really need is a "single level piercing child combinator". So |
@dylanb I see your problem, that you need a unique selector to identify any element in the whole tree. I'm not sure that "there should be at least one selector to uniquely identify any element in shadow-including document", is a requirement for CSS selectors or not. Without shadow, apparently you can use So for completeness for that requirement, having 2 different combinator for "one-shadow' and "multiple-shadows" makes sense. @tabatkins do you have any idea whether such a requirement exists, or makes sense? |
It's not a general requirement, no. Before the advent of |
@tabatkins before you could use XPath to achieve a unique address, once There has been a way to uniquely address any node in a document for a very long time without having to change the document and add IDs (with the exception of IE) and that is now no longer possible with shadow DOM |
A page author can add an ID on an element to uniquely identify the element in a page, even with Shadow DOM. The problem @dylanb is raising is whether third-party tool (other than the page author itself) can address any element uniquely. IMHO, the web platform is already providing a way to uniquely identifying an element, so this could be a hard ask for web platform to add solution for the requirement, unless the use case is also viable for web authors. (this question is also true for |
What is the status here? |
Piercing shouldn't be in the dynamic profile; no reason for it to be removed from the static profile (it doesn't grant any new powers beyond what JS can already do by manually tree-walking). There's at least one implementation of it for JS, so unless things change, I'm not planning on removing it from Scoping. |
This issue depends on the conclusion of WICG/webcomponents#78 . |
I think the conclusion there is that this is still actively opposed by Apple as stated by @rniwa. And given that this has only utility for open shadow trees I think I can say that Mozilla is supportive of that position. So I'd like to see this removed from CSS Scoping. |
FYI: I'm working on removing the experimental implementation in Blink at |
Also, implied CSSWG approval at https://lists.w3.org/Archives/Public/www-style/2018Jan/0004.html |
@fantasai, FWIW, those minutes seem to be about |
This was discussed at w3c#640
css-scoping-1 currently specifies the shadow-piercing descendant combinator (>>>).
However, the minutes of the April 2015 Web Components meeting have, in their summary of discussion of contentious bits, say:
This suggests that perhaps the feature should not still be in css-scoping.
The text was updated successfully, but these errors were encountered: