Bug 775009 - Part 2: Fix. r=bz
authorJustin Lebar <justin.lebar@gmail.com>
Sat, 25 Aug 2012 18:23:53 -0400
changeset 103431 7ef5b8b2c2c72582d852887b1772268747fe0c56
parent 103430 b431f498a9baa3cdf126608523222a4e9cac4dc6
child 103432 af3d980899704fa608576eb27c5a97088311a315
child 103468 b3cce81fef1ad4558bda4dd899db70c4c301e6cc
push id13986
push userjlebar@mozilla.com
push dateSat, 25 Aug 2012 22:24:43 +0000
treeherdermozilla-inbound@7ef5b8b2c2c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs775009
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 775009 - Part 2: Fix. r=bz
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8682,16 +8682,27 @@ nsDocShell::InternalLoad(nsIURI * aURI,
         // that history.go(0) and the like trigger full refreshes, rather than
         // short-circuited loads.
         bool doShortCircuitedLoad =
           (historyNavBetweenSameDoc && mOSHE != aSHEntry) ||
           (!aSHEntry && aPostData == nullptr &&
            sameExceptHashes && !newHash.IsEmpty());
 
         if (doShortCircuitedLoad) {
+            // Cancel any outstanding loads if this is a history load.
+            //
+            // 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);
+            }
+
             // 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);
             GetCurScrollPos(ScrollOrientation_Y, &cy);