bug 303267: Store the entire inner window object on the history entry instead of copying/restoring JS properties. r=bryner sr=jst. This patch also fixes bugs 304284 and 304078.

git-svn-id: svn://10.0.0.236/trunk@177684 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2005-08-13 00:53:39 +00:00
parent 2f8deabb49
commit 7d07d878fd
10 changed files with 283 additions and 342 deletions

View File

@@ -5227,8 +5227,14 @@ nsDocShell::RestoreFromHistory()
mContentViewer.swap(viewer);
viewer = nsnull; // force a release to complete ownership transfer
// Grab the window state up here so we can pass it to Open.
nsCOMPtr<nsISupports> windowState;
mLSHE->GetWindowState(getter_AddRefs(windowState));
mLSHE->SetWindowState(nsnull);
// Reattach to the window object.
rv = mContentViewer->Open();
rv = mContentViewer->Open(windowState);
// Now remove it from the cached presentation.
mLSHE->SetContentViewer(nsnull);
@@ -5275,14 +5281,9 @@ nsDocShell::RestoreFromHistory()
do_GetInterface(NS_STATIC_CAST(nsIInterfaceRequestor*, this));
NS_ASSERTION(privWin, "could not get nsPIDOMWindow interface");
nsCOMPtr<nsISupports> windowState;
mLSHE->GetWindowState(getter_AddRefs(windowState));
rv = privWin->RestoreWindowState(windowState);
NS_ENSURE_SUCCESS(rv, rv);
mLSHE->SetWindowState(nsnull);
// Now, dispatch a title change event which would happed as the
// <head> is parsed.
nsCOMPtr<nsIDOMNSDocument> nsDoc = do_QueryInterface(document);