Re: [webcomponents]: Making Shadow DOM Subtrees Traversable

On 6.3.2013 18:50, Dimitri Glazkov wrote:
> On Tue, Feb 26, 2013 at 1:43 PM, Blake Kaplan <mrbkap@gmail.com 
> <mailto:mrbkap@gmail.com>> wrote:
>
>     On Tue, Feb 26, 2013 at 11:05 AM, Erik Arvidsson <arv@google.com
>     <mailto:arv@google.com>> wrote:
>     > Also, if shadows are public by default the API to access the
>     shadow is well
>     > defined. If shadows are private by default and components decide
>     to expose
>     > the shadow ad hoc then there is no standardized API.
>
>     This doesn't have to be the case. Shadows can be private by default
>     with a well defined and consistent API to override the default.
>
>
> So, here's a quick strawman:
>
> 1) add an optional parameter to createShadowRoot to indicate whether 
> the shadow tree will be public or private (default TBD)
> 2) when a shadow tree is private, the corresponding 
> HTMLElement.shadowRoot and HTMLShadowElement.olderShadowRoot return 
> either a) the next older public tree root or b) null if older tree 
> doesn't exist, effectively skipping from the private shadow tree over 
> to the next older public tree.
>
> WDYT?
>
> If this is okay with everyone, we can focus on debating the default 
> parameter value.
>
> :DG<

Frankly from my perspective, which would be default (public or private) 
is no issue at all, just pick one, could not care less. Discussion on 
this mater (as long as we agree on the point that the value is Boolean 
:) ) seems like a waste of time to me. Thou I would go for private as 
default if default option is chosen.
The best solution would be to not go with default at all, make it nice 
explicit parameter (mandatory), but that may conflict with existing 
usage (?). For my controls I'll go with global option for all controls: 
full private for release, probably public for development (for testing, 
how the control behave, it may be useful to have access to its internals).

B.

Received on Wednesday, 6 March 2013 22:12:05 UTC