Re: innerHTML in DocumentFragment

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 UTC