W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2011

Re: Component Models and Encapsulation (was Re: Component Model: Landing Experimental Shadow DOM API in WebKit)

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 30 Jun 2011 17:50:52 -0400
Message-ID: <4E0CEFBC.9070607@mit.edu>
To: public-webapps@w3.org
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?

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?

-Boris
Received on Thursday, 30 June 2011 21:51:20 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:45 GMT