W3C home > Mailing lists > Public > public-html@w3.org > March 2011

Re: Newly-created browsing contexts and about:blank

From: Adam Barth <w3c@adambarth.com>
Date: Wed, 2 Mar 2011 23:30:13 -0800
Message-ID: <AANLkTi=bPAb9=a788gKfF+K2FVgZHMo9pW2j+D5pRg19@mail.gmail.com>
To: Henri Sivonen <hsivonen@iki.fi>
Cc: HTML WG <public-html@w3.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:39:23 UTC