Re: Implied Context Parsing (DocumentFragment.innerHTML, or similar) proposal details to be sorted out

Not that I want to start another bike-shedding, there is one clear
distinction between innerHTML and createDocumentFragment, which is that
innerHTML sets already-started flag on parsed script elements
but createDocumentFragment does not (or rather it unsets it after the
fragment parsing algorithm has ran). See
http://html5.org/specs/dom-parsing.html#dom-range-createcontextualfragment

There appears to be a consensus to use document.parse (which is fine with
me), so I would like to double-check which behavior we're picking. IMO, the
only sane choice is to unset the already-started flag since doing otherwise
implies script elements parsed by document.parse won't be executed when
inserted into a document.

While we can change the behavior for template elements, I would rather have
the same behavior between all 3 APIs (createDocumentFragment, parse, and
template element) and let innerHTML be the outlier for legacy reasons.

(Note: I intend to fix the bug in WebKit that already-started flag isn't
unmarked in createDocumentFragment).

- Ryosuke

Received on Saturday, 19 May 2012 03:29:57 UTC