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

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

From: Ojan Vafai <ojan@chromium.org>
Date: Wed, 25 Apr 2012 15:31:19 -0700
Message-ID: <CANMdWTsU-5uwXX3CwXXffr904EgRBsR-AkdG3ch_xXYCy4LZkQ@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: (wrong string) „ski <kornel@geekhood.net>, Dimitri Glazkov <dglazkov@chromium.org>, public-webapps@w3.org
<script type=text/html> works for string-based templating. Special handling
of </script> is not a big enough pain to justify adding a template element.

For Web Components and template systems that want to do DOM based
templating (e.g. MDV), the template element can meet that need much better
than a string-based approach. If nothing else, it's more efficient (e.g. it
only parses the HTML once instead of for each instantiation of the

String-based templating already works. We don't need new API for it.
DOM-based templating and Web Components do need new API in order to work at
all. There's no need, and little benefit, for the template element to try
to meet both use-cases.


On Wed, Apr 25, 2012 at 3:20 PM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Wed, Apr 25, 2012 at 3:17 PM, Brian Kardell <bkardell@gmail.com> wrote:
> > And when that becomes the case, then using the source text becomes
> > "problematic" not just "less efficient" right?
> Yes, for exactly the reasons you can't nest <script>s.
> ~TJ
Received on Wednesday, 25 April 2012 22:32:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:33 UTC