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

> The whole point of shadow DOM API is to provide encapsulation. If your app needs to constantly break that encapsulation, then it's probably better not to use shadow DOM API in the first place.

For YouTube, the benefit of shadow DOM API is encapsulation of styling as a default. There are still benefits for global styling and the ability to select elements through shadow boundaries.
That said, focusing on the dynamic profile, I do agree that this is mostly useful for testing and debugging. This is the majority (and possibly only) use case that YouTube has.

> We’re experimenting with collectMatchingElementsInFlatTree (implemented in https://trac.webkit.org/changeset/208878) which finds all elements that match a given selector in each tree instead of an explicit >>> to cross a shadow boundary

Is `collectMatchingElementsInFlatTree` on the element prototype? E.g. allowing for this to work on a subtree? I want to be able to do something like `someDiv.collectMatchingElementsInFlatTree()`.

Also, does this API select for trees *within* a shadow root? or does it only match an element in isolation? Like, are queries like `#main x-foo` valid if both `x-foo` and `#main` were in the same shadowRoot?


-- 
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-335554663

Received on Tuesday, 10 October 2017 17:52:22 UTC