[whatwg] Should script run if it comes from a HTML fragment?

Ryosuke Niwa rniwa at webkit.org
Sat May 19 16:59:37 PDT 2012


Sorry, I got distracted by other work. Now that we're talking about
document.parse, I'm determined to dedicate some cycles on this.

On Wed, Feb 9, 2011 at 1:26 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Thu, 11 Nov 2010, Ryosuke Niwa wrote:
> >
> > I'm working on the WebKit bug 12234 - Using createContextualFragment to
> > insert a <script> does not cause the script to execute
> > <https://bugs.webkit.org/show_bug.cgi?id=12234>. [...]
>
> This thread pretty much resolved itself, but for the record:
>
> * createContextualFragment() is here:
>
> http://html5.org/specs/dom-parsing.html#dom-range-createcontextualfragment
>  ...and re-enables scripts before returning them; the parser doesn't
>  execute them synchronously.
>
> * innerHTML doesn't run scripts and they are inserted disabled.
>

It appears that we have a slight bug there. While we unmark the script
element as already-started, we don't unmark it as parser-inserted. So we
end up never "preparing" the script element per:
http://www.whatwg.org/specs/web-apps/current-work/multipage/scripting-1.html#parser-inserted

Should we also unmark it as parser-inserted in this case?

- Ryosuke


More information about the whatwg mailing list