From b68940b3afe5bbfe2f3fdc511c7a60cc69438d27 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 8 Jan 2004 04:23:22 +0000 Subject: [PATCH] Change logic for detecting whether two loads with the same URI (up to anchor) are actually different to be smarter about dealing with postdata (both loads may have postdata and may be the same or different depending on what that post data is). Bug 227554, r=adamlock, sr=darin --- docshell/base/nsDocShell.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index bdc7d1c4dfa..7da93f743fe 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -5106,11 +5106,24 @@ nsDocShell::InternalLoad(nsIURI * aURI, // // First: // Check to see if the new URI is an anchor in the existing document. + // Skip this check if we're doing some sort of abnormal load, if + // the new load is a non-history load and has postdata, or if + // we're doing a history load and there are postdata differences + // between what we plan to load and what we have loaded currently. // + PRBool samePostData = PR_TRUE; + if (!aSHEntry) { + samePostData = (aPostData == nsnull); + } else if (mOSHE) { + nsCOMPtr currentPostData; + mOSHE->GetPostData(getter_AddRefs(currentPostData)); + samePostData = (currentPostData == aPostData); + } + if ((aLoadType == LOAD_NORMAL || aLoadType == LOAD_NORMAL_REPLACE || aLoadType == LOAD_HISTORY || - aLoadType == LOAD_LINK) && (aPostData == nsnull)) { + aLoadType == LOAD_LINK) && samePostData) { PRBool wasAnchor = PR_FALSE; nscoord cx, cy; NS_ENSURE_SUCCESS(ScrollIfAnchor(aURI, &wasAnchor, aLoadType, &cx, &cy), NS_ERROR_FAILURE);