Bug 421209, r=cpearce, sr=jst, a=beltzner

This commit is contained in:
2008-03-20 13:24:36 -07:00
parent 6eaa761641
commit 9613200975
14 changed files with 354 additions and 89 deletions

View File

@@ -201,6 +201,7 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#endif
#include "nsContentErrors.h"
#include "nsIFocusEventSuppressor.h"
// Number of documents currently loading
static PRInt32 gNumberOfDocumentsLoading = 0;
@@ -3675,7 +3676,12 @@ nsDocShell::Destroy()
if (docShellParentAsItem)
docShellParentAsItem->RemoveChild(this);
nsCOMPtr<nsIFocusEventSuppressorService> suppressor;
if (mContentViewer) {
suppressor =
do_GetService(NS_NSIFOCUSEVENTSUPPRESSORSERVICE_CONTRACTID);
NS_ENSURE_STATE(suppressor);
suppressor->Suppress();
mContentViewer->Close(nsnull);
mContentViewer->Destroy();
mContentViewer = nsnull;
@@ -3702,7 +3708,9 @@ nsDocShell::Destroy()
// Cancel any timers that were set for this docshell; this is needed
// to break the cycle between us and the timers.
CancelRefreshURITimers();
if (suppressor) {
suppressor->Unsuppress();
}
return NS_OK;
}