Re: Necko e10s specs

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Mike Shaver wrote:
> Can one domain trigger a navigation/document.write/clear/etc. cause an
> onbeforeunload in a document on another domain to fire synchronously?

Gah.

beforeunload fires in the following cases right now:

1) Right after the script of a javascript: URI executes.  This could 
probably be made async from that execution if needed; it's already async 
from whatever started the load (modulo plug-ins, but we could change that).

2) window.close() is called.  This is in fact sync and the caller just 
needs to be the opener of the window; the page in the window might be 
from a different domain now.  This is moderately annoying.  Then again, 
they're already "same domain" for multi-process purposes in that one has 
a direct pointer to the window of the other, no?

3) We call CreateAboutBlankContentViewer while a document is loaded. 
This can happen when doing URI loads of URIs sent to us from outside the 
app (which I think should be ok) and on LoadHistoryEntry of an entry 
whose URI is javascript:.  This last can be triggered sync by a web 
page, but I don't think that can happen cross-domain (have to be able to 
do a history.go/back/forward on that webpage, and I _think_ that 
requires same-origin).

4) Doing a navigation on the docshell via setting window.location.  This 
would be sync and can happen cross-domain.  We should consider making it 
async, perhaps (just like link clicks and form submits already are).

5) document.open will do it, but that can't be called cross-domain, 
ever.  Or rather, it throws NS_ERROR_DOM_SECURITY_ERR if it is.

So if we make the close() and location= codepaths deal, I think we 
should be safe here.

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.