From 0671510313cd983dde9ac23f589bac1607fcf347 Mon Sep 17 00:00:00 2001 From: Stephen Pohl Date: Tue, 29 Oct 2013 15:03:05 -0400 Subject: [PATCH] Bug 931787: Avoid tracking vertical overscrolls on OSX if elastic overscroll is disabled. r=felipe --- .../base/content/browser-gestureSupport.js | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/browser/base/content/browser-gestureSupport.js b/browser/base/content/browser-gestureSupport.js index 9c8d4c5b4d9..50ede96fe63 100644 --- a/browser/base/content/browser-gestureSupport.js +++ b/browser/base/content/browser-gestureSupport.js @@ -176,7 +176,8 @@ let gGestureSupport = { }, /** - * Sets up the history swipe animations for a swipe gesture event, if enabled. + * Sets up swipe gestures. This includes setting up swipe animations for the + * gesture, if enabled. * * @param aEvent * The swipe gesture start event. @@ -189,18 +190,22 @@ let gGestureSupport = { } let isVerticalSwipe = false; - if (gHistorySwipeAnimation.active) { - if (aEvent.direction == aEvent.DIRECTION_UP) { - if (content.pageYOffset > 0) { - return false; - } - isVerticalSwipe = true; - } else if (aEvent.direction == aEvent.DIRECTION_DOWN) { - if (content.pageYOffset < content.scrollMaxY) { - return false; - } - isVerticalSwipe = true; + if (aEvent.direction == aEvent.DIRECTION_UP) { + if (content.pageYOffset > 0) { + return false; } + isVerticalSwipe = true; + } else if (aEvent.direction == aEvent.DIRECTION_DOWN) { + if (content.pageYOffset < content.scrollMaxY) { + return false; + } + isVerticalSwipe = true; + } + if (isVerticalSwipe && !gHistorySwipeAnimation.active) { + // Unlike horizontal swipes (which can navigate history even when + // swipe animations are turned off) vertical swipes should not be tracked + // if animations (bounce effect) aren't enabled. + return false; } let canGoBack = gHistorySwipeAnimation.canGoBack();