mirror of
http://git.mos6581.com/ManchildProductions/Male-Poon.git
synced 2026-05-26 22:32:14 +00:00
Don't let other pages to load while doing scroll-to-anchor.
This commit is contained in:
@@ -1250,7 +1250,7 @@ nsDocShell::LoadURI(nsIURI * aURI,
|
||||
|
||||
// Note: we allow loads to get through here even if mFiredUnloadEvent is
|
||||
// true; that case will get handled in LoadInternal or LoadHistoryEntry.
|
||||
if (IsPrintingOrPP()) {
|
||||
if (IsPrintingOrPP() || mBlockNavigation) {
|
||||
return NS_OK; // JS may not handle returning of an error code
|
||||
}
|
||||
nsresult rv;
|
||||
@@ -3974,7 +3974,9 @@ nsDocShell::IsPrintingOrPP(bool aDisplayErrorDialog)
|
||||
bool
|
||||
nsDocShell::IsNavigationAllowed(bool aDisplayPrintErrorDialog)
|
||||
{
|
||||
return !IsPrintingOrPP(aDisplayPrintErrorDialog) && !mFiredUnloadEvent;
|
||||
return !IsPrintingOrPP(aDisplayPrintErrorDialog) &&
|
||||
!mFiredUnloadEvent &&
|
||||
!mBlockNavigation;
|
||||
}
|
||||
|
||||
//*****************************************************************************
|
||||
@@ -9008,13 +9010,18 @@ nsDocShell::InternalLoad(nsIURI * aURI,
|
||||
GetCurScrollPos(ScrollOrientation_X, &cx);
|
||||
GetCurScrollPos(ScrollOrientation_Y, &cy);
|
||||
|
||||
// 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);
|
||||
{
|
||||
AutoRestore<bool> scrollingToAnchor(mBlockNavigation);
|
||||
mBlockNavigation = true;
|
||||
|
||||
// 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
|
||||
|
||||
@@ -823,6 +823,7 @@ protected:
|
||||
bool mIsAppTab;
|
||||
bool mUseGlobalHistory;
|
||||
bool mInPrivateBrowsing;
|
||||
bool mBlockNavigation;
|
||||
|
||||
// This boolean is set to true right before we fire pagehide and generally
|
||||
// unset when we embed a new content viewer. While it's true no navigation
|
||||
|
||||
Reference in New Issue
Block a user