Don't allow loads to start in a docshell that's firing the unload event. Also

don't allow document.open of the document in that docshell.  Bug 371360,
r=biesi, sr=jst


git-svn-id: svn://10.0.0.236/trunk@228064 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2007-06-14 18:18:06 +00:00
parent ca2220759a
commit 7bd3f5ccc3
5 changed files with 55 additions and 8 deletions

View File

@@ -768,6 +768,11 @@ nsWebShell::OnLinkClick(nsIContent* aContent,
nsIInputStream* aHeadersDataStream)
{
NS_ASSERTION(NS_IsMainThread(), "wrong thread");
if (mFiredUnloadEvent) {
return NS_OK;
}
nsCOMPtr<nsIRunnable> ev =
new OnLinkClickEvent(this, aContent, aURI, aTargetSpec,
aPostDataStream, aHeadersDataStream);
@@ -791,6 +796,10 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
*aRequest = nsnull;
}
if (mFiredUnloadEvent) {
return NS_OK;
}
{
// defer to an external protocol handler if necessary...
nsCOMPtr<nsIExternalProtocolService> extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID);