This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
Now that it's possible to use ::distributed to style the nodes distributed to a given insertion point, the spec needs to clarify how this can be used to make selectors that match starting from distributed nodes themselves. In general, one wants to be able to style the distributed nodes using complex css selectors: /* style match .bar with .foo matching ancestors */ content::distributed(.foo .bar) { ... } However, it's common to want to create selectors that start at the distributed nodes themselves. The :root selector could be use for this purpose (http://dev.w3.org/csswg/selectors4/#the-root-pseudo). /* match .bar descendants of distributed children matching .foo */ content::distribute(.foo:root .bar) { ... }
I think this should be :scope and not :root. As you can see in the scoping section of the CSS4 Selectors spec [1] "The :root pseudo-class, however, still only matches the actual root of the document." even when doing a scope-contained selector. Perhaps we can use :scope [2] for this, with the awkwardness that the ShadowRoot now becomes addressable despite not being style-able, and you have to write content::distributed(:scope > .foo .bar) to mean what you want. [1] <http://dev.w3.org/csswg/selectors4/#scoping> [2] <http://dev.w3.org/csswg/selectors4/#the-scope-pseudo>
See this thread for discussion: http://lists.w3.org/Archives/Public/www-style/2013Mar/thread.html#msg581
Sounds good. Thanks for the link.
Let me close the bug in favor of scope-relative selectors. https://www.w3.org/Bugs/Public/show_bug.cgi?id=21486