On Thu, Jun 30, 2011 at 2:50 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> On 6/30/11 5:45 PM, Dimitri Glazkov wrote:
>>
>> There's a very interesting distinction here. You don't "attach"
>> components to DOM elements. DOM elements _are_ components. The only
>> way to make a component is by sub-classing it from an existing
>> element. In this case, there is no distinction between native and
>> non-native implementations. If I sub-class from HTMLTextareaElement, I
>> can either reuse or override its shadow DOM.
>
> Back up.
>
> In this particular case, there may well be behavior attached to the textarea
> that makes assumptions about the shadow DOM's structure. Â This seems like a
> general statement about components.
>
> So if you override a shadow DOM, you better override the behavior too,
> right?
Ouch. This one is tricky. I now see it. We can't really expect the
author to design to this level of decoupling.
>
> If you reuse the shadow DOM, you either don't get access to it from your
> component, or the old behavior still needs to be unhooked (since you can now
> violate its invariants).
>
>
> Does that match your mental model? Â Or are we talking about totally
> different things somehow?
No, you've highlighted a real flaw in my reply there.
>
> -Boris
>
>