Skip to content

Commit

Permalink
Bug 1768305. Remove widget.swipe.success-threshold pref. r=hiro
Browse files Browse the repository at this point in the history
Since bug 1757928 we don't vary the value. If a user were to change this value then the opacity of the swipe to nav ui element would not be in sync with the decision to navigate or not. So remove it so things can't break. The pref widget.swipe.whole-page-pixel-size should be used instead now to control sensitivity.

Differential Revision: https://phabricator.services.mozilla.com/D145828
  • Loading branch information
tnikkel committed May 8, 2022
1 parent 87de27f commit b484e90
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
5 changes: 0 additions & 5 deletions modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13319,11 +13319,6 @@
value: 0.0000001f
mirror: always

- name: widget.swipe.success-threshold
type: float
value: 0.25f
mirror: always

- name: widget.swipe.success-velocity-contribution
type: float
value: 0.05f
Expand Down
4 changes: 2 additions & 2 deletions widget/SwipeTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// These values were tweaked to make the physics feel similar to the native
// swipe.
static const double kSpringForce = 250.0;
static const double kSwipeSuccessThreshold = 0.25;

namespace mozilla {

Expand Down Expand Up @@ -97,8 +98,7 @@ bool SwipeTracker::ComputeSwipeSuccess() const {
return (mGestureAmount * targetValue +
mCurrentVelocity * targetValue *
StaticPrefs::widget_swipe_success_velocity_contribution()) >=

StaticPrefs::widget_swipe_success_threshold();
kSwipeSuccessThreshold;
}

nsEventStatus SwipeTracker::ProcessEvent(const PanGestureInput& aEvent) {
Expand Down
5 changes: 0 additions & 5 deletions widget/tests/browser/browser_test_swipe_gesture.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ add_task(async () => {
["browser.gesture.swipe.eight", "Browser:ForwardOrForwardDuplicate"],
["widget.disable-swipe-tracker", false],
["widget.swipe.velocity-twitch-tolerance", 0.0000001],
["widget.swipe.success-threshold", 0.25],
["widget.swipe.success-velocity-contribution", 0.5],
],
});
Expand Down Expand Up @@ -252,7 +251,6 @@ add_task(async () => {
["browser.gesture.swipe.eight", "Browser:ForwardOrForwardDuplicate"],
["widget.disable-swipe-tracker", false],
["widget.swipe.velocity-twitch-tolerance", 0.0000001],
["widget.swipe.success-threshold", 0.25],
// Set the velocity-contribution to 0 so we can exactly control the
// values in the swipe tracker via the delta in the events that we send.
["widget.swipe.success-velocity-contribution", 0.0],
Expand Down Expand Up @@ -351,7 +349,6 @@ add_task(async () => {
["browser.gesture.swipe.eight", "Browser:ForwardOrForwardDuplicate"],
["widget.disable-swipe-tracker", false],
["widget.swipe.velocity-twitch-tolerance", 0.0000001],
["widget.swipe.success-threshold", 0.25],
// Set the velocity-contribution to 0 so we can exactly control the
// values in the swipe tracker via the delta in the events that we send.
["widget.swipe.success-velocity-contribution", 0.0],
Expand Down Expand Up @@ -449,7 +446,6 @@ add_task(async () => {
["browser.gesture.swipe.eight", "Browser:ForwardOrForwardDuplicate"],
["widget.disable-swipe-tracker", false],
["widget.swipe.velocity-twitch-tolerance", 0.0000001],
["widget.swipe.success-threshold", 0.25],
// Set the velocity-contribution to 0 so we can exactly control the
// values in the swipe tracker via the delta in the events that we send.
["widget.swipe.success-velocity-contribution", 0.0],
Expand Down Expand Up @@ -510,7 +506,6 @@ add_task(async () => {
["browser.gesture.swipe.eight", "Browser:ForwardOrForwardDuplicate"],
["widget.disable-swipe-tracker", false],
["widget.swipe.velocity-twitch-tolerance", 0.0000001],
["widget.swipe.success-threshold", 0.25],
// Set the velocity-contribution to 0 so we can exactly control the
// values in the swipe tracker via the delta in the events that we send.
["widget.swipe.success-velocity-contribution", 0.0],
Expand Down

0 comments on commit b484e90

Please sign in to comment.