Re: Newly-created browsing contexts and about:blank

On Mar 3, 2011, at 23:21, Adam Barth wrote:

> A conceptual model that seems to make sense here is the following:
> 
> 1) When frames are created (either iframes or main frames), they're
> created with a blank document.  That's why it's synchronous and the
> load even doesn't fire: the document came into existence with the
> frame.
> 
> 2) Then, we perform an asynchronous navigation to the desired URL
> (whether about:blank or otherwise).
> 
> 3) For about:blank, the load completes atomically (which makes sense
> because it's internal) and the load event fires as usual.

The problem with this model in Gecko is that the synchronous initial about:blank is semi-useless and confusing for authors. The author's script sees one about:blank, maybe adds stuff there using DOM manipulation and then the other about:blank loads and blows away whatever the author put in the first one.

So the merit of Gecko's current model is that works with existing pages and test cases that already work in Gecko (obviously). The synchronous part is rather useless for authors beyond avoiding scripts crashing when scripts try to poke null document.body or something of that nature.

-- 
Henri Sivonen
hsivonen@iki.fi
http://hsivonen.iki.fi/

Received on Monday, 7 March 2011 11:23:31 UTC