Bug 1193062 - Add a PAN_MOMENTUM state. r=kats

This was discussed in bug 1107716.

--HG--
extra : commitid : 8EvQL9qrm3X
extra : rebase_source : 3785c8ac8e7e90f171cf9091f6fc50d76d34f703
extra : histedit_source : ffc8c6cd57f535b03621e149bb300e60683d1612
This commit is contained in:
Markus Stange 2015-08-07 14:39:34 -04:00
parent 8c83121309
commit 4d872ae182
2 changed files with 7 additions and 0 deletions

View File

@ -1075,6 +1075,7 @@ nsEventStatus AsyncPanZoomController::OnTouchStart(const MultiTouchInput& aEvent
case SMOOTH_SCROLL:
case OVERSCROLL_ANIMATION:
case WHEEL_SCROLL:
case PAN_MOMENTUM:
CurrentTouchBlock()->GetOverscrollHandoffChain()->CancelAnimations(ExcludeOverscroll);
// Fall through.
case NOTHING: {
@ -1145,6 +1146,7 @@ nsEventStatus AsyncPanZoomController::OnTouchMove(const MultiTouchInput& aEvent)
case PANNING:
case PANNING_LOCKED_X:
case PANNING_LOCKED_Y:
case PAN_MOMENTUM:
TrackTouch(aEvent);
return nsEventStatus_eConsumeNoDefault;
@ -1209,6 +1211,7 @@ nsEventStatus AsyncPanZoomController::OnTouchEnd(const MultiTouchInput& aEvent)
case PANNING:
case PANNING_LOCKED_X:
case PANNING_LOCKED_Y:
case PAN_MOMENTUM:
{
CurrentTouchBlock()->GetOverscrollHandoffChain()->FlushRepaints();
mX.EndTouch(aEvent.mTime);
@ -1730,6 +1733,7 @@ nsEventStatus AsyncPanZoomController::OnPanMomentumStart(const PanGestureInput&
}
mPanGestureState = MakeUnique<InputBlockState>(this, true);
SetState(PAN_MOMENTUM);
return nsEventStatus_eConsumeNoDefault;
}
@ -1744,6 +1748,7 @@ nsEventStatus AsyncPanZoomController::OnPanMomentumEnd(const PanGestureInput& aE
// animation started, but I guess it doesn't really matter for now.
mX.CancelTouch();
mY.CancelTouch();
SetState(NOTHING);
RequestContentRepaint();

View File

@ -754,6 +754,8 @@ protected:
PANNING_LOCKED_X, /* touch-start followed by move (i.e. panning with axis lock) X axis */
PANNING_LOCKED_Y, /* as above for Y axis */
PAN_MOMENTUM, /* like PANNING, but controlled by momentum PanGestureInput events */
CROSS_SLIDING_X, /* Panning disabled while user does a horizontal gesture
on a vertically-scrollable view. This used for the
Windows Metro "cross-slide" gesture. */