W3C home > Mailing lists > Public > public-html@w3.org > June 2009

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

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 24 Jun 2009 00:24:42 +0000 (UTC)
To: Jonas Sicking <jonas@sicking.cc>
Cc: Travis Leithead <Travis.Leithead@microsoft.com>, "public-html@w3.org" <public-html@w3.org>
Message-ID: <Pine.LNX.4.62.0906240022181.16244@hixie.dreamhostps.com>
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).

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 24 June 2009 00:25:19 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 9 October 2021 18:44:49 UTC