| Index: content/browser/renderer_host/render_widget_host_view_aura.cc
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| index 0cfdf26add55f9f86d5db2bb9900ea2fbcdfabef..52afd71777dcf5b52b8f40d37339fa2419f3c39f 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
|
| @@ -2033,23 +2033,30 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) {
|
| return;
|
|
|
| // Update the touch event first.
|
| - blink::WebTouchPoint* point = UpdateWebTouchEventFromUIEvent(*event,
|
| - &touch_event_);
|
| -
|
| - // Forward the touch event only if a touch point was updated, and there's a
|
| - // touch-event handler in the page, and no other touch-event is in the queue.
|
| - // It is important to always consume the event if there is a touch-event
|
| - // handler in the page, or some touch-event is already in the queue, even if
|
| - // no point has been updated, to make sure that this event does not get
|
| - // processed by the gesture recognizer before the events in the queue.
|
| - if (host_->ShouldForwardTouchEvent())
|
| - event->StopPropagation();
|
| + blink::WebTouchPoint* point =
|
| + UpdateWebTouchEventFromUIEvent(*event, &touch_event_);
|
| +
|
| + if (!point) {
|
| + event->DisableSynchronousHandling();
|
| + // Mark the most recent touch event as handled, as it wasn't valid.
|
| + ui::GestureRecognizer::Get()->AckSyncTouchEvent(*event, ui::ER_HANDLED,
|
| + window_);
|
| + return;
|
| + }
|
|
|
| - if (point) {
|
| - if (host_->ShouldForwardTouchEvent())
|
| - host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency());
|
| - UpdateWebTouchEventAfterDispatch(&touch_event_, point);
|
| + // Forward the touch event only if a touch point was updated, and
|
| + // there's a touch-event handler in the page, and no other
|
| + // touch-event is in the queue. It is important to always mark
|
| + // events as being handled asynchronously if there is a touch-event
|
| + // handler in the page, or some touch-event is already in the queue,
|
| + // even if no point has been updated. This ensures that this event
|
| + // does not get processed by the gesture recognizer before events
|
| + // currently awaiting dispatch in the touch queue.
|
| + if (host_->ShouldForwardTouchEvent()) {
|
| + event->DisableSynchronousHandling();
|
| + host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency());
|
| }
|
| + UpdateWebTouchEventAfterDispatch(&touch_event_, point);
|
| }
|
|
|
| void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) {
|
|
|