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

On Wed, May 9, 2012 at 9:52 AM, Henri Sivonen <hsivonen@iki.fi> wrote:
> Why should the programmer first create a document fragment and then
> set a property on it? Why not introduce four methods on Document that
> return a DocumentFragment: document.parseFragmentHTML (parses like
> <template>.innerHTML), document.parseFragementSVG (parses like
> <svg>.innerHTML), document.parseFragmentMathML (parses like
> <math>.innerHTML) and document.parseFragmentXML (parses like innerHTML
> in the XML mode without namespace context)? This would avoid magic for
> distinguishing HTML <a> and SVG <a>.

We want <template> to be usable with SVG (and I guess MathML, though I
have no idea how useful that would be), though.

~TJ

Received on Wednesday, 9 May 2012 08:08:58 UTC