From f9ddb4fbbb84485d0ecbe28c0601e6f8136993fb Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Thu, 27 Mar 2003 20:51:31 +0000 Subject: [PATCH] Fix for bug # 180598. link within a page created by a POST, then RELOAD, POST data is lost. r=adamlock sr=alecf git-svn-id: svn://10.0.0.236/trunk@140408 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsDocShell.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/mozilla/docshell/base/nsDocShell.cpp b/mozilla/docshell/base/nsDocShell.cpp index 8f582317b2e..dc7de6575b0 100644 --- a/mozilla/docshell/base/nsDocShell.cpp +++ b/mozilla/docshell/base/nsDocShell.cpp @@ -5106,16 +5106,29 @@ nsDocShell::InternalLoad(nsIURI * aURI, * recorded in session and global history. */ OnNewURI(aURI, nsnull, mLoadType); - - /* save current position of scroller(s) (bug 59774) */ - if (mOSHE) + nsCOMPtr postData; + + if (mOSHE) { + /* save current position of scroller(s) (bug 59774) */ mOSHE->SetScrollPosition(cx, cy); + // Get the postdata from the current page, if it was + // loaded through normal means. + if (aLoadType == LOAD_NORMAL || aLoadType == LOAD_LINK) + mOSHE->GetPostData(getter_AddRefs(postData)); + } /* Assign mOSHE to mLSHE. This will either be a new entry created * by OnNewURI() for normal loads or aSHEntry for history loads. */ - if (mLSHE) + if (mLSHE) { mOSHE = mLSHE; + // Save the postData obtained from the previous page + // in to the session history entry created for the + // anchor page, so that any history load of the anchor + // page will restore the appropriate postData. + if (postData) + mOSHE->SetPostData(postData); + } /* restore previous position of scroller(s), if we're moving * back in history (bug 59774)