Re: [w3c/webcomponents] Support `>>>` combinator in static profile (#78)

> > Basically, we decided not to write tests that pierce across shadow boundaries.
>
> That falls apart when you have interactive elements in shadow roots (like <button>). You end up writing public accessors just to test the component.

I don't follow. For testing interactive elements, we do white box testing by exposing its shadow tree. There's no need for a component that uses another interactive components to reach into its shadow tree.

> Having worked with this a lot (and being the author of a very popular gist on this subject), I don't want the shadow piercing combinator. What I do want is a selector that only works for testing that selects from the current element's shadow root:
>
>```
>document.querySelector('custom-element => button');
>// Must be currently written as:
>document.querySelector('custom-element').shadowRoot.querySelector('button');
>```

That should already work. `ShadowRoot.prototype.querySelector` and `ShadowRoot.prototype.querySelectorAll` already exist.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/78#issuecomment-335038237

Received on Sunday, 8 October 2017 21:01:33 UTC