W3C home > Mailing lists > Public > www-style@w3.org > February 2014

Re: [shadow-styling] /shadow vs /shadow-all

From: fantasai <fantasai.lists@inkedblade.net>
Date: Wed, 19 Feb 2014 09:05:11 -0800
Message-ID: <5304E447.5080306@inkedblade.net>
To: www-style@w3.org
On 02/10/2014 03:57 PM, Tab Atkins Jr. wrote:
> The /shadow-all combinator is exactly the older ^ combinator from
> previous updates.  I added the /shadow combinator (which only selects
> the top-level elements in the shadow tree) based on suggestions from
> Boris and Jonas that there should be an easy way to select into a
> shadow tree without implicitly invoking a descendant combinator, due
> to the performance implications of descendant combinators.
> My coworker Elliot pointed out privately, though, that moving only
> into the top-level elements makes the styling more brittle - if the
> component author rearranges their shadow DOM so that something isn't a
> child anymore, it'll break users.
> He'd prefer that the shortest name go to something that isn't as
> brittle.  He also pointed out that, with bottom-up selector matching,
> there's not actually any real cost difference between /shadow and
> /shadow-all, since you can always cheaply jump from an element in a
> shadow tree directly up to the shadow host in any reasonable
> implementation.  (For the same reasons that any element can cheaply
> jump up to the document in any reasonable implementation.)
> This seems compelling to me.  I'd like to swap things around to have
> /shadow be the old ^ combinator, where it selects all the elements in
> the shadow tree, and either rename the "only top-level elements" one
> to /shadow-child, or just kill it and rely on use of :top to handle
> this use-case.

I think this really points to a pseudo-element being the better
way to go. You can use descendant and child combinators as usual
and don't need to bother with this awkward :top stuff.

Received on Wednesday, 19 February 2014 17:05:38 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC