W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

Re: innerHTML in DocumentFragment

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 4 Nov 2011 09:45:19 -0700
Message-ID: <CAAWBYDAH3p58E7xg3mwoL1p-xueUNhEYvwNaHu0pAYDxXj1eUg@mail.gmail.com>
To: Daniel Cheng <dcheng@chromium.org>
Cc: João Eiras <joaoe@opera.com>, public-webapps WG <public-webapps@w3.org>
On Fri, Nov 4, 2011 at 9:33 AM, Daniel Cheng <dcheng@chromium.org> wrote:
> Instead of simply switching the insertion mode when you see an element that
> doesn't belong in in-body mode for context-less parsing, would it make sense
> to synthesize the appropriate context elements instead?

If I understand your suggestion correctly, then no, that would mean
that Yehuda's original example:

var frag = document.createDocumentFragment();
  frag.innerHTML = "<tr><td>hello</td></tr>"
  someTable.appendChild(frag)

would break - the frag would end up with a <table> and <tbody> inside,
which is wrong when you then try to insert it into an existing table.

~TJ
Received on Friday, 4 November 2011 16:46:17 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:48 GMT