Title: [233159] trunk/Source/WebKit
Revision
233159
Author
wenson_hs...@apple.com
Date
2018-06-25 11:43:07 -0700 (Mon, 25 Jun 2018)

Log Message

[iPad apps on macOS] Click events are broken in WKWebView
https://bugs.webkit.org/show_bug.cgi?id=186964
<rdar://problem/41369145>

Reviewed by Tim Horton.

Tapping in WKWebView currently does not dispatch click events to the page. This is because the long press loupe
gesture (in the text interaction assistant) has a delay of 0 when running iOS apps on macOS, but on iOS, it's
0.5. The zero delay on macOS means that the loupe gesture will be recognized before the synthetic click gesture;
this, in turn, causes the synthetic click gesture to be excluded by the loupe gesture. To address this, we
simply allow the click and loupe gesture to recognize simultaneously.

Additionally, a new hover gesture was added recently to handle macOS cursor types when hovering over selectable
text. This patch also allows other gestures to recognize alongside hover gestures, which matches macOS behavior.

We don't have the capacity to write automated tests for this yet; I manually tested text selection, editing in
some text form controls, as well as clicking on links, buttons, and other elements with click event handlers.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (233158 => 233159)


--- trunk/Source/WebKit/ChangeLog	2018-06-25 18:30:47 UTC (rev 233158)
+++ trunk/Source/WebKit/ChangeLog	2018-06-25 18:43:07 UTC (rev 233159)
@@ -1,3 +1,26 @@
+2018-06-25  Wenson Hsieh  <wenson_hs...@apple.com>
+
+        [iPad apps on macOS] Click events are broken in WKWebView
+        https://bugs.webkit.org/show_bug.cgi?id=186964
+        <rdar://problem/41369145>
+
+        Reviewed by Tim Horton.
+
+        Tapping in WKWebView currently does not dispatch click events to the page. This is because the long press loupe
+        gesture (in the text interaction assistant) has a delay of 0 when running iOS apps on macOS, but on iOS, it's
+        0.5. The zero delay on macOS means that the loupe gesture will be recognized before the synthetic click gesture;
+        this, in turn, causes the synthetic click gesture to be excluded by the loupe gesture. To address this, we
+        simply allow the click and loupe gesture to recognize simultaneously.
+
+        Additionally, a new hover gesture was added recently to handle macOS cursor types when hovering over selectable
+        text. This patch also allows other gestures to recognize alongside hover gestures, which matches macOS behavior.
+
+        We don't have the capacity to write automated tests for this yet; I manually tested text selection, editing in
+        some text form controls, as well as clicking on links, buttons, and other elements with click event handlers.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
+
 2018-06-23  Brian Burg  <bb...@apple.com>
 
         [Mac] Web Automation: include correct key code with synthesized NSEvents used for keystrokes

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (233158 => 233159)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-06-25 18:30:47 UTC (rev 233158)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-06-25 18:43:07 UTC (rev 233159)
@@ -1341,11 +1341,6 @@
 
 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*)otherGestureRecognizer
 {
-#if USE(APPLE_INTERNAL_SDK)
-    if ([self _internalGestureRecognizer:gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:otherGestureRecognizer])
-        return YES;
-#endif
-
     if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _longPressGestureRecognizer.get()))
         return YES;
 
@@ -1355,6 +1350,12 @@
 #if ENABLE(MINIMAL_SIMULATOR)
     if (isSamePair(gestureRecognizer, otherGestureRecognizer, _textSelectionAssistant.get().loupeGesture, _textSelectionAssistant.get().forcePressGesture))
         return YES;
+
+    if (isSamePair(gestureRecognizer, otherGestureRecognizer, _singleTapGestureRecognizer.get(), _textSelectionAssistant.get().loupeGesture))
+        return YES;
+
+    if ([gestureRecognizer isKindOfClass:[UIHoverGestureRecognizer class]] || [otherGestureRecognizer isKindOfClass:[UIHoverGestureRecognizer class]])
+        return YES;
 #endif
     if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _textSelectionAssistant.get().forcePressGesture))
         return YES;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to