Bug 775448: Add gesture cancelling support during sync subframe scrolling r=cjones

This commit is contained in:
Doug Sherk 2012-08-07 18:51:03 -07:00
Родитель a52dd8cc39
Коммит c69a910104
3 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -148,7 +148,7 @@ AsyncPanZoomController::HandleInputEvent(const nsInputEvent& aEvent,
nsEventStatus AsyncPanZoomController::HandleInputEvent(const InputData& aEvent) {
nsEventStatus rv = nsEventStatus_eIgnore;
if (mGestureEventListener) {
if (mGestureEventListener && !mDisableNextTouchBatch) {
nsEventStatus rv = mGestureEventListener->HandleInputEvent(aEvent);
if (rv == nsEventStatus_eConsumeNoDefault)
return rv;
@ -823,6 +823,9 @@ void AsyncPanZoomController::NotifyDOMTouchListenerAdded() {
void AsyncPanZoomController::CancelDefaultPanZoom() {
mDisableNextTouchBatch = true;
if (mGestureEventListener) {
mGestureEventListener->CancelGesture();
}
}
}

Просмотреть файл

@ -260,5 +260,10 @@ AsyncPanZoomController* GestureEventListener::GetAsyncPanZoomController() {
return mAsyncPanZoomController;
}
void GestureEventListener::CancelGesture() {
mTouches.Clear();
mState = GESTURE_NONE;
}
}
}

Просмотреть файл

@ -47,6 +47,13 @@ public:
*/
nsEventStatus HandleInputEvent(const InputData& aEvent);
/**
* Cancels any currently active gesture. May not properly handle situations
* that require extra work at the gesture's end, like a pinch which only
* requests a repaint once it has ended.
*/
void CancelGesture();
/**
* Returns the AsyncPanZoomController stored on this class and used for
* callbacks.