Bug 634435: Add a property to expose the current pushState-state. r=jlebar a=beltzner

This commit is contained in:
Jonas Sicking
2011-02-17 12:44:04 -08:00
parent 7fb81afafa
commit 9c6c0bae9b
9 changed files with 89 additions and 76 deletions

View File

@@ -6074,7 +6074,7 @@ nsDocShell::EndPageLoad(nsIWebProgress * aProgress,
if (!mEODForCurrentDocument && mContentViewer) {
// Set the pending state object which will be returned to the page in
// the popstate event.
SetDocPendingStateObj(mLSHE);
SetDocCurrentStateObj(mLSHE);
mIsExecutingOnLoadHandler = PR_TRUE;
rv = mContentViewer->LoadComplete(aStatus);
@@ -7766,7 +7766,7 @@ nsDocShell::SetupNewViewer(nsIContentViewer * aNewViewer)
}
nsresult
nsDocShell::SetDocPendingStateObj(nsISHEntry *shEntry)
nsDocShell::SetDocCurrentStateObj(nsISHEntry *shEntry)
{
nsresult rv;
@@ -7782,7 +7782,7 @@ nsDocShell::SetDocPendingStateObj(nsISHEntry *shEntry)
// empty string.
}
document->SetPendingStateObject(stateData);
document->SetCurrentStateObject(stateData);
return NS_OK;
}
@@ -8432,7 +8432,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
doc->SetDocumentURI(newURI);
}
SetDocPendingStateObj(mOSHE);
SetDocCurrentStateObj(mOSHE);
// Dispatch the popstate and hashchange events, as appropriate.
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(mScriptGlobal);