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..0fb36cf1ef004df971d5c0bf7da73c10ceb9aa80 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,32 @@ 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) { |
- if (host_->ShouldForwardTouchEvent()) |
- host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); |
- UpdateWebTouchEventAfterDispatch(&touch_event_, point); |
+ if (!point && host_->ShouldForwardTouchEvent()) { |
jdduke (slow)
2014/11/24 22:02:43
Would it hurt to just make this conditional |if (!
tdresser
2014/11/25 13:58:10
Done.
|
+ event->DisableSynchronousHandling(); |
+ // Mark the most recent touch event as handled, as it wasn't valid. |
+ ui::GestureRecognizer::Get()->AckSyncTouchEvent(*event, ui::ER_HANDLED, |
+ window_); |
} |
+ |
+ if (!point) |
+ return; |
+ |
+ // 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) { |