This seems sensible. I've updated the WebKit patch to do exactly this: https://bugs.webkit.org/show_bug.cgi?id=84646
It appears that the details of the proposal are now sorted out. I'll start a new thread describing the full API & semantics. On Fri, May 18, 2012 at 8:29 PM, Ryosuke Niwa <rn...@webkit.org> wrote: > 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 >