Bug 1367765 - Put apz scrollbar touch-dragging behind a pref. r=rhunt

The pref is enabled by default, but it allows the feature to be disabled
easily if necessary.

MozReview-Commit-ID: Iu1JmMKEQv9

--HG--
extra : rebase_source : 57c27ef5840d4932e28cda2eb2f6e921ccd11a71
This commit is contained in:
Botond Ballo 2017-09-12 19:38:30 -04:00
parent c8286ea7d2
commit aa3610ce43
4 changed files with 17 additions and 1 deletions

View File

@ -1417,7 +1417,8 @@ APZCTreeManager::ProcessTouchInput(MultiTouchInput& aInput,
// Check if this event starts a scrollbar touch-drag. The conditions
// checked are similar to the ones we check for MOUSE_INPUT starting
// a scrollbar mouse-drag.
mInScrollbarTouchDrag = gfxPrefs::APZDragEnabled() && hitScrollbarNode &&
mInScrollbarTouchDrag = gfxPrefs::APZDragEnabled() &&
gfxPrefs::APZTouchDragEnabled() && hitScrollbarNode &&
hitScrollbarNode->IsScrollThumbNode() &&
hitScrollbarNode->GetScrollThumbData().mIsAsyncDraggable;

View File

@ -199,6 +199,19 @@ typedef GenericFlingAnimation FlingAnimation;
* disable the expiry behavior entirely.
* Units: milliseconds
*
* \li\b apz.drag.enabled
* Setting this pref to true will cause APZ to handle mouse-dragging of
* scrollbar thumbs.
*
* \li\b apz.drag.initial.enabled
* Setting this pref to true will cause APZ to try to handle mouse-dragging
* of scrollbar thumbs without an initial round-trip to content to start it
* if possible. Only has an effect if apz.drag.enabled is also true.
*
* \li\b apz.drag.touch.enabled
* Setting this pref to true will cause APZ to handle touch-dragging of
* scrollbar thumbs. Only has an effect if apz.drag.enabled is also true.
*
* \li\b apz.enlarge_displayport_when_clipped
* Pref that enables enlarging of the displayport along one axis when the
* generated displayport's size is beyond that of the scrollable rect on the

View File

@ -298,6 +298,7 @@ private:
DECL_GFX_PREF(Live, "apz.displayport_expiry_ms", APZDisplayPortExpiryTime, uint32_t, 15000);
DECL_GFX_PREF(Live, "apz.drag.enabled", APZDragEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.drag.initial.enabled", APZDragInitiationEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.drag.touch.enabled", APZTouchDragEnabled, bool, false);
DECL_GFX_PREF(Live, "apz.enlarge_displayport_when_clipped", APZEnlargeDisplayPortWhenClipped, bool, false);
DECL_GFX_PREF(Live, "apz.fling_accel_base_mult", APZFlingAccelBaseMultiplier, float, 1.0f);
DECL_GFX_PREF(Live, "apz.fling_accel_interval_ms", APZFlingAccelInterval, int32_t, 500);

View File

@ -674,6 +674,7 @@ pref("apz.axis_lock.direct_pan_angle", "1.047197"); // PI / 3 (60 degrees)
pref("apz.content_response_timeout", 400);
pref("apz.drag.enabled", true);
pref("apz.drag.initial.enabled", true);
pref("apz.drag.touch.enabled", true);
pref("apz.danger_zone_x", 50);
pref("apz.danger_zone_y", 100);
pref("apz.disable_for_scroll_linked_effects", false);