diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 1dfc3130b07..b1b81d35003 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -3221,11 +3221,13 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL, if (mSessionHistory && !mLSHE) { PRInt32 idx; mSessionHistory->GetRequestedIndex(&idx); + if (idx == -1) + mSessionHistory->GetIndex(&idx); + nsCOMPtr entry; mSessionHistory->GetEntryAtIndex(idx, PR_FALSE, getter_AddRefs(entry)); mLSHE = do_QueryInterface(entry); - } nsCAutoString url; diff --git a/mozilla/docshell/shistory/public/nsISHistory.idl b/mozilla/docshell/shistory/public/nsISHistory.idl index 7ce3dd5704f..3f47c972685 100644 --- a/mozilla/docshell/shistory/public/nsISHistory.idl +++ b/mozilla/docshell/shistory/public/nsISHistory.idl @@ -80,7 +80,9 @@ interface nsISHistory: nsISupports /** * A readonly property of the interface that returns - * the index of the last document that started to load. + * the index of the last document that started to load and + * didn't finished yet. When document finishes the loading + * value -1 is returned. */ readonly attribute long requestedIndex; diff --git a/mozilla/docshell/shistory/src/nsSHistory.cpp b/mozilla/docshell/shistory/src/nsSHistory.cpp index bd81790b6d8..0d642ea928f 100644 --- a/mozilla/docshell/shistory/src/nsSHistory.cpp +++ b/mozilla/docshell/shistory/src/nsSHistory.cpp @@ -1054,6 +1054,7 @@ nsSHistory::UpdateIndex() mIndex = mRequestedIndex; } + mRequestedIndex = -1; return NS_OK; }