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

On Fri, May 11, 2012 at 11:59 AM, Ryosuke Niwa <rniwa@webkit.org> wrote:
> On Fri, May 11, 2012 at 1:55 AM, Henri Sivonen <hsivonen@iki.fi> wrote:
>> 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?

That seems unacceptably verbose.  :/  I doubt people will be happy
trading in their single-character $ for the 22-character
createDocumentFragment.  document.parse is 14 characters, which is
less than ideal, but still much better.

~TJ

Received on Friday, 11 May 2012 10:13:36 UTC