Bug 791011 - When doing a hash navigation, cancel any outstanding document loads, but don't cancel other network activity. r=bz a=akeybl
authorJustin Lebar <justin.lebar@gmail.com>
Thu, 20 Sep 2012 15:16:54 -0400
changeset 81997 277752f212a12b63e3666333811856a5aacbde19
parent 81996 03d28718012f2493039404e97e5af57b929b6071
child 81998 2b2a09683ad5d5d8a1b59be10f01478aa0987add
push id273
push userjlebar@mozilla.com
push dateSun, 23 Sep 2012 23:49:42 +0000
reviewersbz, akeybl
bugs791011
milestone10.0.8esrpre
Bug 791011 - When doing a hash navigation, cancel any outstanding document loads, but don't cancel other network activity. r=bz a=akeybl
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8340,25 +8340,27 @@ nsDocShell::InternalLoad(nsIURI * aURI,
 
         // Fire a hashchange event if we're doing a short-circuited load and the
         // URIs differ only in their hashes.
         bool doHashchange = doShortCircuitedLoad &&
                               sameExceptHashes &&
                               !curHash.Equals(newHash);
 
         if (doShortCircuitedLoad) {
-            // Cancel any outstanding loads if this is a history load.
+            // Cancel an outstanding new-document load if this is a history
+            // load.
             //
-            // We can't cancel the oustanding load unconditionally, because if a page does
+            // We can't cancel the oustanding load unconditionally, because if a
+            // page does
             //   - load a.html
             //   - start loading b.html
             //   - load a.html#h
             // we break the web if we cancel the load of b.html.
-            if (aSHEntry) {
-                Stop(nsIWebNavigation::STOP_NETWORK);
+            if (aSHEntry && mDocumentRequest) {
+                mDocumentRequest->Cancel(NS_BINDING_ABORTED);
             }
 
             // Save the current URI; we need it if we fire a hashchange later.
             nsCOMPtr<nsIURI> oldURI = mCurrentURI;
 
             // Save the position of the scrollers.
             nscoord cx = 0, cy = 0;
             GetCurScrollPos(ScrollOrientation_X, &cx);