W3C home > Mailing lists > Public > whatwg@whatwg.org > May 2012

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

From: Ryosuke Niwa <rniwa@webkit.org>
Date: Sat, 19 May 2012 16:59:37 -0700
Message-ID: <CABNRm63viUD2CvCoKJPA9WdQ+6p1V9tjZx6Xof1aR1Qbpp+e+A@mail.gmail.com>
To: Ian Hickson <ian@hixie.ch>
Cc: Henri Sivonen <hsivonen@iki.fi>, Ms2ger <ms2ger@gmail.com>, Jonas Sicking <jonas@sicking.cc>, whatwg@whatwg.org
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@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
Received on Sunday, 20 May 2012 00:00:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:48:08 GMT