Index: content/browser/renderer_host/input/touch_event_queue.cc |
diff --git a/content/browser/renderer_host/input/touch_event_queue.cc b/content/browser/renderer_host/input/touch_event_queue.cc |
index bbac01c3ebff51081f112419068c5525a4bad5cf..f04ff965604c41ab243d7c47fa018fc451117490 100644 |
--- a/content/browser/renderer_host/input/touch_event_queue.cc |
+++ b/content/browser/renderer_host/input/touch_event_queue.cc |
@@ -349,7 +349,8 @@ TouchEventQueue::TouchEventQueue(TouchEventQueueClient* client, |
send_touch_events_async_(false), |
needs_async_touchmove_for_outer_slop_region_(false), |
last_sent_touch_timestamp_sec_(0), |
- touch_scrolling_mode_(config.touch_scrolling_mode) { |
+ touch_scrolling_mode_(config.touch_scrolling_mode), |
+ seen_scroll_update_this_sequence_(false) { |
DCHECK(client); |
if (ack_timeout_enabled_) { |
timeout_handler_.reset( |
@@ -534,17 +535,16 @@ void TouchEventQueue::ForwardNextEventToRenderer() { |
void TouchEventQueue::OnGestureScrollEvent( |
const GestureEventWithLatencyInfo& gesture_event) { |
- if (gesture_event.event.type != blink::WebInputEvent::GestureScrollBegin) |
- return; |
- |
- if (touch_filtering_state_ != DROP_ALL_TOUCHES && |
+ if (gesture_event.event.type == blink::WebInputEvent::GestureScrollBegin && |
+ touch_filtering_state_ != DROP_ALL_TOUCHES && |
touch_filtering_state_ != DROP_TOUCHES_IN_SEQUENCE) { |
DCHECK(!touchmove_slop_suppressor_->suppressing_touchmoves()) |
<< "The renderer should be offered a touchmove before scrolling begins"; |
} |
if (touch_scrolling_mode_ == TOUCH_SCROLLING_MODE_ASYNC_TOUCHMOVE) { |
- if (touch_filtering_state_ != DROP_ALL_TOUCHES && |
+ if (gesture_event.event.type == blink::WebInputEvent::GestureScrollBegin && |
+ touch_filtering_state_ != DROP_ALL_TOUCHES && |
touch_filtering_state_ != DROP_TOUCHES_IN_SEQUENCE) { |
// If no touch points have a consumer, prevent all subsequent touch events |
// received during the scroll from reaching the renderer. This ensures |
@@ -559,14 +559,24 @@ void TouchEventQueue::OnGestureScrollEvent( |
} |
} |
- pending_async_touchmove_.reset(); |
- send_touch_events_async_ = true; |
- needs_async_touchmove_for_outer_slop_region_ = true; |
- return; |
+ if (gesture_event.event.type == blink::WebInputEvent::GestureScrollBegin) { |
+ seen_scroll_update_this_sequence_ = false; |
+ return; |
+ } |
+ |
+ if (gesture_event.event.type == blink::WebInputEvent::GestureScrollUpdate && |
+ !seen_scroll_update_this_sequence_) { |
+ pending_async_touchmove_.reset(); |
+ send_touch_events_async_ = true; |
+ needs_async_touchmove_for_outer_slop_region_ = true; |
+ return; |
+ } |
} |
- if (touch_scrolling_mode_ != TOUCH_SCROLLING_MODE_TOUCHCANCEL) |
+ if (touch_scrolling_mode_ != TOUCH_SCROLLING_MODE_TOUCHCANCEL || |
+ gesture_event.event.type != blink::WebInputEvent::GestureScrollBegin) { |
jdduke (slow)
2014/07/02 17:46:37
Hmm, I would think we also want the "first allowed
tdresser
2014/07/04 18:28:17
Done.
|
return; |
+ } |
// We assume that scroll events are generated synchronously from |
// dispatching a touch event ack. This allows us to generate a synthetic |