diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 107e5c68c11..01c13be840a 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -6880,6 +6880,7 @@ nsDocShell::InternalLoad(nsIURI * aURI, OnNewURI(aURI, nsnull, mLoadType, PR_TRUE); nsCOMPtr postData; PRUint32 pageIdent = PR_UINT32_MAX; + nsCOMPtr 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. diff --git a/mozilla/docshell/test/Makefile.in b/mozilla/docshell/test/Makefile.in index dcc9b844ebf..56f081b31e3 100644 --- a/mozilla/docshell/test/Makefile.in +++ b/mozilla/docshell/test/Makefile.in @@ -63,6 +63,9 @@ _TEST_FILES = \ test_bug387979.html \ test_bug404548.html \ bug404548-subframe.html \ + test_bug413310.html \ + bug413310-subframe.html \ + bug413310-post.sjs \ $(NULL) libs:: $(_TEST_FILES) diff --git a/mozilla/docshell/test/bug413310-post.sjs b/mozilla/docshell/test/bug413310-post.sjs new file mode 100644 index 00000000000..b8d85dd3cf2 --- /dev/null +++ b/mozilla/docshell/test/bug413310-post.sjs @@ -0,0 +1,7 @@ +function handleRequest(request, response) { + response.setHeader("Content-Type", "text/html"); + response.write("" + + request.method + " " + + Date.now() + + ""); +} diff --git a/mozilla/docshell/test/bug413310-subframe.html b/mozilla/docshell/test/bug413310-subframe.html new file mode 100644 index 00000000000..bcff1886fd4 --- /dev/null +++ b/mozilla/docshell/test/bug413310-subframe.html @@ -0,0 +1,7 @@ + + + +
+
+ + diff --git a/mozilla/docshell/test/test_bug413310.html b/mozilla/docshell/test/test_bug413310.html new file mode 100644 index 00000000000..cd55b2d762f --- /dev/null +++ b/mozilla/docshell/test/test_bug413310.html @@ -0,0 +1,98 @@ + + + + + Test for Bug 413310 + + + + + +Mozilla Bug 413310 +

+ +

+ +
+
+
+ + +