Re: [webcomponents] Template element parser changes => Proposal for adding DocumentFragment.innerHTML

On Fri, May 11, 2012 at 1:55 AM, Henri Sivonen <hsivonen@iki.fi> wrote:
>
> Open question: Should it be possible to use a magic attribute on the
> first tag token to disambiguate it as MathML or SVG? xmlns="..." would
> be an obvious disambiguator, but the values are unwieldy.  Should
> xlink:href be used as a disambiguator for <a>? If the use case is
> putting tree literals in code, it probably doesn't make sense to use
> <script> or <style> (either HTML or SVG) in that kind of context
> anyway. And SVG <font> has been rejected by Mozilla and Microsoft
> anyway.
>

That sounds rather complicated and potentially surprising although I
definitely see where you're coming from.

I still think that having to create a DocumentFragment first and then
> set innerHTML on it is inconvenient and we should have a method on
> document that takes a string to parse and returns the resulting
> DocumentFragment, e.g. document.parse(string) to keep it short.
>

Yes! Can we re-use createDocumentFragment and add an optional argument
instead though?

- Ryosuke

Received on Friday, 11 May 2012 10:00:53 UTC