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

Thanks, this helps. Keep up the good work.

By the way, I think that you've got a typo in the "in_body" insertion mode, in both the algorithm for handling the start tag whose name is "li" as well as the start tag whose name is one of "dd" or "dt":
* Step 5 of the algorithms indicate to "return to step 2," but I think you mean step _3_.

:)

-Travis

-----Original Message-----
From: Ian Hickson [mailto:ian@hixie.ch]
Sent: Tuesday, June 23, 2009 5:25 PM
To: Jonas Sicking
Cc: Travis Leithead; public-html@w3.org
Subject: Re: (HTML5 Parsing) Yet another corner-case: parsing into other contexts...

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 03:51:03 UTC