Abort restoring the presentation if firing pagehide/unload stopped the load. Bug 305995, r+sr=bzbarsky.

This commit is contained in:
bryner%brianryner.com 2005-08-31 22:01:46 +00:00
Родитель e46d1a929d
Коммит a475440a84
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -5187,8 +5187,18 @@ nsDocShell::RestoreFromHistory()
if (oldMUDV && newMUDV)
oldMUDV->GetTextZoom(&zoom);
// Protect against mLSHE going away via a load triggered from
// pagehide or unload.
nsCOMPtr<nsISHEntry> origLSHE = mLSHE;
// Notify the old content viewer that it's being hidden.
FirePageHideNotification(!mSavingOldViewer);
// If mLSHE was changed as a result of the pagehide event, then
// something else was loaded. Don't finish restoring.
if (mLSHE != origLSHE)
return NS_OK;
// Set mFiredUnloadEvent = PR_FALSE so that the unload handler for the
// *new* document will fire.
mFiredUnloadEvent = PR_FALSE;