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

Re: Imperative API for Node Distribution in Shadow DOM (Revisited)

From: Ryosuke Niwa <rniwa@apple.com>
Date: Mon, 27 Apr 2015 14:18:24 -0700
Cc: Olli Pettay <olli@pettay.fi>, WebApps WG <public-webapps@w3.org>
Message-id: <EB2923B5-2B94-4C8A-902A-DCE3BB4D5365@apple.com>
To: Hayato Ito <hayato@chromium.org>

> On Apr 26, 2015, at 6:11 PM, Hayato Ito <hayato@chromium.org> wrote:
> 
> I think Polymer folks will answer the use case of re-distribution.
> 
> So let me just show a good analogy so that every one can understand intuitively what re-distribution *means*.
> Let me use a pseudo language and define XComponent's constructor as follows:
> 
> XComponents::XComponents(Title text, Icon icon) {
>   this.text = text;
>   this.button = new XButton(icon);
>   ...
> }
> 
> Here, |icon| is *re-distributed*.
> 
> In HTML world, this corresponds the followings:
> 
> The usage of <x-component> element:
>   <x-components>
>     <x-text>Hello World</x-text>
>     <x-icon>My Icon</x-icon>
>   </x-component>
> 
> XComponent's shadow tree is:
> 
>   <shadow-root>
>     <h1><content select="x-text"></content></h1><!-- (1) -->
>     <x-button><content select="x-icon"></content></x-button><!-- (2) -->
>   </shadow-root>

I have a question as to whether x-button then has to select which nodes to use or not.  In this particular example at least, x-button will put every node distributed into (2) into a single insertion point in its shadow DOM.

If we don't have to support filtering of nodes at re-distribution time, then the whole discussion of re-distribution is almost a moot because we can just treat a content element like any other element that gets distributed along with its distributed nodes.

- R. Niwa
Received on Monday, 27 April 2015 21:18:54 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:31 UTC