Bug 535004: Check if we've fired an unload event before calling OnPageShow, in DocumentViewerImpl::LoadComplete. r=smaug

This commit is contained in:
Daniel Holbert 2009-12-23 16:19:26 -08:00
Родитель 3fd219cd5e
Коммит 4a8bd6f42f
2 изменённых файлов: 8 добавлений и 4 удалений

Просмотреть файл

@ -3609,6 +3609,11 @@ nsDocument::SetScriptGlobalObject(nsIScriptGlobalObject *aScriptGlobalObject)
"Script global object must be an inner window!");
}
#endif
NS_ABORT_IF_FALSE(aScriptGlobalObject || !mAnimationController ||
mAnimationController->IsPausedByType(
nsSMILTimeContainer::PAUSE_PAGEHIDE |
nsSMILTimeContainer::PAUSE_BEGIN),
"Clearing window pointer while animations are unpaused");
if (mScriptGlobalObject && !aScriptGlobalObject) {
// We're detaching from the window. We need to grab a pointer to

Просмотреть файл

@ -1067,10 +1067,9 @@ DocumentViewerImpl::LoadComplete(nsresult aStatus)
window = mDocument->GetWindow();
if (window) {
nsIDocShell *docShell = window->GetDocShell();
PRBool beingDestroyed;
if (docShell &&
NS_SUCCEEDED(docShell->IsBeingDestroyed(&beingDestroyed)) &&
!beingDestroyed) {
PRBool isInUnload;
if (docShell && NS_SUCCEEDED(docShell->GetIsInUnload(&isInUnload)) &&
!isInUnload) {
mDocument->OnPageShow(restoring, nsnull);
}
}