- From: Ryosuke Niwa <notifications@github.com>
- Date: Sun, 08 Oct 2017 14:01:12 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 8 October 2017 21:01:33 UTC
> > 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