Bug 421067: 'Try Again' after a DNS error sometimes loads previous page, not the one that failed to load, patch by Michal Novotny <michal@allpeers.com>, r+sr=bzbarsky, a=schrep

This commit is contained in:
gavin@gavinsharp.com 2008-04-13 18:36:04 -07:00
Родитель 77a692ea50
Коммит fc1624e95f
3 изменённых файлов: 7 добавлений и 2 удалений

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

@ -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<nsIHistoryEntry> entry;
mSessionHistory->GetEntryAtIndex(idx, PR_FALSE,
getter_AddRefs(entry));
mLSHE = do_QueryInterface(entry);
}
nsCAutoString url;

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

@ -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;

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

@ -1054,6 +1054,7 @@ nsSHistory::UpdateIndex()
mIndex = mRequestedIndex;
}
mRequestedIndex = -1;
return NS_OK;
}