Use the right URI when restoring a page from history. Bug 360511, r=jst, sr=sicking

This commit is contained in:
bzbarsky%mit.edu 2007-01-17 18:55:35 +00:00
Родитель eb6fa3da0d
Коммит 57394f5408
1 изменённых файлов: 8 добавлений и 2 удалений

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

@ -5462,8 +5462,14 @@ nsDocShell::RestoreFromHistory()
nsCOMPtr<nsIDocument> document = do_QueryInterface(domDoc);
if (document) {
SetCurrentURI(document->GetDocumentURI(),
document->GetChannel(), PR_TRUE);
// Use the uri from the mLSHE we had when we entered this function
// (which need not match the document's URI if anchors are involved),
// since that's the history entry we're loading. Note that if we use
// origLSHE we don't have to worry about whether the entry in question
// is still mLSHE or whether it's now mOSHE.
nsCOMPtr<nsIURI> uri;
origLSHE->GetURI(getter_AddRefs(uri));
SetCurrentURI(uri, document->GetChannel(), PR_TRUE);
}
// This is the end of our CreateContentViewer() replacement.