diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 0c43a574418a..66c17186d6b0 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -824,6 +824,8 @@ nsEventStatus AsyncPanZoomController::OnLongPress(const TapGestureInput& aEvent) nsEventStatus AsyncPanZoomController::OnSingleTapUp(const TapGestureInput& aEvent) { APZC_LOG("%p got a single-tap-up in state %d\n", this, mState); nsRefPtr controller = GetGeckoContentController(); + // If mAllowZoom is true we wait for a call to OnSingleTapConfirmed before + // sending event to content if (controller && !mAllowZoom) { int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers); CSSIntPoint geckoScreenPoint; @@ -838,8 +840,7 @@ nsEventStatus AsyncPanZoomController::OnSingleTapUp(const TapGestureInput& aEven nsEventStatus AsyncPanZoomController::OnSingleTapConfirmed(const TapGestureInput& aEvent) { APZC_LOG("%p got a single-tap-confirmed in state %d\n", this, mState); nsRefPtr controller = GetGeckoContentController(); - // If zooming is disabled, we handle this in OnSingleTapUp - if (controller && mAllowZoom) { + if (controller) { int32_t modifiers = WidgetModifiersToDOMModifiers(aEvent.modifiers); CSSIntPoint geckoScreenPoint; if (ConvertToGecko(aEvent.mPoint, &geckoScreenPoint)) { diff --git a/gfx/layers/ipc/GestureEventListener.cpp b/gfx/layers/ipc/GestureEventListener.cpp index 40fa1764d30d..9d374537e09b 100644 --- a/gfx/layers/ipc/GestureEventListener.cpp +++ b/gfx/layers/ipc/GestureEventListener.cpp @@ -167,19 +167,25 @@ nsEventStatus GestureEventListener::HandleInputEvent(const InputData& aEvent) mState = GESTURE_NONE; } else if (mState == GESTURE_WAITING_SINGLE_TAP) { CancelLongTapTimeoutTask(); - HandleSingleTapUpEvent(event); + nsEventStatus tapupEvent = HandleSingleTapUpEvent(event); - // We were not waiting for anything but a single tap has happened that - // may turn into a double tap. Wait a while and if it doesn't turn into - // a double tap, send a single tap instead. - mState = GESTURE_WAITING_DOUBLE_TAP; + if (tapupEvent == nsEventStatus_eIgnore) { + // We were not waiting for anything but a single tap has happened that + // may turn into a double tap. Wait a while and if it doesn't turn into + // a double tap, send a single tap instead. + mState = GESTURE_WAITING_DOUBLE_TAP; - mDoubleTapTimeoutTask = - NewRunnableMethod(this, &GestureEventListener::TimeoutDoubleTap); + mDoubleTapTimeoutTask = + NewRunnableMethod(this, &GestureEventListener::TimeoutDoubleTap); - mAsyncPanZoomController->PostDelayedTask( - mDoubleTapTimeoutTask, - MAX_TAP_TIME); + mAsyncPanZoomController->PostDelayedTask( + mDoubleTapTimeoutTask, + MAX_TAP_TIME); + + } else if (tapupEvent == nsEventStatus_eConsumeNoDefault) { + // We sent the tapup into content without waiting for a double tap + mState = GESTURE_NONE; + } } mLastTapEndTime = event.mTime;