Bug 945584: Part 4 - Add scroll snapping preferences (v3 Patch), r=roc

- Added preferences to allow trackpad and mousewheel flinging between
snap points to be tuned:
- layout.css.scroll-snap.prediction-max-velocity
- layout.css.scroll-snap.prediction-sensitivity
This commit is contained in:
Kearwood (Kip) Gilbert 2015-02-19 15:43:14 -08:00
parent 92aa32553d
commit 7f14122b9a
2 changed files with 16 additions and 0 deletions

View File

@ -319,6 +319,8 @@ private:
DECL_GFX_PREF(Live, "layout.css.scroll-behavior.damping-ratio", ScrollBehaviorDampingRatio, float, 1.0f);
DECL_GFX_PREF(Live, "layout.css.scroll-behavior.enabled", ScrollBehaviorEnabled, bool, false);
DECL_GFX_PREF(Live, "layout.css.scroll-behavior.spring-constant", ScrollBehaviorSpringConstant, float, 250.0f);
DECL_GFX_PREF(Live, "layout.css.scroll-snap.prediction-sensitivity", ScrollSnapPredictionSensitivity, float, 0.750f);
DECL_GFX_PREF(Live, "layout.css.scroll-snap.prediction-max-velocity", ScrollSnapPredictionMaxVelocity, int32_t, 2000);
DECL_GFX_PREF(Once, "layout.css.touch_action.enabled", TouchActionEnabled, bool, false);
DECL_GFX_PREF(Once, "layout.frame_rate", LayoutFrameRate, int32_t, -1);
DECL_GFX_PREF(Live, "layout.display-list.dump", LayoutDumpDisplayList, bool, false);

View File

@ -2097,6 +2097,20 @@ pref("layout.css.filters.enabled", true);
// Is support for scroll-snap enabled?
pref("layout.css.scroll-snap.enabled", false);
// Set the threshold distance in CSS pixels below which scrolling will snap to
// an edge, when scroll snapping is set to "proximity".
pref("layout.css.scroll-snap.proximity-threshold", 200);
// When selecting the snap point for CSS scroll snapping, the velocity of the
// scroll frame is clamped to this speed, in CSS pixels / s.
pref("layout.css.scroll-snap.prediction-max-velocity", 2000);
// When selecting the snap point for CSS scroll snapping, the velocity of the
// scroll frame is integrated over this duration, in seconds. The snap point
// best suited for this position is selected, enabling the user to perform fling
// gestures.
pref("layout.css.scroll-snap.prediction-sensitivity", "0.750");
// Is support for basic shapes in clip-path enabled?
pref("layout.css.clip-path-shapes.enabled", false);