Fix longstanding issue where anchor scrolls on a POST result page could lead to

a silent re-POST during history traversal.  Bug 413310, r+sr=biesi,
a=dsicore,beltzner,righteousness.


git-svn-id: svn://10.0.0.236/trunk@246774 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2008-02-29 04:21:39 +00:00
parent 971dfa5671
commit 7022e7f978
5 changed files with 122 additions and 0 deletions

View File

@@ -6880,6 +6880,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
OnNewURI(aURI, nsnull, mLoadType, PR_TRUE);
nsCOMPtr<nsIInputStream> postData;
PRUint32 pageIdent = PR_UINT32_MAX;
nsCOMPtr<nsISupports> cacheKey;
if (mOSHE) {
/* save current position of scroller(s) (bug 59774) */
@@ -6893,6 +6894,7 @@ nsDocShell::InternalLoad(nsIURI * aURI,
if (aLoadType & LOAD_CMD_NORMAL) {
mOSHE->GetPostData(getter_AddRefs(postData));
mOSHE->GetPageIdentifier(&pageIdent);
mOSHE->GetCacheKey(getter_AddRefs(cacheKey));
}
}
@@ -6907,6 +6909,11 @@ nsDocShell::InternalLoad(nsIURI * aURI,
// page will restore the appropriate postData.
if (postData)
mOSHE->SetPostData(postData);
// Make sure we won't just repost without hitting the
// cache first
if (cacheKey)
mOSHE->SetCacheKey(cacheKey);
// Propagate our page ident to the new mOSHE so that
// we'll know it just differed by a scroll on the page.