Re: (HTML5 Parsing) Yet another corner-case: parsing into other contexts...

On Wed, 24 Jun 2009 02:24:42 +0200, Ian Hickson <ian@hixie.ch> wrote:

> On Tue, 23 Jun 2009, Jonas Sicking wrote:
>> >
>> > Does the <span id=where> get parsed as a child of “div#a > span” in
>> > the parent browsing context, or in child.html?
>>
>> In gecko I believe we parse into the parent browsing context.
>
> That matches HTML5 also. (Assuming we change DOM3 Core to not require  
> node
> adoption, anyway, but I think that's pretty much a given now.)
>
>
>> Another interesting case is if the <span id=where> is instead a <script
>> id=where>. Does that script execute in the parent browsing context or
>> the child browsing context. In gecko it will execute in the parent I
>> believe, but in HTML 5 I think it'll execute in the child since it's the
>> parser that executes scripts.
>
> In HTML5 the parser executes the script but it does so based on where the
> element was placed, which in this case would mean it executes in the
> context of the parent browser context also. In particular, if the script
> contains a document.write() call, assuming the parent document has no
> active parser, it'll blow away the parent document (by implying a
> document.open() call on the parent).

Maybe you should add an example to the spec where a script moves the  
element that the parser is inserting to.

-- 
Simon Pieters
Opera Software

Received on Wednesday, 24 June 2009 00:44:21 UTC