Bug 529119 - Funky behavior with XUL error pages, r=bz

This commit is contained in:
Honza Bambas
2009-11-18 17:02:28 +01:00
parent 2fb189da80
commit d65ac18a89
5 changed files with 213 additions and 14 deletions

View File

@@ -3798,20 +3798,6 @@ nsDocShell::LoadErrorPage(nsIURI *aURI, const PRUnichar *aURL,
mFailedURI = aURI;
mFailedLoadType = mLoadType;
// Be sure to have a correct mLSHE, it may have been cleared by
// EndPageLoad. See bug 302115.
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;
nsCAutoString charset;
if (aURI)
@@ -7052,6 +7038,20 @@ nsDocShell::CreateContentViewer(const char *aContentType,
OnNewURI(failedURI, nsnull, nsnull, mLoadType, PR_TRUE, PR_FALSE);
}
// Be sure to have a correct mLSHE, it may have been cleared by
// EndPageLoad. See bug 302115.
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);
}
// Set our current URI
SetCurrentURI(failedURI);