Commit 2af7bba1 authored by locka%iol.ie's avatar locka%iol.ie
Browse files

Put conditional test around anchor scrolling so reload operations really do reload on anchor URLs

b=30558,r=,approved valeski
parent a4ade663
Loading
Loading
Loading
Loading
+19 −11
Original line number Diff line number Diff line
@@ -2359,6 +2359,12 @@ NS_IMETHODIMP nsDocShell::SetupNewViewer(nsIContentViewer* aNewViewer)
  
NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
   const char* aWindowTarget, nsIInputStream* aPostData, loadType aLoadType)
{
    // Check to see if the new URI is an anchor in the existing document.
    if (aLoadType == loadNormal ||
        aLoadType == loadNormalReplace ||
        aLoadType == loadHistory ||
        aLoadType == loadLink)
    {
        PRBool wasAnchor = PR_FALSE;
        NS_ENSURE_SUCCESS(ScrollIfAnchor(aURI, &wasAnchor), NS_ERROR_FAILURE);
@@ -2368,6 +2374,7 @@ NS_IMETHODIMP nsDocShell::InternalLoad(nsIURI* aURI, nsIURI* aReferrer,
            OnNewURI(aURI, nsnull, mLoadType);
            return NS_OK;
        }
    }

    NS_ENSURE_SUCCESS(StopCurrentLoads(), NS_ERROR_FAILURE);
    // Cancel any timers that were set for this loader.
@@ -2789,11 +2796,12 @@ NS_IMETHODIMP nsDocShell::ScrollIfAnchor(nsIURI* aURI, PRBool* aWasAnchor)

    // Compare the URIs.
    //
    // NOTE: this is case sensitive so it won't pick up www.ABC.com and
    // www.abc.com being the same. It's not possible to do a case-insensitive
    // comparison because some parts of the URI are case sensitive, and some
    // are not. e.g. the paths "/Something" and "/something" are two
    // different places on Unix.
    // NOTE: this is a case sensitive comparison because some parts of the
    // URI are case sensitive, and some are not. i.e. the domain name
    // is case insensitive but the the paths are not.
    //
    // This means that comparing "http://www.ABC.com/" to "http://www.abc.com/"
    // will fail this test.
 
    if (sCurrentLeft.CompareWithConversion(sNewLeft, PR_FALSE, -1) != 0)
    {