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

Re: Shadow DOM: Hat and Cat -- if that's your real name.

From: Sylvain Galineau <galineau@adobe.com>
Date: Tue, 4 Feb 2014 21:49:04 +0000
To: "<robert@ocallahan.org>" <robert@ocallahan.org>
CC: Tab Atkins Jr. <jackalmage@gmail.com>, Edward O'Connor <eoconnor@apple.com>, www-style list <www-style@w3.org>
Message-ID: <58EC62C8-09BC-4BE7-9D62-A7CB0F6D195E@adobe.com>

On Feb 4, 2014, at 12:44 PM, Robert O'Callahan <robert@ocallahan.org>
 wrote:

> An expedient approach would be to allow selectors to penetrate the shadow DOM by default and in a future spec revision add the ability for component authors to opt out of this, along with introducing other features to support custom styling.
> 
> The only argument I can think of against that is that the default is "unsafe" for component authors, who will unexpectedly find themselves in a deep hole later when they can't change anything their component without breaking pages. But that's not too bad; it's certainly no worse than the status quo, so at worst it's a missed opportunity.

Expedient seems the right term. I would assume that whatever default we pick on will be very hard to change once deployed. If we also think most authors will probably want to control which nodes can be selected then exposing all nodes by default seems the wrong starting point; it seems especially odd for a feature intended to bring better encapsulation. So while I think it's a fine model to start with while we're still experimenting, Google's posture suggests this is not just about yet another iteration behind their runtime flag. 

To over-simplify what I've heard for brevity:
1. The ^^ combinator is way more usable to component users then the ::pseudo syntax…
2. Attributes are a sucky way for component authors to declare which nodes are selectable…
3. …therefore, let us allow ^^ to select anything in the shadow tree.

I think Tab has made a persuasive argument about 1 and 2; I do not think we have established 3. I think we need a better way to address #2 for component authors *and* make ^^ only select those nodes the component author made public using this improved mechanism. And yes, they should be allowed to make their entire shadow tree public but that seems like a horrible default.
Received on Tuesday, 4 February 2014 21:49:34 UTC

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