W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

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

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Fri, 18 May 2012 20:29:07 -0700
Message-ID: <CABNRm62JD6a3hSw+R+z9s-HeaOzOWJhXmhpkJGwH4xpZAaashg@mail.gmail.com>
To: Rafael Weinstein <rafaelw@google.com>, Webapps WG <public-webapps@w3.org>, Henri Sivonen <hsivonen@iki.fi>, "Tab Atkins Jr." <jackalmage@gmail.com>, Yehuda Katz <wycats@gmail.com>, Scott González <scott.gonzalez@gmail.com>
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 GMT

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