For fastback, dispatch the title change notification after we've updated our history entry in the docshell, so that we don't set the title on the wrong history entry. Bug 296745, r+sr=darin, a=asa.

git-svn-id: svn://10.0.0.236/trunk@174884 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bryner%brianryner.com
2005-06-20 22:06:30 +00:00
parent 12b3e2fe4a
commit 89fff37c75

View File

@@ -5248,15 +5248,6 @@ nsDocShell::RestorePresentation(nsISHEntry *aSHEntry, PRBool aSavePresentation,
aSHEntry->GetRefreshURIList(getter_AddRefs(mRefreshURIList));
aSHEntry->SetRefreshURIList(nsnull);
// Restore the page title. Re-setting the current title on the document
// will update the docshell title and dispatch DOMTitleChanged.
nsIDocument *doc = shell->GetDocument();
nsCOMPtr<nsIDOMNSDocument> nsDoc = do_QueryInterface(doc);
if (doc && nsDoc) {
const nsAFlatString &title = doc->GetDocumentTitle();
nsDoc->SetTitle(title);
}
// aSHEntry is now our currently-loaded document.
mOSHE = aSHEntry;
@@ -5304,7 +5295,18 @@ nsDocShell::RestorePresentation(nsISHEntry *aSHEntry, PRBool aSavePresentation,
SetCurrentURI(uri);
// Dispatch onload and DOMPageRestore.
// Restore the page title. Re-setting the current title on the document
// will update the docshell title and dispatch DOMTitleChanged.
// (We must do this after setting mOSHE so that the correct history entry
// title is set).
nsIDocument *doc = shell->GetDocument();
nsCOMPtr<nsIDOMNSDocument> nsDoc = do_QueryInterface(doc);
if (doc && nsDoc) {
const nsAFlatString &title = doc->GetDocumentTitle();
nsDoc->SetTitle(title);
}
// Dispatch DOMPageShow and other events.
rv = BeginRestore(PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);