Re: [webcomponents] HTML Parsing and the <template> element

(Please bottompost! Being a Googler teaches you bad email habits. ^_^)

On Tue, Jun 26, 2012 at 1:34 PM, Elliott Sprehn <esprehn@gmail.com> wrote:
> On Tue, Jun 26, 2012 at 1:19 PM, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>> On Tue, Jun 26, 2012 at 1:03 PM, Elliott Sprehn <esprehn@gmail.com> wrote:
>> > Silly question but why not specify the template element as if it's
>> > contents
>> > were PCDATA, and the document fragment is the "value". Then this whole
>> > thing
>> > isn't really any different than a <textarea>.
>>
>> Because you can't nest <textarea> inside of itself, but we want
>> templates to be nestable.
>
> Hmm, I might be in agreement with Henri then. Having all these parallel
> trees in the DOM is getting kind of out of control. Now there's the shadow
> DOM trees on every node, and also this nested tree of document fragments
> from <template>. There's a lot of simplicity in the DOM design that's lost
> from these two changes.

The problem is that this is a very theoretical opinion.  In reality,
these parallel trees *already exist*, except they're not DOM, they're
bespoke JS trees that don't interoperate between libraries and have a
decent impedance mismatch with the real DOM APIs, resulting in
significant duplication.

"Let's get rid of these parallel trees" isn't an option.  Our choices
are only "maintain the status quo of multiple layers of DOM
incompatibly stacked on top of each other" or "complicate DOM a bit to
pull those trees into the fold".

~TJ

Received on Tuesday, 26 June 2012 20:47:20 UTC