Bug 737307 - Don't clobber mLoadType in short-circuited loads. r=bz
authorJustin Lebar <justin.lebar@gmail.com>
Thu, 29 Mar 2012 11:27:13 -0700
changeset 90644 612fd2e764fdae8e76a5144e9659fe9939387833
parent 90643 5561efcb19f226576e474fa8a1f57ef68c111b70
child 90646 42639be584318304121181e12a5f93e252b675c6
push id22370
push userbmo@edmorley.co.uk
push dateFri, 30 Mar 2012 15:14:13 +0000
treeherdermozilla-central@0cfa44a13b25 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs737307
milestone14.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 737307 - Don't clobber mLoadType in short-circuited loads. r=bz
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -8367,16 +8367,22 @@ nsDocShell::InternalLoad(nsIURI * aURI,
             // ScrollToAnchor doesn't necessarily cause us to scroll the window;
             // the function decides whether a scroll is appropriate based on the
             // arguments it receives.  But even if we don't end up scrolling,
             // ScrollToAnchor performs other important tasks, such as informing
             // the presShell that we have a new hash.  See bug 680257.
             rv = ScrollToAnchor(curHash, newHash, aLoadType);
             NS_ENSURE_SUCCESS(rv, rv);
 
+            // Reset mLoadType to its original value once we exit this block,
+            // because this short-circuited load might have started after a
+            // normal, network load, and we don't want to clobber its load type.
+            // See bug 737307.
+            AutoRestore<PRUint32> loadTypeResetter(mLoadType);
+
             mLoadType = aLoadType;
             mURIResultedInDocument = true;
 
             /* we need to assign mLSHE to aSHEntry right here, so that on History loads,
              * SetCurrentURI() called from OnNewURI() will send proper
              * onLocationChange() notifications to the browser to update
              * back/forward buttons.
              */