Re: Newly-created browsing contexts and about:blank

I'm pretty sure WebKit fires the load event of <iframe
src="about:blank"> synchronously.  If compatibility allows, we'd
vastly prefer to fire the load event asynchronously.

I'll try to find time to review your research in detail.  Sadly, I've
spent a lot of time studying how about:blank works.

Adam


On Wed, Mar 2, 2011 at 6:39 AM, Henri Sivonen <hsivonen@iki.fi> wrote:
> I did some research on initial about:blank in newly-created browsing contexts:
> http://hsivonen.iki.fi/about-blank/
>
> Copying and pasting my conclusion:
>
>  * When loading any URL in a window.open-created browsing context, initially create the DOM of about:blank there synchronously, since all browsers seem to do roughly that.
>
>  * Since synchronous events are bad and Firefox gets away with not firing load synchronously for about:blank, never fire the load event synchronously.
>
>  * Fire a load event asynchronously for the document that is the destination of the navigation.
>
>  * If about:blank is the destination of navigation for window.open, use the initial synchronously-created DOM without overwriting it.
>
>  * If about:blank is the destination of navigation for an iframe create the DOM synchronously ASAP as with window.open.
>
> I am not sure what to think of the case where about:blank is not the initial destination of navigation for an iframe. Creating a synchronous placeholder about:blank DOM would make the browsing context code the same as in the window.open case and would provide an early document.body that scripts could accidentally poke without poking null. On the other hand, setting up such a DOM first and then letting the DOM be blown away by a later network task means that the presence of element nodes in the DOM would be racy relative to the network and to script getting appended to the DOM in the same parser task that appended the iframe. In that sense, the IE/Safari behavior would be nicer.
>
> Opinions about the conclusion?
>
> --
> Henri Sivonen
> hsivonen@iki.fi
> http://hsivonen.iki.fi/
>
>

Received on Thursday, 3 March 2011 07:31:18 UTC