Re: [csswg-drafts] [css-shadow-parts] confirm browser support

> I'm still not seeing this. The context of the selector has absolutely nothing to do with this; it's purely about which element the ::part is descending from. As I explained in your examples earlier, a given part name can match an element from inside (:host::part(bar)) or outside (x-foo::part(bar)) a particular shadow tree, which shows that the tree context has no relevance here. (It just happens that, due to the way we've restricted selectors and shadow trees, a given element is only directly reachable from certain contexts.)

Ok, I think I see what you mean now, and I see how it can be implemented without caring about the context of the selector, thanks for bearing with me :).

I think CSSOM should probably not return true ever for something that contains a `::part` pseudo, though. That means that if you do something like `element.matches("x-bar::part(foo)`, you need to actually check it against all possible originating elements, which sounds somewhat annoying and special-case-y compared to how all other selectors work. But that's probably worth another issue.

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

Received on Saturday, 3 March 2018 20:33:08 UTC