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

Re: template namespace attribute proposal

From: Adam Klein <adamk@chromium.org>
Date: Thu, 12 Mar 2015 11:16:39 -0700
Message-ID: <CAEvLGcJytR_miOUG-cDtKBtGH1c1CSA=zPNGh9ibhY9Ru+J9KQ@mail.gmail.com>
To: Benjamin Lesh <blesh@netflix.com>
Cc: WebApps WG <public-webapps@w3.org>
On Wed, Mar 11, 2015 at 8:32 PM, Benjamin Lesh <blesh@netflix.com> wrote:

> I'd like to propose that the <template> tag have a namespace="" attribute
> that allows the user to specify namespaces such as "
> http://www.w3.org/2000/svg", so that the document fragment that comes
> from `.content` is created properly.
>
> e.g.:
>
> <template id="my-svg-template" namespace="http://www.w3.org/2000/svg>
>   <circle cx="10" cy="10" cr="10"/>
> </template>
>

For clarity, is this significantly different from the below (which works
today)?

<template id="tmpl">
  <svg>
    <circle .../>
  </svg>
</template>

Clearly there's an extra step here, in that accessing the SVG elements
requires hopping into firstElementChild, but adding new namespace-related
features seems unfortunate.

- Adam
Received on Thursday, 12 March 2015 18:17:06 UTC

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