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 37f3648fcac218e3ba43790eb914a7480c49bfd7..55defea8957b3ef5e521c9ac83f1a939b3c87384 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
@@ -2013,20 +2013,28 @@ void RenderWidgetHostViewAura::OnTouchEvent(ui::TouchEvent* event) { |
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(); |
- |
- if (point) { |
- if (host_->ShouldForwardTouchEvent()) |
+ // Forward the touch event only if a touch point was updated, and |
jdduke (slow)
2014/11/17 16:57:13
Would it make any sense to split out the point is
tdresser
2014/11/17 22:00:36
Done.
Feels about 1% worse this way to me - what d
jdduke (slow)
2014/11/17 22:23:15
I was hoping we could get rid of the |DisableSynch
|
+ // 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(); |
+ if (point) { |
host_->ForwardTouchEventWithLatencyInfo(touch_event_, *event->latency()); |
- UpdateWebTouchEventAfterDispatch(&touch_event_, point); |
+ } else { |
+ // Fake an ack for the invalid touch event. |
+ DCHECK(window_->GetHost()); |
+ window_->GetHost()->dispatcher()->ProcessedTouchEvent(event, window_, |
jdduke (slow)
2014/11/17 16:57:13
It seems like this could cause us to get some out-
tdresser
2014/11/17 22:00:36
Gah, you're right, that could potentially break th
jdduke (slow)
2014/11/17 22:23:15
Well, ideally this method would be: |OnTouchEvent(
|
+ ui::ER_HANDLED); |
+ } |
} |
+ |
+ if (point) |
+ UpdateWebTouchEventAfterDispatch(&touch_event_, point); |
} |
void RenderWidgetHostViewAura::OnGestureEvent(ui::GestureEvent* event) { |