[csswg-drafts] [css-contain] CQ vs shadow boundaries (#5984)

tabatkins has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain] CQ vs shadow boundaries ==
Can a CQ see past shadow boundaries? If so, exactly how?

If the CQ is done via selectors, the answer is obvious - you can only CQ against elements you can see via selectors. So from within a shadow, the highest ancestor you can CQ against is your host element, no higher.

If CQ is done via an at-rule, the answer is not quite as clear; theoretically, we can walk the box tree (flat tree) to find ancestors. However, we do *not* want a ::part() to be able to see an ancestor within the targeted shadow (it violates shadow encapsulation). And letting a shadow see ancestors outside in the light DOM gives us similar power to :host-context(), which already makes browser vendors unhappy, so maybe we don't want that either. And that's all the cases, so presumably we don't want it to work in either case.

--------

As a related issue, we'll need to specifically define that the CQ pseudo-class matches on host elements, since they're featureless and don't match *anything* besides :host by default otherwise.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5984 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 12 February 2021 00:12:38 UTC