Bug 931787: Avoid tracking vertical overscrolls on OSX if elastic overscroll is disabled. r=felipe

This commit is contained in:
Stephen Pohl 2013-10-29 15:03:05 -04:00
parent e5eaa246c9
commit 0671510313

View File

@ -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();