Bug 992324 patch 1 - Add a pref to disable interruptible reflow. r=bzbarsky

This commit is contained in:
L. David Baron 2014-04-09 21:47:58 -07:00
parent a33c62e8cd
commit 79c1dfbc4f
4 changed files with 16 additions and 1 deletions

View File

@ -118,6 +118,7 @@ typedef FrameMetrics::ViewID ViewID;
/* static */ bool nsLayoutUtils::sFontSizeInflationDisabledInMasterProcess;
/* static */ bool nsLayoutUtils::sInvalidationDebuggingIsEnabled;
/* static */ bool nsLayoutUtils::sCSSVariablesEnabled;
/* static */ bool nsLayoutUtils::sInterruptibleReflowEnabled;
static ViewID sScrollIdCounter = FrameMetrics::START_SCROLL_ID;
@ -5678,6 +5679,8 @@ nsLayoutUtils::Initialize()
"nglayout.debug.invalidation");
Preferences::AddBoolVarCache(&sCSSVariablesEnabled,
"layout.css.variables.enabled");
Preferences::AddBoolVarCache(&sInterruptibleReflowEnabled,
"layout.interruptible-reflow.enabled");
Preferences::RegisterCallback(GridEnabledPrefChangeCallback,
GRID_ENABLED_PREF_NAME);

View File

@ -1870,6 +1870,11 @@ public:
return sCSSVariablesEnabled;
}
static bool InterruptibleReflowEnabled()
{
return sInterruptibleReflowEnabled;
}
/**
* Unions the overflow areas of all non-popup children of aFrame with
* aOverflowAreas.
@ -2121,6 +2126,7 @@ private:
static bool sFontSizeInflationDisabledInMasterProcess;
static bool sInvalidationDebuggingIsEnabled;
static bool sCSSVariablesEnabled;
static bool sInterruptibleReflowEnabled;
};
template<typename PointType, typename RectType, typename CoordType>

View File

@ -2578,7 +2578,8 @@ nsPresContext::ReflowStarted(bool aInterruptible)
#endif
// We don't support interrupting in paginated contexts, since page
// sequences only handle initial reflow
mInterruptsEnabled = aInterruptible && !IsPaginated();
mInterruptsEnabled = aInterruptible && !IsPaginated() &&
nsLayoutUtils::InterruptibleReflowEnabled();
// Don't set mHasPendingInterrupt based on HavePendingInputEvent() here. If
// we ever change that, then we need to update the code in

View File

@ -1904,6 +1904,11 @@ pref("layout.scrollbar.side", 0);
// pref to stop overlay scrollbars from fading out, for testing purposes
pref("layout.testing.overlay-scrollbars.always-visible", false);
// Enable/disable interruptible reflow, which allows reflows to stop
// before completion (and display the partial results) when user events
// are pending.
pref("layout.interruptible-reflow.enabled", true);
// pref to control browser frame rate, in Hz. A value <= 0 means choose
// automatically based on knowledge of the platform (or 60Hz if no platform-
// specific information is available).