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

Newly-created browsing contexts and about:blank

From: Henri Sivonen <hsivonen@iki.fi>
Date: Wed, 2 Mar 2011 06:39:57 -0800 (PST)
To: HTML WG <public-html@w3.org>
Message-ID: <1855719660.485417.1299076797456.JavaMail.root@cm-mail03.mozilla.org>
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 Wednesday, 2 March 2011 14:41:01 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:17:23 GMT