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: Mon, 21 May 2012 14:43:48 -0700
Message-ID: <CABNRm61WgU5=iEHJMsYqPW_JzQNCT3_7KU+YO-Bhc+Tn4YOkKg@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
On Sat, May 19, 2012 at 4:59 PM, Ryosuke Niwa <rniwa@webkit.org> wrote:

> 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?
>

I have changed WebKit's behavior based on this assumption:
http://trac.webkit.org/changeset/117731.

- Ryosuke
Received on Monday, 21 May 2012 21:45:00 GMT

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