W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2013

Re: html template string handler WAS: E4H and constructing DOMs

From: Allen Wirfs-Brock <allen@wirfs-brock.com>
Date: Mon, 11 Mar 2013 11:21:18 -0700
Cc: Adam Barth <w3c@adambarth.com>, Jonas Sicking <jonas@sicking.cc>, Domenic Denicola <domenic@domenicdenicola.com>, Anne van Kesteren <annevk@annevk.nl>, Rick Waldron <waldron.rick@gmail.com>, Adam Klein <adamk@chromium.org>, Brendan Eich <brendan@secure.meer.net>, Ian Hickson <ian@hixie.ch>, "rafaelw@chromium.org" <rafaelw@chromium.org>, Alex Russell <slightlyoff@chromium.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>, "Mark S. Miller" <erights@google.com>
Message-Id: <4C00FBDA-86C8-4DD7-871F-E1A32E97267F@wirfs-brock.com>
To: Ojan Vafai <ojan@chromium.org>

On Mar 11, 2013, at 11:01 AM, Ojan Vafai wrote:

> On Mon, Mar 11, 2013 at 10:22 AM, Adam Barth <w3c@adambarth.com> wrote:
> Is there a definition of the html quasis handler somewhere that I can study?
> 
> I don't believe there is. I think that's a whole separate discussion really. Changing the subject line to match. I'm not really sure what spec this would go in either. Perhaps it's own.
> 
> I see two options:
> 1. Do E4H style parsing. (http://www.hixie.ch/specs/e4h/strawman)
> 2. Do <template> style parsing through the regular HTML parser.
> 
> Both of these deal with the important case of creating a DOM that doesn't have an appropriate context element at the root. Specifically, html`<td>foo</td>` will work for both.
> 
> A difficult case is how you parse html`<a>foo</a>` because, without context, you don't know if that element is an HTML element or an SVG element. In either case, we'd need to add special syntax like the E4H syntax for this.

Note that the tag position is itself a subexpression so it can be a higher level function call that accepts parameters that could provide contextual information and returns the appropriate template handler:

    html({domain:SVG"})`<a>foo</a>`


Allen
Received on Monday, 11 March 2013 18:22:08 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:09 UTC