W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2014

Re: [webcomponents]: Allowing text children of ShadowRoot is a bad time

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 7 Jan 2014 14:59:27 -0800
Message-ID: <CAAWBYDCsQVrAYeHKLqgVLgkYq4XvZSc49XuUN3KJUb_gKSgq9g@mail.gmail.com>
To: Elliott Sprehn <esprehn@gmail.com>
Cc: Anne van Kesteren <annevk@annevk.nl>, Simon Pieters <simonp@opera.com>, Dimitri Glazkov <dglazkov@chromium.org>, Hayato Ito <hayato@chromium.org>, public-webapps <public-webapps@w3.org>, Tab Atkins <tabatkins@google.com>
On Tue, Jan 7, 2014 at 2:42 PM, Elliott Sprehn <esprehn@gmail.com> wrote:
> On Tue, Oct 29, 2013 at 4:20 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>> On Tue, Oct 29, 2013 at 7:34 AM, Simon Pieters <simonp@opera.com> wrote:
>> > On Tue, 29 Oct 2013 00:54:05 +0100, Anne van Kesteren <annevk@annevk.nl>
>> > wrote:
>> >> We are considering not throwing in XML.
>> >
>> > Only on getting innerHTML, though, right?
>>
>> Oh I missed that. In that case throwing if you include text nodes for
>> ShadowRoot nodes is not too bad. And would match what happens if you
>> append a DocumentFragment that contains them which is the same
>> operation. Sounds good.
>
>
> I've been pondering this more recently and I think we want to just silently
> drop the Text nodes instead. If you do
> shadowRoot.appendChild(template.contents) and the author did:
>
> <template>
>   <div>header</div>
>   <div>content</div>
> </template>
>
> We're going to throw an exception for all the Text between the elements
> which is not really what the author wanted (or realized they were doing).
>
> If dropping them is too gross we might want to just consider this a lost
> cause and warn authors away from putting text in there due to the issues I
> outlined in my original email.

Alternately: silently drop whitespace, but still throw on significant text?

~TJ
Received on Tuesday, 7 January 2014 23:00:15 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:21 UTC