diff --git a/mozilla/docshell/base/nsWebShell.cpp b/mozilla/docshell/base/nsWebShell.cpp index 212b9aad69b..fac02998bb7 100644 --- a/mozilla/docshell/base/nsWebShell.cpp +++ b/mozilla/docshell/base/nsWebShell.cpp @@ -2017,17 +2017,22 @@ nsWebShell::DoLoadURL(nsIURI * aUri, if (nsnull != (const char *) ref) { // Go to the anchor in the current document rv = presShell->GoToAnchor(nsAutoString(ref)); + if (NS_SUCCEEDED(rv)) { + // Pass notifications to BrowserAppCore just to be consistent with + // regular page loads thro' necko + nsCOMPtr dummyChannel; + rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull); + if (NS_FAILED(rv)) return rv; - // Pass notifications to BrowserAppCore just to be consistent with - // regular page loads thro' necko - nsCOMPtr dummyChannel; - rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull); - if (NS_FAILED(rv)) return rv; + mProcessedEndDocumentLoad = PR_FALSE; + rv = OnEndDocumentLoad(mDocLoader, dummyChannel, 0, this); - mProcessedEndDocumentLoad = PR_FALSE; - rv = OnEndDocumentLoad(mDocLoader, dummyChannel, 0, this); - - return rv; + return rv; + } + // + // If the anchor does not exist, just fall down into the code + // to load a new document... + // } else if (aType == LOAD_HISTORY) { diff --git a/mozilla/webshell/src/nsWebShell.cpp b/mozilla/webshell/src/nsWebShell.cpp index 212b9aad69b..fac02998bb7 100644 --- a/mozilla/webshell/src/nsWebShell.cpp +++ b/mozilla/webshell/src/nsWebShell.cpp @@ -2017,17 +2017,22 @@ nsWebShell::DoLoadURL(nsIURI * aUri, if (nsnull != (const char *) ref) { // Go to the anchor in the current document rv = presShell->GoToAnchor(nsAutoString(ref)); + if (NS_SUCCEEDED(rv)) { + // Pass notifications to BrowserAppCore just to be consistent with + // regular page loads thro' necko + nsCOMPtr dummyChannel; + rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull); + if (NS_FAILED(rv)) return rv; - // Pass notifications to BrowserAppCore just to be consistent with - // regular page loads thro' necko - nsCOMPtr dummyChannel; - rv = NS_OpenURI(getter_AddRefs(dummyChannel), aUri, nsnull); - if (NS_FAILED(rv)) return rv; + mProcessedEndDocumentLoad = PR_FALSE; + rv = OnEndDocumentLoad(mDocLoader, dummyChannel, 0, this); - mProcessedEndDocumentLoad = PR_FALSE; - rv = OnEndDocumentLoad(mDocLoader, dummyChannel, 0, this); - - return rv; + return rv; + } + // + // If the anchor does not exist, just fall down into the code + // to load a new document... + // } else if (aType == LOAD_HISTORY) {