From c0d2a0e2f28cdeb6323792f5f2ef30234f907ef0 Mon Sep 17 00:00:00 2001 From: "rpotts%netscape.com" Date: Wed, 6 Oct 1999 05:15:13 +0000 Subject: [PATCH] bug #15605. Reviewed by nisheeth. Check the return code from GoToAnchor(...) :-) git-svn-id: svn://10.0.0.236/trunk@49954 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/docshell/base/nsWebShell.cpp | 23 ++++++++++++++--------- mozilla/webshell/src/nsWebShell.cpp | 23 ++++++++++++++--------- 2 files changed, 28 insertions(+), 18 deletions(-) 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) {