bug 303267: Store the entire inner window in the window state holder instead of copying properties and restoring them. This fixes going back and forth with the bfcache on when the page gone to has javascript in it. r=jst sr=bryner

git-svn-id: svn://10.0.0.236/trunk@177765 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mrbkap%gmail.com
2005-08-15 18:16:42 +00:00
parent 96f39b4bf7
commit 1990895d08
10 changed files with 341 additions and 373 deletions

View File

@@ -5233,8 +5233,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);
@@ -5285,14 +5291,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);