Re: [csswg-drafts] [css-scoping-1] should shadow-piercing descendant combinator (>>>) still be in specification

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: `document.querySelectorAll('div >>> ul.menucontainer')`, you will see it selects 3 elements

You can create a unique selector to select the last two of these elements, these selectors are:

```
document.querySelectorAll('div > li:nth-of-type(2) >>> ul.menucontainer')
document.querySelectorAll('div > li:nth-of-type(1) >>> ul.menucontainer')
```

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 selector"

-- 
GitHub Notification of comment by dylanb
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/640#issuecomment-291045665 using your GitHub account

Received on Monday, 3 April 2017 04:21:17 UTC