Skip to content
Permalink
Browse files
Long press gesture recognizers in WKWebView are conflicting with inte…
…rnal scroll view long press gesture recognizers

https://bugs.webkit.org/show_bug.cgi?id=195726
rdar://problem/48582449

Patch by James Magahern <jmagahern@apple.com> on 2019-03-21
Reviewed by Megan Gardner.

We just need to add another clause to WKContentViewInteraction's
canPreventGestureRecognizer whitelist.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):

Canonical link: https://commits.webkit.org/210414@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243351 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
James Magahern authored and webkit-commit-queue committed Mar 22, 2019
1 parent d05f03a commit dd9de354e8a3d9f0318699c5674c261ed45bc4c3
Showing 2 changed files with 20 additions and 0 deletions.
@@ -1,3 +1,17 @@
2019-03-21 James Magahern <jmagahern@apple.com>

Long press gesture recognizers in WKWebView are conflicting with internal scroll view long press gesture recognizers
https://bugs.webkit.org/show_bug.cgi?id=195726
rdar://problem/48582449

Reviewed by Megan Gardner.

We just need to add another clause to WKContentViewInteraction's
canPreventGestureRecognizer whitelist.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):

2019-03-21 Simon Fraser <simon.fraser@apple.com>

[iOS WK2] Turn on async overflow scrolling by default
@@ -1686,6 +1686,10 @@ - (CGRect)_selectionClipRect
return _page->editorState().postLayoutData().focusedElementRect;
}

#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKContentViewInteraction.mm>)
#include <WebKitAdditions/WKContentViewInteraction.mm>
#else

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer canPreventGestureRecognizer:(UIGestureRecognizer *)preventedGestureRecognizer
{
// A long-press gesture can not be recognized while panning, but a pan can be recognized
@@ -1695,6 +1699,8 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer can
&& ([preventedGestureRecognizer isKindOfClass:NSClassFromString(@"UIScrollViewPanGestureRecognizer")] || [preventedGestureRecognizer isKindOfClass:NSClassFromString(@"UIScrollViewPinchGestureRecognizer")]));
}

#endif

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)preventedGestureRecognizer canBePreventedByGestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer {
// Don't allow the highlight to be prevented by a selection gesture. Press-and-hold on a link should highlight the link, not select it.
bool isForcePressGesture = NO;

0 comments on commit dd9de35

Please sign in to comment.