Re: Encapsulation and defaulting to open vs closed (was Re: Shadow DOM Encapsulation)

On Thu, Feb 6, 2014 at 4:22 PM, Maciej Stachowiak <> wrote:
> That seems clearly false. If shadow DOM is subject to Type 2 encapsulation by default, the author can always opt out to Type 1. Even if we don't provide a feature for it, component authors can always do something to expose the shadow DOM themselves. However, there is no way to build Type 2 on top of Type 1. That is why I think defaulting to Type 1 and providing only Type 1 is a mistake. We can't have any experiments for whether Type 2 would be sufficiently useful and beneficial because you can't do it.
> This actually makes Type 2 the more fundamental primitive! You can't build it on top of Type 1. Am I allowed to cite at this point?

Of course it's possible to build Type 2 on top of Type 1 - just delete
or override the .shadowRoot accessor from the element.

(Just to head off a potential objection - yes, other script can
preempt you on this and retain access.  Just like I argued before, and
you've acknowledged, solving that is an orthogonal problem.)


Received on Friday, 7 February 2014 01:28:57 UTC