Re: Shadow DOM Encapsulation

On Feb 6, 2014, at 7:02 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Thu, Feb 6, 2014 at 6:54 PM, Peter Linss <peter.linss@hp.com> wrote:
>> On Feb 6, 2014, at 5:23 PM, Tab Atkins Jr. <jackalmage@gmail.com>
>> wrote:
>>> Note also that this isn't quite as easy as it sounds.  When you expose
>>> things, where are they relative to everything else?
>> 
>> They are in the same place as they are defined, the structure is preserved for everything exported.
>> 
>> For example, given the shadow DOM:
>> <component>
>>  <part-one export>
>>    <sub-part-one />
>>  </part-one>
>>  <part-two>
>>    <sub-part-two export>
>>      <sub-sub-part-two />
>>    </sub-part-two>
>>  </part-two>
>> </component>
>> 
>> You'd see it as though it were defined as:
>> <part-one>
>>  <sub-part-one />
>> </part-one>
>> <sub-part-two>
>>  <sub-sub-part-two />
>> </sub-part-two>
> 
> Oof, so then "part-one + sub-part-two" would actually match?  That's
> seems super weird to me.

It’s a bit weird from the component author’s viewpoint because they know about the hidden bits of the tree. But then those are the parts they deliberately chose to expose.

It’s not weird at all for the author styling the component. For them it’d arguably be super-weird if it didn’t match.

So, on balance, this seems OK to me.

Received on Friday, 7 February 2014 04:31:55 UTC