Bug 1560837 - Make APZ static prefs follow the naming convention. r=froydnj

Differential Revision: https://phabricator.services.mozilla.com/D35633

--HG--
extra : rebase_source : e71193756486b148d479e90b324f73dc35756429
This commit is contained in:
Nicholas Nethercote 2019-06-24 13:57:06 +10:00
parent 785bee02e8
commit 9f0b35cc2a
34 changed files with 266 additions and 247 deletions

View File

@ -272,7 +272,7 @@ APZCTreeManager::APZCTreeManager(LayersId aRootLayersId)
"layers::APZCTreeManager::APZCTreeManager",
[self] { self->mFlushObserver = new CheckerboardFlushObserver(self); }));
AsyncPanZoomController::InitializeGlobalState();
mApzcTreeLog.ConditionOnPrefFunction(StaticPrefs::APZPrintTree);
mApzcTreeLog.ConditionOnPrefFunction(StaticPrefs::apz_printtree);
#if defined(MOZ_WIDGET_ANDROID)
if (jni::IsFennec()) {
mToolbarAnimator = new AndroidDynamicToolbarAnimator(this);
@ -606,7 +606,7 @@ void APZCTreeManager::UpdateFocusState(LayersId aRootLayerTreeId,
const FocusTarget& aFocusTarget) {
AssertOnUpdaterThread();
if (!StaticPrefs::APZKeyboardEnabled()) {
if (!StaticPrefs::apz_keyboard_enabled()) {
return;
}
@ -1319,7 +1319,7 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent(
}
TargetConfirmationFlags confFlags{hitResult};
bool apzDragEnabled = StaticPrefs::APZDragEnabled();
bool apzDragEnabled = StaticPrefs::apz_drag_enabled();
if (apzDragEnabled && hitScrollbar) {
// If scrollbar dragging is enabled and we hit a scrollbar, wait
// for the main-thread confirmation because it contains drag metrics
@ -1544,8 +1544,8 @@ nsEventStatus APZCTreeManager::ReceiveInputEvent(
case KEYBOARD_INPUT: {
// Disable async keyboard scrolling when accessibility.browsewithcaret is
// enabled
if (!StaticPrefs::APZKeyboardEnabled() ||
StaticPrefs::AccessibilityBrowseWithCaret()) {
if (!StaticPrefs::apz_keyboard_enabled() ||
StaticPrefs::accessibility_browsewithcaret()) {
APZ_KEY_LOG("Skipping key input from invalid prefs\n");
return result;
}
@ -1741,8 +1741,9 @@ nsEventStatus APZCTreeManager::ProcessTouchInput(
// checked are similar to the ones we check for MOUSE_INPUT starting
// a scrollbar mouse-drag.
mInScrollbarTouchDrag =
StaticPrefs::APZDragEnabled() && StaticPrefs::APZTouchDragEnabled() &&
hitScrollbarNode && hitScrollbarNode->IsScrollThumbNode() &&
StaticPrefs::apz_drag_enabled() &&
StaticPrefs::apz_touch_drag_enabled() && hitScrollbarNode &&
hitScrollbarNode->IsScrollThumbNode() &&
hitScrollbarNode->GetScrollbarData().mThumbIsAsyncDraggable;
MOZ_ASSERT(touchBehaviors.Length() == aInput.mTouches.Length());
@ -1924,7 +1925,7 @@ void APZCTreeManager::SetupScrollbarDrag(
// Under some conditions, we can confirm the drag block right away.
// Otherwise, we have to wait for a main-thread confirmation.
if (StaticPrefs::APZDragInitiationEnabled() &&
if (StaticPrefs::apz_drag_initial_enabled() &&
// check that the scrollbar's target scroll frame is layerized
aScrollThumbNode->GetScrollTargetId() == aApzc->GetGuid().mScrollId &&
!aApzc->IsScrollInfoLayer()) {
@ -2388,7 +2389,7 @@ ParentLayerPoint APZCTreeManager::DispatchFling(
AsyncPanZoomController* aPrev, const FlingHandoffState& aHandoffState) {
// If immediate handoff is disallowed, do not allow handoff beyond the
// single APZC that's scrolled by the input block that triggered this fling.
if (aHandoffState.mIsHandoff && !StaticPrefs::APZAllowImmediateHandoff() &&
if (aHandoffState.mIsHandoff && !StaticPrefs::apz_allow_immediate_handoff() &&
aHandoffState.mScrolledApzc == aPrev) {
FLING_LOG("APZCTM dropping handoff due to disallowed immediate handoff\n");
return aHandoffState.mVelocity;

View File

@ -65,7 +65,7 @@ nsEventStatus APZInputBridge::ReceiveInputEvent(
// hit testing in a zoomed-in or zoomed-out state.
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (StaticPrefs::APZAllowZooming()) {
if (StaticPrefs::apz_allow_zooming()) {
mouseEvent.mIgnoreRootScrollFrame = true;
}

View File

@ -55,7 +55,7 @@ AndroidSpecificState::AndroidSpecificState() {
AsyncPanZoomAnimation* AndroidSpecificState::CreateFlingAnimation(
AsyncPanZoomController& aApzc, const FlingHandoffState& aHandoffState,
float aPLPPI) {
if (StaticPrefs::APZUseChromeFlingPhysics()) {
if (StaticPrefs::apz_android_chrome_fling_physics_enabled()) {
return new GenericFlingAnimation<AndroidFlingPhysics>(
aApzc, aHandoffState.mChain, aHandoffState.mIsHandoff,
aHandoffState.mScrolledApzc, aPLPPI);
@ -68,7 +68,7 @@ AsyncPanZoomAnimation* AndroidSpecificState::CreateFlingAnimation(
UniquePtr<VelocityTracker> AndroidSpecificState::CreateVelocityTracker(
Axis* aAxis) {
if (StaticPrefs::APZUseChromeFlingPhysics()) {
if (StaticPrefs::apz_android_chrome_fling_physics_enabled()) {
return MakeUnique<AndroidVelocityTracker>();
}
return MakeUnique<SimpleVelocityTracker>(aAxis);
@ -76,8 +76,9 @@ UniquePtr<VelocityTracker> AndroidSpecificState::CreateVelocityTracker(
/* static */
void AndroidSpecificState::InitializeGlobalState() {
// Not conditioned on StaticPrefs::APZUseChromeFlingPhysics() because
// the pref is live.
// Not conditioned on
// StaticPrefs::apz_android_chrome_fling_physics_enabled() because the pref
// is live.
AndroidFlingPhysics::InitializeGlobalState();
}
@ -167,8 +168,9 @@ StackScrollerFlingAnimation::StackScrollerFlingAnimation(
// flywheel to kick in, then we need to update the timestamp on the
// StackScroller because otherwise it might use a stale velocity.
TimeDuration flingDuration = TimeStamp::Now() - state->mLastFling;
if (flingDuration.ToMilliseconds() < StaticPrefs::APZFlingAccelInterval() &&
velocity.Length() >= StaticPrefs::APZFlingAccelMinVelocity()) {
if (flingDuration.ToMilliseconds() <
StaticPrefs::apz_fling_accel_interval_ms() &&
velocity.Length() >= StaticPrefs::apz_fling_accel_interval_ms()) {
bool unused = false;
mOverScroller->ComputeScrollOffset(flingDuration.ToMilliseconds(),
&unused);
@ -242,9 +244,9 @@ bool StackScrollerFlingAnimation::DoSample(FrameMetrics& aFrameMetrics,
float speed = velocity.Length();
// StaticPrefs::APZFlingStoppedThreshold is only used in tests.
// StaticPrefs::apz_fling_stopped_threshold is only used in tests.
if (!shouldContinueFling ||
(speed < StaticPrefs::APZFlingStoppedThreshold())) {
(speed < StaticPrefs::apz_fling_stopped_threshold())) {
if (shouldContinueFling) {
// The OverScroller thinks it should continue but the speed is below
// the stopping threshold so abort the animation.

View File

@ -33,7 +33,7 @@ const float kDecelerationRate = 2.3582018f;
// Default friction constant in android.view.ViewConfiguration.
static float GetFlingFriction() {
return StaticPrefs::APZChromeFlingPhysicsFriction();
return StaticPrefs::apz_android_chrome_fling_physics_friction();
}
// Tension lines cross at (GetInflexion(), 1).
@ -41,7 +41,8 @@ static float GetInflexion() {
// Clamp the inflexion to the range [0,1]. Values outside of this range
// do not make sense in the physics model, and for negative values the
// approximation used to compute the spline curve does not converge.
const float inflexion = StaticPrefs::APZChromeFlingPhysicsInflexion();
const float inflexion =
StaticPrefs::apz_android_chrome_fling_physics_inflexion();
if (inflexion < 0.0f) {
return 0.0f;
}
@ -54,7 +55,7 @@ static float GetInflexion() {
// Fling scroll is stopped when the scroll position is |kThresholdForFlingEnd|
// pixels or closer from the end.
static float GetThresholdForFlingEnd() {
return StaticPrefs::APZChromeFlingPhysicsStopThreshold();
return StaticPrefs::apz_android_chrome_fling_physics_stop_threshold();
}
static double ComputeSplineDeceleration(ParentLayerCoord aVelocity,

View File

@ -251,7 +251,7 @@ Maybe<float> AndroidVelocityTracker::ComputeVelocity(uint32_t aTimestampMs) {
float time[kHistorySize];
uint32_t m = 0;
int index = mHistory.Length() - 1;
const uint32_t horizon = StaticPrefs::APZVelocityRelevanceTime();
const uint32_t horizon = StaticPrefs::apz_velocity_relevance_time_ms();
const auto& newest_movement = mHistory[index];
do {

View File

@ -615,7 +615,7 @@ class ZoomAnimation : public AsyncPanZoomAnimation {
const CSSToParentLayerScale2D& aEndZoom)
: mApzc(aApzc),
mTotalDuration(TimeDuration::FromMilliseconds(
StaticPrefs::APZZoomAnimationDuration())),
StaticPrefs::apz_zoom_animation_duration_ms())),
mStartOffset(aStartOffset),
mStartZoom(aStartZoom),
mEndOffset(aEndOffset),
@ -815,9 +815,11 @@ void AsyncPanZoomController::InitializeGlobalState() {
gZoomAnimationFunction =
new ComputedTimingFunction(nsTimingFunction(StyleTimingKeyword::Ease));
ClearOnShutdown(&gZoomAnimationFunction);
gVelocityCurveFunction = new ComputedTimingFunction(nsTimingFunction(
StaticPrefs::APZCurveFunctionX1(), StaticPrefs::APZCurveFunctionY1(),
StaticPrefs::APZCurveFunctionX2(), StaticPrefs::APZCurveFunctionY2()));
gVelocityCurveFunction = new ComputedTimingFunction(
nsTimingFunction(StaticPrefs::apz_fling_curve_function_x1(),
StaticPrefs::apz_fling_curve_function_y1(),
StaticPrefs::apz_fling_curve_function_x2(),
StaticPrefs::apz_fling_curve_function_y2()));
ClearOnShutdown(&gVelocityCurveFunction);
uint64_t sysmem = PR_GetPhysicalMemorySize();
@ -845,7 +847,7 @@ AsyncPanZoomController::AsyncPanZoomController(
mPanDirRestricted(false),
mPinchLocked(false),
mPinchEventBuffer(TimeDuration::FromMilliseconds(
StaticPrefs::APZPinchLockBufferMaxAge())),
StaticPrefs::apz_pinch_lock_buffer_max_age())),
mZoomConstraints(false, false,
mScrollMetadata.GetMetrics().GetDevPixelsPerCSSPixel() *
kViewportMinScale / ParentLayerToScreenScale(1),
@ -938,25 +940,25 @@ float AsyncPanZoomController::GetDPI() const {
}
ScreenCoord AsyncPanZoomController::GetTouchStartTolerance() const {
return (StaticPrefs::APZTouchStartTolerance() * GetDPI());
return (StaticPrefs::apz_touch_start_tolerance() * GetDPI());
}
ScreenCoord AsyncPanZoomController::GetTouchMoveTolerance() const {
return (StaticPrefs::APZTouchMoveTolerance() * GetDPI());
return (StaticPrefs::apz_touch_move_tolerance() * GetDPI());
}
ScreenCoord AsyncPanZoomController::GetSecondTapTolerance() const {
return (StaticPrefs::APZSecondTapTolerance() * GetDPI());
return (StaticPrefs::apz_second_tap_tolerance() * GetDPI());
}
/* static */ AsyncPanZoomController::AxisLockMode
AsyncPanZoomController::GetAxisLockMode() {
return static_cast<AxisLockMode>(StaticPrefs::APZAxisLockMode());
return static_cast<AxisLockMode>(StaticPrefs::apz_axis_lock_mode());
}
/* static */ AsyncPanZoomController::PinchLockMode
AsyncPanZoomController::GetPinchLockMode() {
return static_cast<PinchLockMode>(StaticPrefs::APZPinchLockMode());
return static_cast<PinchLockMode>(StaticPrefs::apz_pinch_lock_mode());
}
bool AsyncPanZoomController::ArePointerEventsConsumable(
@ -1012,7 +1014,7 @@ bool AsyncPanZoomController::ArePointerEventsConsumable(
nsEventStatus AsyncPanZoomController::HandleDragEvent(
const MouseInput& aEvent, const AsyncDragMetrics& aDragMetrics,
CSSCoord aInitialThumbPos) {
if (!StaticPrefs::APZDragEnabled()) {
if (!StaticPrefs::apz_drag_enabled()) {
return nsEventStatus_eIgnore;
}
@ -1566,7 +1568,7 @@ nsEventStatus AsyncPanZoomController::OnScaleBegin(
// content controller, it may want to do something else with this gesture.
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (!StaticPrefs::APZAllowZooming()) {
if (!StaticPrefs::apz_allow_zooming()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyPinchGesture(aEvent.mType, GetGuid(), 0,
@ -1613,7 +1615,7 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (!StaticPrefs::APZAllowZooming()) {
if (!StaticPrefs::apz_allow_zooming()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyPinchGesture(
@ -1703,7 +1705,7 @@ nsEventStatus AsyncPanZoomController::OnScale(const PinchGestureInput& aEvent) {
// We don't want to redraw on every scale, so throttle it.
if (!mPinchPaintTimerSet) {
const int delay = StaticPrefs::APZScaleRepaintDelay();
const int delay = StaticPrefs::apz_scale_repaint_delay_ms();
if (delay >= 0) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
@ -1747,7 +1749,7 @@ nsEventStatus AsyncPanZoomController::OnScaleEnd(
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
if (!StaticPrefs::APZAllowZooming()) {
if (!StaticPrefs::apz_allow_zooming()) {
if (RefPtr<GeckoContentController> controller =
GetGeckoContentController()) {
controller->NotifyPinchGesture(aEvent.mType, GetGuid(), 0,
@ -1840,9 +1842,10 @@ nsEventStatus AsyncPanZoomController::HandleEndOfPan() {
APZC_LOG("%p starting a fling animation if %f >= %f\n", this,
flingVelocity.Length().value,
StaticPrefs::APZFlingMinVelocityThreshold());
StaticPrefs::apz_fling_min_velocity_threshold());
if (flingVelocity.Length() < StaticPrefs::APZFlingMinVelocityThreshold()) {
if (flingVelocity.Length() <
StaticPrefs::apz_fling_min_velocity_threshold()) {
// Relieve overscroll now if needed, since we will not transition to a fling
// animation and then an overscroll animation, and relieve it then.
GetCurrentInputBlock()
@ -2254,7 +2257,7 @@ bool AsyncPanZoomController::IsContentOfHonouredTargetRightToLeft(
bool AsyncPanZoomController::AllowScrollHandoffInCurrentBlock() const {
bool result = mInputQueue->AllowScrollHandoff();
if (!StaticPrefs::APZAllowImmediateHandoff()) {
if (!StaticPrefs::apz_allow_immediate_handoff()) {
if (InputBlockState* currentBlock = GetCurrentInputBlock()) {
// Do not allow handoff beyond the first APZC to scroll.
if (currentBlock->GetScrolledApzc() == this) {
@ -2930,11 +2933,12 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
this, ScrollDirection::eVertical);
if (GetCurrentTouchBlock()->TouchActionAllowsPanningXY()) {
if (canScrollHorizontal && canScrollVertical) {
if (apz::IsCloseToHorizontal(aAngle, StaticPrefs::APZAxisLockAngle())) {
if (apz::IsCloseToHorizontal(aAngle,
StaticPrefs::apz_axis_lock_lock_angle())) {
mY.SetAxisLocked(true);
SetState(PANNING_LOCKED_X);
} else if (apz::IsCloseToVertical(aAngle,
StaticPrefs::APZAxisLockAngle())) {
} else if (apz::IsCloseToVertical(
aAngle, StaticPrefs::apz_axis_lock_lock_angle())) {
mX.SetAxisLocked(true);
SetState(PANNING_LOCKED_Y);
} else {
@ -2948,8 +2952,8 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
} else if (GetCurrentTouchBlock()->TouchActionAllowsPanningX()) {
// Using bigger angle for panning to keep behavior consistent
// with IE.
if (apz::IsCloseToHorizontal(aAngle,
StaticPrefs::APZAllowedDirectPanAngle())) {
if (apz::IsCloseToHorizontal(
aAngle, StaticPrefs::apz_axis_lock_direct_pan_angle())) {
mY.SetAxisLocked(true);
SetState(PANNING_LOCKED_X);
mPanDirRestricted = true;
@ -2960,7 +2964,7 @@ void AsyncPanZoomController::HandlePanningWithTouchAction(double aAngle) {
}
} else if (GetCurrentTouchBlock()->TouchActionAllowsPanningY()) {
if (apz::IsCloseToVertical(aAngle,
StaticPrefs::APZAllowedDirectPanAngle())) {
StaticPrefs::apz_axis_lock_direct_pan_angle())) {
mX.SetAxisLocked(true);
SetState(PANNING_LOCKED_Y);
mPanDirRestricted = true;
@ -2993,13 +2997,14 @@ void AsyncPanZoomController::HandlePanning(double aAngle) {
if (!canScrollHorizontal || !canScrollVertical) {
SetState(PANNING);
} else if (apz::IsCloseToHorizontal(aAngle,
StaticPrefs::APZAxisLockAngle())) {
} else if (apz::IsCloseToHorizontal(
aAngle, StaticPrefs::apz_axis_lock_lock_angle())) {
mY.SetAxisLocked(true);
if (canScrollHorizontal) {
SetState(PANNING_LOCKED_X);
}
} else if (apz::IsCloseToVertical(aAngle, StaticPrefs::APZAxisLockAngle())) {
} else if (apz::IsCloseToVertical(aAngle,
StaticPrefs::apz_axis_lock_lock_angle())) {
mX.SetAxisLocked(true);
if (canScrollVertical) {
SetState(PANNING_LOCKED_Y);
@ -3019,19 +3024,20 @@ void AsyncPanZoomController::HandlePanningUpdate(
double angle = atan2(vector.y, vector.x); // range [-pi, pi]
angle = fabs(angle); // range [0, pi]
float breakThreshold = StaticPrefs::APZAxisBreakoutThreshold() * GetDPI();
float breakThreshold =
StaticPrefs::apz_axis_lock_breakout_threshold() * GetDPI();
if (fabs(aPanDistance.x) > breakThreshold ||
fabs(aPanDistance.y) > breakThreshold) {
if (mState == PANNING_LOCKED_X) {
if (!apz::IsCloseToHorizontal(angle,
StaticPrefs::APZAxisBreakoutAngle())) {
if (!apz::IsCloseToHorizontal(
angle, StaticPrefs::apz_axis_lock_breakout_angle())) {
mY.SetAxisLocked(false);
SetState(PANNING);
}
} else if (mState == PANNING_LOCKED_Y) {
if (!apz::IsCloseToVertical(angle,
StaticPrefs::APZAxisBreakoutAngle())) {
if (!apz::IsCloseToVertical(
angle, StaticPrefs::apz_axis_lock_breakout_angle())) {
mX.SetAxisLocked(false);
SetState(PANNING);
}
@ -3075,15 +3081,15 @@ void AsyncPanZoomController::HandlePinchLocking() {
if (mPinchLocked) {
if (GetPinchLockMode() == PINCH_STICKY) {
ScreenCoord spanBreakoutThreshold =
StaticPrefs::APZPinchLockSpanBreakoutThreshold() * GetDPI();
StaticPrefs::apz_pinch_lock_span_breakout_threshold() * GetDPI();
mPinchLocked = !(spanDistance > spanBreakoutThreshold);
}
} else {
if (GetPinchLockMode() != PINCH_FREE) {
ScreenCoord spanLockThreshold =
StaticPrefs::APZPinchLockSpanLockThreshold() * GetDPI();
StaticPrefs::apz_pinch_lock_span_lock_threshold() * GetDPI();
ScreenCoord scrollLockThreshold =
StaticPrefs::APZPinchLockScrollLockThreshold() * GetDPI();
StaticPrefs::apz_pinch_lock_scroll_lock_threshold() * GetDPI();
if (spanDistance < spanLockThreshold &&
focusChange.Length() > scrollLockThreshold) {
@ -3257,11 +3263,11 @@ void AsyncPanZoomController::OverscrollForPanning(
// configurable factor. If we are already overscrolled, don't check this.
if (!IsOverscrolled()) {
if (aPanDistance.x <
StaticPrefs::APZMinPanDistanceRatio() * aPanDistance.y) {
StaticPrefs::apz_overscroll_min_pan_distance_ratio() * aPanDistance.y) {
aOverscroll.x = 0;
}
if (aPanDistance.y <
StaticPrefs::APZMinPanDistanceRatio() * aPanDistance.x) {
StaticPrefs::apz_overscroll_min_pan_distance_ratio() * aPanDistance.x) {
aOverscroll.y = 0;
}
}
@ -3270,7 +3276,7 @@ void AsyncPanZoomController::OverscrollForPanning(
}
void AsyncPanZoomController::OverscrollBy(ParentLayerPoint& aOverscroll) {
if (!StaticPrefs::APZOverscrollEnabled()) {
if (!StaticPrefs::apz_overscroll_enabled()) {
return;
}
@ -3337,7 +3343,7 @@ ParentLayerPoint AsyncPanZoomController::AttemptFling(
// that generate events faster than the clock resolution.
ParentLayerPoint velocity = GetVelocityVector();
if (!velocity.IsFinite() ||
velocity.Length() < StaticPrefs::APZFlingMinVelocityThreshold()) {
velocity.Length() < StaticPrefs::apz_fling_min_velocity_threshold()) {
// Relieve overscroll now if needed, since we will not transition to a fling
// animation and then an overscroll animation, and relieve it then.
aHandoffState.mChain->SnapBackOverscrolledApzc(this);
@ -3408,7 +3414,7 @@ void AsyncPanZoomController::HandleFlingOverscroll(
FLING_LOG("APZC %p left with residual velocity %s\n", this,
Stringify(residualVelocity).c_str());
if (!IsZero(residualVelocity) && IsPannable() &&
StaticPrefs::APZOverscrollEnabled()) {
StaticPrefs::apz_overscroll_enabled()) {
// Obey overscroll-behavior.
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (!mX.OverscrollBehaviorAllowsOverscrollEffect()) {
@ -3666,22 +3672,22 @@ void AsyncPanZoomController::ScaleWithFocus(float aScale,
static CSSSize CalculateDisplayPortSize(const CSSSize& aCompositionSize,
const CSSPoint& aVelocity) {
bool xIsStationarySpeed =
fabsf(aVelocity.x) < StaticPrefs::APZMinSkateSpeed();
fabsf(aVelocity.x) < StaticPrefs::apz_min_skate_speed();
bool yIsStationarySpeed =
fabsf(aVelocity.y) < StaticPrefs::APZMinSkateSpeed();
fabsf(aVelocity.y) < StaticPrefs::apz_min_skate_speed();
float xMultiplier = xIsStationarySpeed
? StaticPrefs::APZXStationarySizeMultiplier()
: StaticPrefs::APZXSkateSizeMultiplier();
? StaticPrefs::apz_x_stationary_size_multiplier()
: StaticPrefs::apz_x_skate_size_multiplier();
float yMultiplier = yIsStationarySpeed
? StaticPrefs::APZYStationarySizeMultiplier()
: StaticPrefs::APZYSkateSizeMultiplier();
? StaticPrefs::apz_y_stationary_size_multiplier()
: StaticPrefs::apz_y_skate_size_multiplier();
if (IsHighMemSystem() && !xIsStationarySpeed) {
xMultiplier += StaticPrefs::APZXSkateHighMemAdjust();
xMultiplier += StaticPrefs::apz_x_skate_highmem_adjust();
}
if (IsHighMemSystem() && !yIsStationarySpeed) {
yMultiplier += StaticPrefs::APZYSkateHighMemAdjust();
yMultiplier += StaticPrefs::apz_y_skate_highmem_adjust();
}
return aCompositionSize * CSSSize(xMultiplier, yMultiplier);
@ -3698,8 +3704,8 @@ static CSSSize ExpandDisplayPortToDangerZone(
CSSSize dangerZone(0.0f, 0.0f);
if (aFrameMetrics.LayersPixelsPerCSSPixel().xScale != 0 &&
aFrameMetrics.LayersPixelsPerCSSPixel().yScale != 0) {
dangerZone = LayerSize(StaticPrefs::APZDangerZoneX(),
StaticPrefs::APZDangerZoneY()) /
dangerZone = LayerSize(StaticPrefs::apz_danger_zone_x(),
StaticPrefs::apz_danger_zone_y()) /
aFrameMetrics.LayersPixelsPerCSSPixel();
}
const CSSSize compositionSize =
@ -3759,7 +3765,7 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
displayPortSize =
ExpandDisplayPortToDangerZone(displayPortSize, aFrameMetrics);
if (StaticPrefs::APZEnlargeDisplayPortWhenClipped()) {
if (StaticPrefs::apz_enlarge_displayport_when_clipped()) {
RedistributeDisplayPortExcess(displayPortSize, scrollableRect);
}
@ -3778,7 +3784,7 @@ const ScreenMargin AsyncPanZoomController::CalculatePendingDisplayPort(
// Offset the displayport, depending on how fast we're moving and the
// estimated time it takes to paint, to try to minimise checkerboarding.
float paintFactor = kDefaultEstimatedPaintDurationMs;
displayPort.MoveBy(velocity * paintFactor * StaticPrefs::APZVelocityBias());
displayPort.MoveBy(velocity * paintFactor * StaticPrefs::apz_velocity_bias());
APZC_LOG_FM(
aFrameMetrics,
@ -3843,7 +3849,7 @@ bool AsyncPanZoomController::SnapBackIfOverscrolled() {
bool AsyncPanZoomController::IsFlingingFast() const {
RecursiveMutexAutoLock lock(mRecursiveMutex);
if (mState == FLING && GetVelocityVector().Length() >
StaticPrefs::APZFlingStopOnTapThreshold()) {
StaticPrefs::apz_fling_stop_on_tap_threshold()) {
APZC_LOG("%p is moving fast\n", this);
return true;
}
@ -4206,7 +4212,7 @@ AsyncPanZoomController::GetCurrentAsyncTransformForFixedAdjustment(
// with apz.allow_zooming enabled).
// FIXME: bug 1525793 -- this may need to handle zooming or not on a
// per-document basis.
return (StaticPrefs::APZAllowZooming() && Metrics().IsRootContent() &&
return (StaticPrefs::apz_allow_zooming() && Metrics().IsRootContent() &&
Metrics().GetVisualViewport().Size() <=
Metrics().GetLayoutViewport().Size())
? GetCurrentAsyncViewportTransform(aMode)
@ -4234,7 +4240,7 @@ LayoutDeviceToParentLayerScale AsyncPanZoomController::GetCurrentPinchZoomScale(
CSSRect AsyncPanZoomController::GetEffectiveLayoutViewport(
AsyncTransformConsumer aMode) const {
if (StaticPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
if (StaticPrefs::apz_frame_delay_enabled() && aMode == eForCompositing) {
return mCompositedLayoutViewport;
}
return Metrics().GetLayoutViewport();
@ -4242,7 +4248,7 @@ CSSRect AsyncPanZoomController::GetEffectiveLayoutViewport(
CSSPoint AsyncPanZoomController::GetEffectiveScrollOffset(
AsyncTransformConsumer aMode) const {
if (StaticPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
if (StaticPrefs::apz_frame_delay_enabled() && aMode == eForCompositing) {
return mCompositedScrollOffset;
}
return Metrics().GetScrollOffset();
@ -4250,7 +4256,7 @@ CSSPoint AsyncPanZoomController::GetEffectiveScrollOffset(
CSSToParentLayerScale2D AsyncPanZoomController::GetEffectiveZoom(
AsyncTransformConsumer aMode) const {
if (StaticPrefs::APZFrameDelayEnabled() && aMode == eForCompositing) {
if (StaticPrefs::apz_frame_delay_enabled() && aMode == eForCompositing) {
return mCompositedZoom;
}
return Metrics().GetZoom();
@ -4346,7 +4352,7 @@ void AsyncPanZoomController::ReportCheckerboard(const TimeStamp& aSampleTime) {
}
mLastCheckerboardReport = aSampleTime;
bool recordTrace = StaticPrefs::APZRecordCheckerboarding();
bool recordTrace = StaticPrefs::apz_record_checkerboarding();
bool forTelemetry = Telemetry::CanRecordExtended();
uint32_t magnitude = GetCheckerboardMagnitude();
@ -4375,7 +4381,7 @@ void AsyncPanZoomController::UpdateCheckerboardEvent(
mPotentialCheckerboardTracker.CheckerboardDone();
if (StaticPrefs::APZRecordCheckerboarding()) {
if (StaticPrefs::apz_record_checkerboarding()) {
// if the pref is enabled, also send it to the storage class. it may be
// chosen for public display on about:checkerboard, the hall of fame for
// checkerboard events.
@ -4685,7 +4691,8 @@ void AsyncPanZoomController::NotifyLayersUpdated(
// this we need to update mExpectedGeckoMetrics to be the last thing we
// know was painted by Gecko.
Maybe<CSSPoint> relativeDelta;
if (StaticPrefs::APZRelativeUpdate() && aLayerMetrics.IsRelative()) {
if (StaticPrefs::apz_relative_update_enabled() &&
aLayerMetrics.IsRelative()) {
APZC_LOG("%p relative updating scroll offset from %s by %s\n", this,
ToString(Metrics().GetScrollOffset()).c_str(),
ToString(aLayerMetrics.GetScrollOffset() -
@ -4760,7 +4767,8 @@ void AsyncPanZoomController::NotifyLayersUpdated(
// See comment on the similar code in the |if (scrollOffsetUpdated)| block
// above.
if (StaticPrefs::APZRelativeUpdate() && aLayerMetrics.IsRelative()) {
if (StaticPrefs::apz_relative_update_enabled() &&
aLayerMetrics.IsRelative()) {
Metrics().ApplyRelativeSmoothScrollUpdateFrom(aLayerMetrics);
} else {
Metrics().ApplySmoothScrollUpdateFrom(aLayerMetrics);
@ -5297,7 +5305,7 @@ void AsyncPanZoomController::ScrollSnap() {
void AsyncPanZoomController::ScrollSnapToDestination() {
RecursiveMutexAutoLock lock(mRecursiveMutex);
float friction = StaticPrefs::APZFlingFriction();
float friction = StaticPrefs::apz_fling_friction();
ParentLayerPoint velocity(mX.GetVelocity(), mY.GetVelocity());
ParentLayerPoint predictedDelta;
// "-velocity / log(1.0 - friction)" is the integral of the deceleration

View File

@ -1162,9 +1162,9 @@ class AsyncPanZoomController {
* Returns true if the newly sampled value is different from the previously
* sampled value.
*
* (This is only relevant when |StaticPrefs::APZFrameDelayEnabled() == true|.
* Otherwise, GetCurrentAsyncTransform() always reflects what's stored in
* |Metrics()| immediately, without any delay.)
* (This is only relevant when StaticPrefs::apz_frame_delay_enabled() is
* true. Otherwise, GetCurrentAsyncTransform() always reflects what's stored
* in |Metrics()| immediately, without any delay.)
*/
bool SampleCompositedAsyncTransform();

View File

@ -25,8 +25,8 @@ class DesktopFlingPhysics {
}
void Sample(const TimeDuration& aDelta, ParentLayerPoint* aOutVelocity,
ParentLayerPoint* aOutOffset) {
float friction = StaticPrefs::APZFlingFriction();
float threshold = StaticPrefs::APZFlingStoppedThreshold();
float friction = StaticPrefs::apz_fling_friction();
float threshold = StaticPrefs::apz_fling_stopped_threshold();
mVelocity = ParentLayerPoint(
ApplyFrictionOrCancel(mVelocity.x, aDelta, friction, threshold),

View File

@ -138,7 +138,7 @@ FocusTarget::FocusTarget(PresShell* aRootPresShell,
// Check if there are key event listeners that could prevent default or change
// the focus or selection of the page.
if (StaticPrefs::APZKeyboardPassiveListeners()) {
if (StaticPrefs::apz_keyboard_passive_listeners()) {
mFocusHasKeyEventListeners =
HasListenersForNonPassiveKeyEvents(keyEventTarget.get());
} else {

View File

@ -94,8 +94,8 @@ class GenericFlingAnimation : public AsyncPanZoomAnimation,
bool applyAcceleration = !aFlingIsHandedOff;
if (applyAcceleration && !mApzc.mLastFlingTime.IsNull() &&
(now - mApzc.mLastFlingTime).ToMilliseconds() <
StaticPrefs::APZFlingAccelInterval() &&
velocity.Length() >= StaticPrefs::APZFlingAccelMinVelocity()) {
StaticPrefs::apz_fling_accel_interval_ms() &&
velocity.Length() >= StaticPrefs::apz_fling_accel_min_velocity()) {
if (velocity.x != 0 &&
SameDirection(velocity.x, mApzc.mLastFlingVelocity.x)) {
velocity.x = Accelerate(velocity.x, mApzc.mLastFlingVelocity.x);
@ -220,8 +220,8 @@ class GenericFlingAnimation : public AsyncPanZoomAnimation,
}
static float Accelerate(float aBase, float aSupplemental) {
return (aBase * StaticPrefs::APZFlingAccelBaseMultiplier()) +
(aSupplemental * StaticPrefs::APZFlingAccelSupplementalMultiplier());
return (aBase * StaticPrefs::apz_fling_accel_base_mult()) +
(aSupplemental * StaticPrefs::apz_fling_accel_supplemental_mult());
}
AsyncPanZoomController& mApzc;

View File

@ -291,13 +291,13 @@ nsEventStatus GestureEventListener::HandleInputTouchMove() {
// The user has performed a double tap, but not lifted her finger.
case GESTURE_SECOND_SINGLE_TOUCH_DOWN: {
// If touch has moved noticeably (within StaticPrefs::APZMaxTapTime()),
// If touch has moved noticeably (within StaticPrefs::apz_max_tap_time()),
// change state.
if (MoveDistanceIsLarge()) {
CancelLongTapTimeoutTask();
CancelMaxTapTimeoutTask();
mSingleTapSent = Nothing();
if (!StaticPrefs::APZOneTouchPinchEnabled()) {
if (!StaticPrefs::apz_one_touch_pinch_enabled()) {
// If the one-touch-pinch feature is disabled, bail out of the double-
// tap gesture instead.
SetState(GESTURE_NONE);
@ -629,7 +629,7 @@ void GestureEventListener::CreateMaxTapTimeoutTask() {
mMaxTapTimeoutTask = task;
mAsyncPanZoomController->PostDelayedTask(task.forget(),
StaticPrefs::APZMaxTapTime());
StaticPrefs::apz_max_tap_time());
}
} // namespace layers

View File

@ -150,7 +150,7 @@ bool InputBlockState::IsDownchainOf(AsyncPanZoomController* aA,
void InputBlockState::SetScrolledApzc(AsyncPanZoomController* aApzc) {
// An input block should only have one scrolled APZC.
MOZ_ASSERT(!mScrolledApzc || (StaticPrefs::APZAllowImmediateHandoff()
MOZ_ASSERT(!mScrolledApzc || (StaticPrefs::apz_allow_immediate_handoff()
? IsDownchainOf(mScrolledApzc, aApzc)
: mScrolledApzc == aApzc));
@ -783,8 +783,8 @@ Maybe<ScrollDirection> TouchBlockState::GetBestGuessPanDirection(
angle = fabs(angle); // range [0, pi]
double angleThreshold = TouchActionAllowsPanningXY()
? StaticPrefs::APZAxisLockAngle()
: StaticPrefs::APZAllowedDirectPanAngle();
? StaticPrefs::apz_axis_lock_lock_angle()
: StaticPrefs::apz_axis_lock_direct_pan_angle();
if (apz::IsCloseToHorizontal(angle, angleThreshold)) {
return Some(ScrollDirection::eHorizontal);
}

View File

@ -108,7 +108,7 @@ class InputBlockState : public RefCounted<InputBlockState> {
// The APZC that was actually scrolled by events in this input block.
// This is used in configurations where a single input block is only
// allowed to scroll a single APZC (configurations where
// StaticPrefs::APZAllowImmediateHandoff() is false). Set the first time an
// StaticPrefs::apz_allow_immediate_handoff() is false). Set the first time an
// input event in this block scrolls an APZC.
RefPtr<AsyncPanZoomController> mScrolledApzc;

View File

@ -319,7 +319,7 @@ nsEventStatus InputQueue::ReceiveKeyboardInput(
// If APZ is allowing passive listeners then we must dispatch the event to
// content, otherwise we can consume the event.
return StaticPrefs::APZKeyboardPassiveListeners()
return StaticPrefs::apz_keyboard_passive_listeners()
? nsEventStatus_eConsumeDoDefault
: nsEventStatus_eConsumeNoDefault;
}
@ -552,7 +552,7 @@ void InputQueue::ScheduleMainThreadTimeout(
RefPtr<Runnable> timeoutTask = NewRunnableMethod<uint64_t>(
"layers::InputQueue::MainThreadTimeout", this,
&InputQueue::MainThreadTimeout, aBlock->GetBlockId());
int32_t timeout = StaticPrefs::APZContentResponseTimeout();
int32_t timeout = StaticPrefs::apz_content_response_timeout();
if (timeout == 0) {
// If the timeout is zero, treat it as a request to ignore any main
// thread confirmation and unconditionally use fallback behaviour for

View File

@ -86,7 +86,7 @@ Maybe<float> SimpleVelocityTracker::ComputeVelocity(uint32_t aTimestampMs) {
int count = 0;
for (const auto& e : mVelocityQueue) {
uint32_t timeDelta = (aTimestampMs - e.first);
if (timeDelta < StaticPrefs::APZVelocityRelevanceTime()) {
if (timeDelta < StaticPrefs::apz_velocity_relevance_time_ms()) {
count++;
velocity += e.second;
}
@ -103,24 +103,26 @@ void SimpleVelocityTracker::Clear() { mVelocityQueue.Clear(); }
void SimpleVelocityTracker::AddVelocityToQueue(uint32_t aTimestampMs,
float aVelocity) {
mVelocityQueue.AppendElement(std::make_pair(aTimestampMs, aVelocity));
if (mVelocityQueue.Length() > StaticPrefs::APZMaxVelocityQueueSize()) {
if (mVelocityQueue.Length() > StaticPrefs::apz_max_velocity_queue_size()) {
mVelocityQueue.RemoveElementAt(0);
}
}
float SimpleVelocityTracker::ApplyFlingCurveToVelocity(float aVelocity) const {
float newVelocity = aVelocity;
if (StaticPrefs::APZMaxVelocity() > 0.0f) {
if (StaticPrefs::apz_max_velocity_inches_per_ms() > 0.0f) {
bool velocityIsNegative = (newVelocity < 0);
newVelocity = fabs(newVelocity);
float maxVelocity = mAxis->ToLocalVelocity(StaticPrefs::APZMaxVelocity());
float maxVelocity =
mAxis->ToLocalVelocity(StaticPrefs::apz_max_velocity_inches_per_ms());
newVelocity = std::min(newVelocity, maxVelocity);
if (StaticPrefs::APZCurveThreshold() > 0.0f &&
StaticPrefs::APZCurveThreshold() < StaticPrefs::APZMaxVelocity()) {
float curveThreshold =
mAxis->ToLocalVelocity(StaticPrefs::APZCurveThreshold());
if (StaticPrefs::apz_fling_curve_threshold_inches_per_ms() > 0.0f &&
StaticPrefs::apz_fling_curve_threshold_inches_per_ms() <
StaticPrefs::apz_max_velocity_inches_per_ms()) {
float curveThreshold = mAxis->ToLocalVelocity(
StaticPrefs::apz_fling_curve_threshold_inches_per_ms());
if (newVelocity > curveThreshold) {
// here, 0 < curveThreshold < newVelocity <= maxVelocity, so we apply
// the curve

View File

@ -161,7 +161,8 @@ class APZCPinchLockingTester : public APZCPinchTester {
void twoFingerPan() {
ScreenCoord panDistance =
StaticPrefs::APZPinchLockScrollLockThreshold() * 1.2 * tm->GetDPI();
StaticPrefs::apz_pinch_lock_scroll_lock_threshold() * 1.2 *
tm->GetDPI();
mFocus = ScreenIntPoint((int)(mFocus.x + panDistance), (int)(mFocus.y));
@ -174,7 +175,8 @@ class APZCPinchLockingTester : public APZCPinchTester {
void twoFingerZoom() {
float pinchDistance =
StaticPrefs::APZPinchLockSpanBreakoutThreshold() * 1.2 * tm->GetDPI();
StaticPrefs::apz_pinch_lock_span_breakout_threshold() * 1.2 *
tm->GetDPI();
float newSpan = mSpan + pinchDistance;
@ -191,7 +193,8 @@ class APZCPinchLockingTester : public APZCPinchTester {
// Send a small scale input to the APZC
float pinchDistance =
StaticPrefs::APZPinchLockSpanBreakoutThreshold() * 0.8 * tm->GetDPI();
StaticPrefs::apz_pinch_lock_span_breakout_threshold() * 0.8 *
tm->GetDPI();
apzc->ReceiveInputEvent(
CreatePinchGestureInput(PinchGestureInput::PINCHGESTURE_SCALE, mFocus,
mSpan + pinchDistance, mSpan, mcc->Time()),
@ -252,7 +255,7 @@ TEST_F(APZCPinchGestureDetectorTester,
// Since we are preventing the pinch action via touch-action we should not be
// sending the pinch gesture notifications that would normally be sent when
// APZAllowZooming is false.
// apz_allow_zooming is false.
EXPECT_CALL(*mcc, NotifyPinchGesture(_, _, _, _)).Times(0);
nsTArray<uint32_t> behaviors = {mozilla::layers::AllowedTouchBehavior::NONE,
mozilla::layers::AllowedTouchBehavior::NONE};
@ -267,7 +270,7 @@ TEST_F(APZCPinchGestureDetectorTester, Pinch_PreventDefault_NoAPZZoom) {
SCOPED_GFX_PREF_BOOL("apz.allow_zooming", false);
// Since we are preventing the pinch action we should not be sending the pinch
// gesture notifications that would normally be sent when APZAllowZooming is
// gesture notifications that would normally be sent when apz_allow_zooming is
// false.
EXPECT_CALL(*mcc, NotifyPinchGesture(_, _, _, _)).Times(0);
@ -435,11 +438,11 @@ TEST_F(APZCPinchGestureDetectorTester, Pinch_APZZoom_Disabled) {
FrameMetrics originalMetrics = GetPinchableFrameMetrics();
apzc->SetFrameMetrics(originalMetrics);
// When APZAllowZooming is false, the ZoomConstraintsClient produces
// When apz_allow_zooming is false, the ZoomConstraintsClient produces
// ZoomConstraints with mAllowZoom set to false.
MakeApzcUnzoomable();
// With APZAllowZooming false, we expect the NotifyPinchGesture function to
// With apz_allow_zooming false, we expect the NotifyPinchGesture function to
// get called as the pinch progresses, but the metrics shouldn't change.
EXPECT_CALL(*mcc,
NotifyPinchGesture(PinchGestureInput::PINCHGESTURE_START,
@ -474,11 +477,11 @@ TEST_F(APZCPinchGestureDetectorTester, Pinch_NoSpan) {
FrameMetrics originalMetrics = GetPinchableFrameMetrics();
apzc->SetFrameMetrics(originalMetrics);
// When APZAllowZooming is false, the ZoomConstraintsClient produces
// When apz_allow_zooming is false, the ZoomConstraintsClient produces
// ZoomConstraints with mAllowZoom set to false.
MakeApzcUnzoomable();
// With APZAllowZooming false, we expect the NotifyPinchGesture function to
// With apz_allow_zooming false, we expect the NotifyPinchGesture function to
// get called as the pinch progresses, but the metrics shouldn't change.
EXPECT_CALL(*mcc,
NotifyPinchGesture(PinchGestureInput::PINCHGESTURE_START,

View File

@ -524,6 +524,7 @@ TEST_F(APZScrollHandoffTester, Scrollgrab) {
TEST_F(APZScrollHandoffTester, ScrollgrabFling) {
SCOPED_GFX_PREF_FLOAT("apz.fling_min_velocity_threshold", 0.0f);
// Set up the layer tree
CreateScrollgrabLayerTree();

View File

@ -191,7 +191,7 @@ void CheckerboardReportService::GetReports(
}
bool CheckerboardReportService::IsRecordingEnabled() const {
return StaticPrefs::APZRecordCheckerboarding();
return StaticPrefs::apz_record_checkerboarding();
}
void CheckerboardReportService::SetRecordingEnabled(bool aEnabled) {

View File

@ -229,9 +229,9 @@ bool SharedFrameMetricsHelper::AboutToCheckerboard(
CSSRect showing =
CSSRect(aCompositorMetrics.GetScrollOffset(),
aCompositorMetrics.CalculateBoundedCompositedSizeInCssPixels());
showing.Inflate(
LayerSize(StaticPrefs::APZDangerZoneX(), StaticPrefs::APZDangerZoneY()) /
aCompositorMetrics.LayersPixelsPerCSSPixel());
showing.Inflate(LayerSize(StaticPrefs::apz_danger_zone_x(),
StaticPrefs::apz_danger_zone_y()) /
aCompositorMetrics.LayersPixelsPerCSSPixel());
// Clamp both rects to the scrollable rect, because having either of those
// exceed the scrollable rect doesn't make sense, and could lead to false

View File

@ -1487,9 +1487,9 @@ void AsyncCompositionManager::SetFixedLayerMargins(ScreenIntCoord aTop,
}
ScreenMargin AsyncCompositionManager::GetFixedLayerMargins() const {
ScreenMargin result = mFixedLayerMargins;
if (StaticPrefs::APZFixedMarginOverrideEnabled()) {
result.top = StaticPrefs::APZFixedMarginOverrideTop();
result.bottom = StaticPrefs::APZFixedMarginOverrideBottom();
if (StaticPrefs::apz_fixed_margin_override_enabled()) {
result.top = StaticPrefs::apz_fixed_margin_override_top();
result.bottom = StaticPrefs::apz_fixed_margin_override_bottom();
}
return result;
}

View File

@ -509,7 +509,7 @@ void RenderLayers(ContainerT* aContainer, LayerManagerComposite* aManager,
}
}
if (StaticPrefs::APZMinimap()) {
if (StaticPrefs::apz_minimap_enabled()) {
RenderMinimap(aContainer, sampler, aManager, aClipRect, layer);
}
}

View File

@ -3232,7 +3232,7 @@ void gfxPlatform::GetApzSupportInfo(mozilla::widget::InfoObject& aObj) {
}
if (SupportsApzKeyboardInput() &&
!StaticPrefs::AccessibilityBrowseWithCaret()) {
!StaticPrefs::accessibility_browsewithcaret()) {
aObj.DefineProperty("ApzKeyboardInput", 1);
}
@ -3477,15 +3477,15 @@ bool gfxPlatform::SupportsApzTouchInput() const {
}
bool gfxPlatform::SupportsApzDragInput() const {
return StaticPrefs::APZDragEnabled();
return StaticPrefs::apz_drag_enabled();
}
bool gfxPlatform::SupportsApzKeyboardInput() const {
return StaticPrefs::APZKeyboardEnabled();
return StaticPrefs::apz_keyboard_enabled();
}
bool gfxPlatform::SupportsApzAutoscrolling() const {
return StaticPrefs::APZAutoscrollEnabled();
return StaticPrefs::apz_autoscroll_enabled();
}
void gfxPlatform::InitOpenGLConfig() {

View File

@ -6008,7 +6008,7 @@ void PresShell::Paint(nsView* aViewToPaint, const nsRegion& aDirtyRegion,
return;
}
if (StaticPrefs::APZKeyboardEnabled()) {
if (StaticPrefs::apz_keyboard_enabled()) {
// Update the focus target for async keyboard scrolling. This will be
// forwarded to APZ by nsDisplayList::PaintRoot. We need to to do this
// before we enter the paint phase because dispatching eVoid events can

View File

@ -173,7 +173,7 @@ static mozilla::layers::ZoomConstraints ComputeZoomConstraintsFromViewportInfo(
constraints.mAllowZoom = aViewportInfo.IsZoomAllowed() &&
nsLayoutUtils::AllowZoomingForDocument(aDocument);
constraints.mAllowDoubleTapZoom =
constraints.mAllowZoom && StaticPrefs::APZAllowDoubleTapZooming();
constraints.mAllowZoom && StaticPrefs::apz_allow_double_tap_zooming();
if (constraints.mAllowZoom) {
constraints.mMinZoom.scale = aViewportInfo.GetMinZoom().scale;
constraints.mMaxZoom.scale = aViewportInfo.GetMaxZoom().scale;

View File

@ -758,7 +758,7 @@ bool nsLayoutUtils::AllowZoomingForDocument(
// True if we allow zooming for all documents on this platform, or if we are
// in RDM and handling meta viewports, which force zoom under some
// circumstances.
return StaticPrefs::APZAllowZooming() ||
return StaticPrefs::apz_allow_zooming() ||
(aDocument && aDocument->InRDMPane() &&
nsLayoutUtils::ShouldHandleMetaViewport(aDocument));
}
@ -1050,7 +1050,7 @@ bool nsLayoutUtils::ShouldDisableApzForElement(nsIContent* aContent) {
if (!doc) {
return false;
}
return StaticPrefs::APZDisableForScrollLinkedEffects() &&
return StaticPrefs::apz_disable_for_scroll_linked_effects() &&
doc->HasScrollLinkedEffect();
}
@ -9253,7 +9253,7 @@ ScrollMetadata nsLayoutUtils::ComputeScrollMetadata(
aScrollFrame ? aScrollFrame : aForFrame, isRootContentDocRootScrollFrame,
metrics));
if (StaticPrefs::APZPrintTree() || StaticPrefs::apz_test_logging_enabled()) {
if (StaticPrefs::apz_printtree() || StaticPrefs::apz_test_logging_enabled()) {
if (nsIContent* content =
frameForCompositionBoundsCalculation->GetContent()) {
nsAutoString contentDescription;

View File

@ -1866,7 +1866,7 @@ void nsRefreshDriver::Tick(VsyncId aId, TimeStamp aNowTime) {
// We want to process any pending APZ metrics ahead of their positions
// in the queue. This will prevent us from spending precious time
// painting a stale displayport.
if (StaticPrefs::APZPeekMessages()) {
if (StaticPrefs::apz_peek_messages_enabled()) {
nsLayoutUtils::UpdateDisplayPortMarginsFromPendingMessages();
}

View File

@ -24,7 +24,7 @@ void ScrollVelocityQueue::Sample(const nsPoint& aScrollPosition) {
mAccumulator = nsPoint();
} else {
uint32_t durationMs = (currentRefreshTime - mSampleTime).ToMilliseconds();
if (durationMs > StaticPrefs::APZVelocityRelevanceTime()) {
if (durationMs > StaticPrefs::apz_velocity_relevance_time_ms()) {
mAccumulator = nsPoint();
mQueue.Clear();
} else if (durationMs == 0) {
@ -54,7 +54,7 @@ void ScrollVelocityQueue::TrimQueue() {
uint32_t timeDelta = (currentRefreshTime - mSampleTime).ToMilliseconds();
for (int i = mQueue.Length() - 1; i >= 0; i--) {
timeDelta += mQueue[i].first;
if (timeDelta >= StaticPrefs::APZVelocityRelevanceTime()) {
if (timeDelta >= StaticPrefs::apz_velocity_relevance_time_ms()) {
// The rest of the samples have expired and should be dropped
for (; i >= 0; i--) {
mQueue.RemoveElementAt(0);

View File

@ -2467,7 +2467,7 @@ void ScrollFrameHelper::ResetDisplayPortExpiryTimer() {
if (mDisplayPortExpiryTimer) {
mDisplayPortExpiryTimer->InitWithNamedFuncCallback(
RemoveDisplayPortCallback, this,
StaticPrefs::APZDisplayPortExpiryTime(), nsITimer::TYPE_ONE_SHOT,
StaticPrefs::apz_displayport_expiry_ms(), nsITimer::TYPE_ONE_SHOT,
"ScrollFrameHelper::ResetDisplayPortExpiryTimer");
}
}
@ -2487,7 +2487,7 @@ void ScrollFrameHelper::TriggerDisplayPortExpiration() {
return;
}
if (!StaticPrefs::APZDisplayPortExpiryTime()) {
if (!StaticPrefs::apz_displayport_expiry_ms()) {
// a zero time disables the expiry
return;
}
@ -2803,7 +2803,7 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
bool schedulePaint = true;
if (nsLayoutUtils::AsyncPanZoomEnabled(mOuter) &&
!nsLayoutUtils::ShouldDisableApzForElement(content) &&
StaticPrefs::APZPaintSkipping()) {
StaticPrefs::apz_paint_skipping_enabled()) {
// If APZ is enabled with paint-skipping, there are certain conditions in
// which we can skip paints:
// 1) If APZ triggered this scroll, and the tile-aligned displayport is
@ -2838,7 +2838,7 @@ void ScrollFrameHelper::ScrollToImpl(nsPoint aPt, const nsRect& aRange,
bool haveScrollLinkedEffects =
content->GetComposedDoc()->HasScrollLinkedEffect();
bool apzDisabled = haveScrollLinkedEffects &&
StaticPrefs::APZDisableForScrollLinkedEffects();
StaticPrefs::apz_disable_for_scroll_linked_effects();
if (!apzDisabled && !HasPluginFrames()) {
if (LastScrollOrigin() == nsGkAtoms::apz) {
schedulePaint = false;

View File

@ -1145,7 +1145,7 @@ nsRect nsDisplayListBuilder::OutOfFlowDisplayData::ComputeVisibleRectForFrame(
nsRect visible = aVisibleRect;
nsRect dirtyRectRelativeToDirtyFrame = aDirtyRect;
if (StaticPrefs::APZAllowZooming() &&
if (StaticPrefs::apz_allow_zooming() &&
nsLayoutUtils::IsFixedPosFrameInDisplayPort(aFrame) &&
aBuilder->IsPaintingToWindow()) {
dirtyRectRelativeToDirtyFrame =

View File

@ -60,7 +60,7 @@
// VARCACHE_PREF(
// <update-policy>,
// <pref-name-string>,
// <pref-name-id>,
// <pref-name-id>, // indented one space to align with <pref-name-string>
// <cpp-type>, <default-value>
// )
//
@ -117,14 +117,14 @@
VARCACHE_PREF(
Live,
"accessibility.monoaudio.enable",
accessibility_monoaudio_enable,
accessibility_monoaudio_enable,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"accessibility.browsewithcaret",
AccessibilityBrowseWithCaret,
accessibility_browsewithcaret,
RelaxedAtomicBool, false
)
@ -136,273 +136,273 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"apz.allow_double_tap_zooming",
APZAllowDoubleTapZooming,
apz_allow_double_tap_zooming,
RelaxedAtomicBool, true
)
VARCACHE_PREF(
Live,
"apz.allow_immediate_handoff",
APZAllowImmediateHandoff,
apz_allow_immediate_handoff,
RelaxedAtomicBool, true
)
VARCACHE_PREF(
Live,
"apz.allow_zooming",
APZAllowZooming,
apz_allow_zooming,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.android.chrome_fling_physics.enabled",
APZUseChromeFlingPhysics,
apz_android_chrome_fling_physics_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.android.chrome_fling_physics.friction",
APZChromeFlingPhysicsFriction,
apz_android_chrome_fling_physics_friction,
AtomicFloat, 0.015f
)
VARCACHE_PREF(
Live,
"apz.android.chrome_fling_physics.inflexion",
APZChromeFlingPhysicsInflexion,
apz_android_chrome_fling_physics_inflexion,
AtomicFloat, 0.35f
)
VARCACHE_PREF(
Live,
"apz.android.chrome_fling_physics.stop_threshold",
APZChromeFlingPhysicsStopThreshold,
apz_android_chrome_fling_physics_stop_threshold,
AtomicFloat, 0.1f
)
VARCACHE_PREF(
Live,
"apz.autoscroll.enabled",
APZAutoscrollEnabled,
apz_autoscroll_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.axis_lock.breakout_angle",
APZAxisBreakoutAngle,
apz_axis_lock_breakout_angle,
AtomicFloat, float(M_PI / 8.0) /* 22.5 degrees */
)
VARCACHE_PREF(
Live,
"apz.axis_lock.breakout_threshold",
APZAxisBreakoutThreshold,
apz_axis_lock_breakout_threshold,
AtomicFloat, 1.0f / 32.0f
)
VARCACHE_PREF(
Live,
"apz.axis_lock.direct_pan_angle",
APZAllowedDirectPanAngle,
apz_axis_lock_direct_pan_angle,
AtomicFloat, float(M_PI / 3.0) /* 60 degrees */
)
VARCACHE_PREF(
Live,
"apz.axis_lock.lock_angle",
APZAxisLockAngle,
apz_axis_lock_lock_angle,
AtomicFloat, float(M_PI / 6.0) /* 30 degrees */
)
VARCACHE_PREF(
Live,
"apz.axis_lock.mode",
APZAxisLockMode,
apz_axis_lock_mode,
RelaxedAtomicInt32, 0
)
VARCACHE_PREF(
Live,
"apz.content_response_timeout",
APZContentResponseTimeout,
apz_content_response_timeout,
RelaxedAtomicInt32, 400
)
VARCACHE_PREF(
Live,
"apz.danger_zone_x",
APZDangerZoneX,
apz_danger_zone_x,
RelaxedAtomicInt32, 50
)
VARCACHE_PREF(
Live,
"apz.danger_zone_y",
APZDangerZoneY,
apz_danger_zone_y,
RelaxedAtomicInt32, 100
)
VARCACHE_PREF(
Live,
"apz.disable_for_scroll_linked_effects",
APZDisableForScrollLinkedEffects,
apz_disable_for_scroll_linked_effects,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.displayport_expiry_ms",
APZDisplayPortExpiryTime,
apz_displayport_expiry_ms,
RelaxedAtomicUint32, 15000
)
VARCACHE_PREF(
Live,
"apz.drag.enabled",
APZDragEnabled,
apz_drag_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.drag.initial.enabled",
APZDragInitiationEnabled,
apz_drag_initial_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.drag.touch.enabled",
APZTouchDragEnabled,
apz_touch_drag_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.enlarge_displayport_when_clipped",
APZEnlargeDisplayPortWhenClipped,
apz_enlarge_displayport_when_clipped,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.fixed-margin-override.enabled",
APZFixedMarginOverrideEnabled,
apz_fixed_margin_override_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.fixed-margin-override.bottom",
APZFixedMarginOverrideBottom,
apz_fixed_margin_override_bottom,
RelaxedAtomicInt32, 0
)
VARCACHE_PREF(
Live,
"apz.fixed-margin-override.top",
APZFixedMarginOverrideTop,
apz_fixed_margin_override_top,
RelaxedAtomicInt32, 0
)
VARCACHE_PREF(
Live,
"apz.fling_accel_base_mult",
APZFlingAccelBaseMultiplier,
apz_fling_accel_base_mult,
AtomicFloat, 1.0f
)
VARCACHE_PREF(
Live,
"apz.fling_accel_interval_ms",
APZFlingAccelInterval,
apz_fling_accel_interval_ms,
RelaxedAtomicInt32, 500
)
VARCACHE_PREF(
Live,
"apz.fling_accel_supplemental_mult",
APZFlingAccelSupplementalMultiplier,
apz_fling_accel_supplemental_mult,
AtomicFloat, 1.0f
)
VARCACHE_PREF(
Live,
"apz.fling_accel_min_velocity",
APZFlingAccelMinVelocity,
apz_fling_accel_min_velocity,
AtomicFloat, 1.5f
)
VARCACHE_PREF(
Once,
"apz.fling_curve_function_x1",
APZCurveFunctionX1,
apz_fling_curve_function_x1,
float, 0.0f
)
VARCACHE_PREF(
Once,
"apz.fling_curve_function_x2",
APZCurveFunctionX2,
apz_fling_curve_function_x2,
float, 1.0f
)
VARCACHE_PREF(
Once,
"apz.fling_curve_function_y1",
APZCurveFunctionY1,
apz_fling_curve_function_y1,
float, 0.0f
)
VARCACHE_PREF(
Once,
"apz.fling_curve_function_y2",
APZCurveFunctionY2,
apz_fling_curve_function_y2,
float, 1.0f
)
VARCACHE_PREF(
Live,
"apz.fling_curve_threshold_inches_per_ms",
APZCurveThreshold,
apz_fling_curve_threshold_inches_per_ms,
AtomicFloat, -1.0f
)
VARCACHE_PREF(
Live,
"apz.fling_friction",
APZFlingFriction,
apz_fling_friction,
AtomicFloat, 0.002f
)
VARCACHE_PREF(
Live,
"apz.fling_min_velocity_threshold",
APZFlingMinVelocityThreshold,
apz_fling_min_velocity_threshold,
AtomicFloat, 0.5f
)
VARCACHE_PREF(
Live,
"apz.fling_stop_on_tap_threshold",
APZFlingStopOnTapThreshold,
apz_fling_stop_on_tap_threshold,
AtomicFloat, 0.05f
)
VARCACHE_PREF(
Live,
"apz.fling_stopped_threshold",
APZFlingStoppedThreshold,
apz_fling_stopped_threshold,
AtomicFloat, 0.01f
)
VARCACHE_PREF(
Live,
"apz.frame_delay.enabled",
APZFrameDelayEnabled,
apz_frame_delay_enabled,
RelaxedAtomicBool, false
)
@ -410,7 +410,7 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"apz.gtk.kinetic_scroll.enabled",
APZGTKKineticScrollEnabled,
apz_gtk_kinetic_scroll_enabled,
RelaxedAtomicBool, false
)
#endif
@ -423,7 +423,7 @@ VARCACHE_PREF(
VARCACHE_PREF(
Once,
"apz.keyboard.enabled",
APZKeyboardEnabled,
apz_keyboard_enabled,
bool, PREF_VALUE
)
#undef PREF_VALUE
@ -431,278 +431,262 @@ VARCACHE_PREF(
VARCACHE_PREF(
Live,
"apz.keyboard.passive-listeners",
APZKeyboardPassiveListeners,
apz_keyboard_passive_listeners,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.max_tap_time",
APZMaxTapTime,
apz_max_tap_time,
RelaxedAtomicInt32, 300
)
VARCACHE_PREF(
Live,
"apz.max_velocity_inches_per_ms",
APZMaxVelocity,
apz_max_velocity_inches_per_ms,
AtomicFloat, -1.0f
)
VARCACHE_PREF(
Once,
"apz.max_velocity_queue_size",
APZMaxVelocityQueueSize,
apz_max_velocity_queue_size,
uint32_t, 5
)
VARCACHE_PREF(
Live,
"apz.min_skate_speed",
APZMinSkateSpeed,
apz_min_skate_speed,
AtomicFloat, 1.0f
)
VARCACHE_PREF(
Live,
"apz.minimap.enabled",
APZMinimap,
apz_minimap_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.one_touch_pinch.enabled",
APZOneTouchPinchEnabled,
apz_one_touch_pinch_enabled,
RelaxedAtomicBool, true
)
VARCACHE_PREF(
Live,
"apz.overscroll.enabled",
APZOverscrollEnabled,
apz_overscroll_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.overscroll.min_pan_distance_ratio",
APZMinPanDistanceRatio,
apz_overscroll_min_pan_distance_ratio,
AtomicFloat, 1.0f
)
VARCACHE_PREF(
Live,
"apz.overscroll.spring_stiffness",
APZOverscrollSpringStiffness,
apz_overscroll_spring_stiffness,
AtomicFloat, 0.001f
)
VARCACHE_PREF(
Live,
"apz.overscroll.stop_distance_threshold",
APZOverscrollStopDistanceThreshold,
apz_overscroll_stop_distance_threshold,
AtomicFloat, 5.0f
)
VARCACHE_PREF(
Live,
"apz.paint_skipping.enabled",
APZPaintSkipping,
apz_paint_skipping_enabled,
RelaxedAtomicBool, true
)
VARCACHE_PREF(
Live,
"apz.peek_messages.enabled",
APZPeekMessages,
apz_peek_messages_enabled,
RelaxedAtomicBool, true
)
VARCACHE_PREF(
Live,
"apz.pinch_lock.mode",
APZPinchLockMode,
apz_pinch_lock_mode,
RelaxedAtomicInt32, 1
)
VARCACHE_PREF(
Live,
"apz.pinch_lock.scroll_lock_threshold",
APZPinchLockScrollLockThreshold,
apz_pinch_lock_scroll_lock_threshold,
AtomicFloat, 1.0f / 32.0f
)
VARCACHE_PREF(
Live,
"apz.pinch_lock.span_breakout_threshold",
APZPinchLockSpanBreakoutThreshold,
apz_pinch_lock_span_breakout_threshold,
AtomicFloat, 1.0f / 32.0f
)
VARCACHE_PREF(
Live,
"apz.pinch_lock.span_lock_threshold",
APZPinchLockSpanLockThreshold,
apz_pinch_lock_span_lock_threshold,
AtomicFloat, 1.0f / 32.0f
)
VARCACHE_PREF(
Once,
"apz.pinch_lock.buffer_max_age",
APZPinchLockBufferMaxAge,
apz_pinch_lock_buffer_max_age,
int32_t, 50 // milliseconds
)
VARCACHE_PREF(
Live,
"apz.popups.enabled",
APZPopupsEnabled,
apz_popups_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.printtree",
APZPrintTree,
apz_printtree,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.record_checkerboarding",
APZRecordCheckerboarding,
apz_record_checkerboarding,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.second_tap_tolerance",
APZSecondTapTolerance,
apz_second_tap_tolerance,
AtomicFloat, 0.5f
)
VARCACHE_PREF(
Live,
"apz.test.fails_with_native_injection",
APZTestFailsWithNativeInjection,
apz_test_fails_with_native_injection,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.test.logging_enabled",
apz_test_logging_enabled,
apz_test_logging_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"apz.touch_move_tolerance",
APZTouchMoveTolerance,
apz_touch_move_tolerance,
AtomicFloat, 0.1f
)
VARCACHE_PREF(
Live,
"apz.touch_start_tolerance",
APZTouchStartTolerance,
apz_touch_start_tolerance,
AtomicFloat, 1.0f/4.5f
)
VARCACHE_PREF(
Live,
"apz.velocity_bias",
APZVelocityBias,
apz_velocity_bias,
AtomicFloat, 0.0f
)
VARCACHE_PREF(
Live,
"apz.velocity_relevance_time_ms",
APZVelocityRelevanceTime,
apz_velocity_relevance_time_ms,
RelaxedAtomicUint32, 150
)
VARCACHE_PREF(
Live,
"apz.x_skate_highmem_adjust",
APZXSkateHighMemAdjust,
apz_x_skate_highmem_adjust,
AtomicFloat, 0.0f
)
VARCACHE_PREF(
Live,
"apz.x_skate_size_multiplier",
APZXSkateSizeMultiplier,
apz_x_skate_size_multiplier,
AtomicFloat, 1.5f
)
VARCACHE_PREF(
Live,
"apz.x_stationary_size_multiplier",
APZXStationarySizeMultiplier,
apz_x_stationary_size_multiplier,
AtomicFloat, 3.0f
)
VARCACHE_PREF(
Live,
"apz.y_skate_highmem_adjust",
APZYSkateHighMemAdjust,
apz_y_skate_highmem_adjust,
AtomicFloat, 0.0f
)
VARCACHE_PREF(
Live,
"apz.y_skate_size_multiplier",
APZYSkateSizeMultiplier,
apz_y_skate_size_multiplier,
AtomicFloat, 2.5f
)
VARCACHE_PREF(
Live,
"apz.y_stationary_size_multiplier",
APZYStationarySizeMultiplier,
apz_y_stationary_size_multiplier,
AtomicFloat, 3.5f
)
VARCACHE_PREF(
Live,
"apz.zoom_animation_duration_ms",
APZZoomAnimationDuration,
apz_zoom_animation_duration_ms,
RelaxedAtomicInt32, 250
)
VARCACHE_PREF(
Live,
"apz.scale_repaint_delay_ms",
APZScaleRepaintDelay,
apz_scale_repaint_delay_ms,
RelaxedAtomicInt32, 500
)
VARCACHE_PREF(
Live,
"apz.relative-update.enabled",
APZRelativeUpdate,
apz_relative_update_enabled,
RelaxedAtomicBool, false
)
VARCACHE_PREF(
Live,
"full-screen-api.mouse-event-allow-left-button-only",
full_screen_api_mouse_event_allow_left_button_only,
bool, true
)
// When this pref is set, parent documents may consider child iframes've loaded
// while they are still loading
VARCACHE_PREF(
Live,
"dom.cross_origin_iframes_loaded_in_background",
dom_cross_origin_iframes_loaded_in_background,
bool, false
)
//---------------------------------------------------------------------------
// Prefs starting with "beacon."
//---------------------------------------------------------------------------
@ -2648,6 +2632,15 @@ VARCACHE_PREF(
bool, false
)
// When this pref is set, parent documents may consider child iframes have
// loaded while they are still loading.
VARCACHE_PREF(
Live,
"dom.cross_origin_iframes_loaded_in_background",
dom_cross_origin_iframes_loaded_in_background,
bool, false
)
// Is support for Navigator.geolocation enabled?
VARCACHE_PREF(
Live,
@ -2736,6 +2729,13 @@ VARCACHE_PREF(
bool, true
)
VARCACHE_PREF(
Live,
"full-screen-api.mouse-event-allow-left-button-only",
full_screen_api_mouse_event_allow_left_button_only,
bool, true
)
//---------------------------------------------------------------------------
// Prefs starting with "fuzzing.". It's important that these can only be
// checked in fuzzing builds (when FUZZING is defined), otherwise you could

View File

@ -3575,7 +3575,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
}
// FIXME: bug 1525793 -- this may need to handle zooming or not on a per-document basis.
if (StaticPrefs::APZAllowZooming()) {
if (StaticPrefs::apz_allow_zooming()) {
NSPoint locationInWindow = nsCocoaUtils::EventLocationForWindow(anEvent, [self window]);
ScreenPoint position =
ViewAs<ScreenPixel>([self convertWindowCoordinatesRoundDown:locationInWindow],

View File

@ -3057,7 +3057,7 @@ void nsWindow::OnScrollEvent(GdkEventScroll* aEvent) {
GdkDevice* device = gdk_event_get_source_device((GdkEvent*)aEvent);
GdkInputSource source = gdk_device_get_source(device);
if (source == GDK_SOURCE_TOUCHSCREEN || source == GDK_SOURCE_TOUCHPAD) {
if (StaticPrefs::APZGTKKineticScrollEnabled() &&
if (StaticPrefs::apz_gtk_kinetic_scroll_enabled() &&
gtk_check_version(3, 20, 0) == nullptr) {
static auto sGdkEventIsScrollStopEvent =
(gboolean(*)(const GdkEvent*))dlsym(

View File

@ -859,7 +859,7 @@ bool nsBaseWidget::UseAPZ() {
(WindowType() == eWindowType_toplevel ||
WindowType() == eWindowType_child ||
(WindowType() == eWindowType_popup && HasRemoteContent() &&
StaticPrefs::APZPopupsEnabled())));
StaticPrefs::apz_popups_enabled())));
}
bool nsBaseWidget::AllowWebRenderForThisWindow() {
@ -893,7 +893,7 @@ void nsBaseWidget::ConfigureAPZCTreeManager() {
NewRunnableMethod<float>("layers::IAPZCTreeManager::SetDPI", mAPZC,
&IAPZCTreeManager::SetDPI, dpi));
if (StaticPrefs::APZKeyboardEnabled()) {
if (StaticPrefs::apz_keyboard_enabled()) {
KeyboardMap map = nsXBLWindowKeyHandler::CollectKeyboardShortcuts();
// On Android the main thread is not the controller thread
APZThreadUtils::RunOnControllerThread(NewRunnableMethod<KeyboardMap>(

View File

@ -133,7 +133,8 @@ nsresult nsWindowBase::SynthesizeNativeTouchPoint(
uint32_t aPointerOrientation, nsIObserver* aObserver) {
AutoObserverNotifier notifier(aObserver, "touchpoint");
if (StaticPrefs::APZTestFailsWithNativeInjection() || !InitTouchInjection()) {
if (StaticPrefs::apz_test_fails_with_native_injection() ||
!InitTouchInjection()) {
// If we don't have touch injection from the OS, or if we are running a test
// that cannot properly inject events to satisfy the OS requirements (see
// bug 1313170) we can just fake it and synthesize the events from here.