commit 2018a919c20f8f2123a93853bc447fa3788f39cb Author: Olli Pettay Olli.Pettay@helsinki.fi Date: Sat Mar 1 21:07:42 2014 +0200
Bug 895557 - Follow the spec when doing fragment navigation during page loads. r=bz, a=lsblakk --- docshell/base/nsDocShell.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-)
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp index 59cf956..1e602fd 100644 --- a/docshell/base/nsDocShell.cpp +++ b/docshell/base/nsDocShell.cpp @@ -8977,19 +8977,6 @@ nsDocShell::InternalLoad(nsIURI * aURI, sameExceptHashes && !newHash.IsEmpty());
if (doShortCircuitedLoad) { - // 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 - // - 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 && mDocumentRequest) { - mDocumentRequest->Cancel(NS_BINDING_ABORTED); - } - // Save the current URI; we need it if we fire a hashchange later. nsCOMPtr<nsIURI> oldURI = mCurrentURI;
@@ -9024,6 +9011,8 @@ nsDocShell::InternalLoad(nsIURI * aURI,
mURIResultedInDocument = true;
+ nsCOMPtr<nsISHEntry> oldLSHE = mLSHE; + /* 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 @@ -9101,10 +9090,10 @@ nsDocShell::InternalLoad(nsIURI * aURI, SetCurScrollPosEx(bx, by); }
- /* Clear out mLSHE so that further anchor visits get - * recorded in SH and SH won't misbehave. + /* Restore the original LSHE if we were loading something + * while short-circuited load was initiated. */ - SetHistoryEntry(&mLSHE, nullptr); + SetHistoryEntry(&mLSHE, oldLSHE); /* Set the title for the SH entry for this target url. so that * SH menus in go/back/forward buttons won't be empty for this. */
tbb-commits@lists.torproject.org