Commit e67f9396 authored by Shimi Zhang's avatar Shimi Zhang Committed by Commit Bot

Cursor Control: Don't move cursor for GestureScrollEnd

It looks like when WebView and other Views are scrollable together, such
as the Gmail composition activity, the GestureScrollEnd event
coordinates will jump a lot from the last GestureScrollUpdate event. If
we move the cursor in this case, the cursor will jump few lines above
the current position.

This is because the GestureScrollEnd event is generated from the Android
MotionEvent::Action::CANCEL event, this is a event to notify the current
View that the following events won't be dispatched to it anymore and
the coordinates is in a different coordinate system.

In this case, from WebView's point of view, the scroll sequence will be
terminated if the touch event is going vertically, because the Android
motion event won't be dispatched to WebView in this type of layout, so
we won't be able to move the cursor up and down and user has to fallback
to the regular way to move the cursor.

Bug: 1145146
Change-Id: Iac29ca9a3799fdbdf19fffc52b23650111bc1138
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2533687Reviewed-by: default avatarRobert Flack <flackr@chromium.org>
Commit-Queue: Shimi Zhang <ctzsm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826915}
parent 972b94d3
......@@ -1390,7 +1390,6 @@ bool WebFrameWidgetBase::WillHandleGestureEvent(const WebGestureEvent& event) {
}
case WebInputEvent::Type::kGestureScrollEnd: {
if (swipe_to_move_cursor_activated_) {
move_cursor = true;
swipe_to_move_cursor_activated_ = false;
}
break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment