зеркало из https://github.com/mozilla/gecko-dev.git
Bug 775448: Add gesture cancelling support during sync subframe scrolling r=cjones
This commit is contained in:
Родитель
a52dd8cc39
Коммит
c69a910104
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче