Commit fdaaebe8 authored by Eugene But's avatar Eugene But Committed by Commit Bot

Do not cancel system long press gesture if it's not a link press.

Cancelling system long press gesture cancels all system UI (selection
and context menu). Cancelling system context menu UI is intentional,
because  Chrome want to show own context menu. Cancelling system
selection UI was a bug.

Bug: 763985
Change-Id: I19fb9b7a90948a2ae9151028d4b7bff53e65b0cf
Reviewed-on: https://chromium-review.googlesource.com/663780
Commit-Queue: Eugene But <eugenebut@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#501343}
parent 42ea92d0
......@@ -204,7 +204,14 @@ void CancelTouches(UIGestureRecognizer* gesture_recognizer) {
}
- (void)longPressGestureRecognizerBegan {
[self cancelAllTouches];
if ([_DOMElementForLastTouch count]) {
// User long pressed on a link or an image. Cancelling all touches will
// intentionally suppress system context menu UI.
[self cancelAllTouches];
} else {
// There is no link or image under user's gesture. Do not cancel all touches
// to allow system text seletion UI.
}
if ([_delegate respondsToSelector:@selector(webView:handleContextMenu:)]) {
_locationForLastTouch = [_contextMenuRecognizer locationInView:_webView];
......
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