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

On Tue, Jun 23, 2009 at 5:02 PM, Travis
Leithead<Travis.Leithead@microsoft.com> wrote:
> [parent browsing context]
> …
> <iframe src=child.html></iframe>
> <div id=attach></div>
> …
>
> [child.html (assuming same-domain access is allowed to parent markup)]
>
> <html>
>   <body>
>     <div id=a>
>       <span>
>         <script>
>           window.parent.document.getElementById(‘attach’).appendChild(
> document.getElementById(‘a’) );
>         </script>
>         <span id=where>Where does this get parsed?
>         </span>
>       </span>
>     </div>
>   </body>
> </html>
>
>
> 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.

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.

/ Jonas

Received on Wednesday, 24 June 2009 00:14:54 UTC