Title: [232040] trunk
Revision
232040
Author
[email protected]
Date
2018-05-21 17:19:28 -0700 (Mon, 21 May 2018)

Log Message

Source/WebKit:
[iOS] Click events only fire once when editing
https://bugs.webkit.org/show_bug.cgi?id=185777

Patch by Aditya Keerthi <[email protected]> on 2018-05-21
Reviewed by Tim Horton.

gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
click event.

Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
being shown when the node is already being assisted.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
(-[WKContentView gestureRecognizerShouldBegin:]):

LayoutTests:
Added test to verify behaviour when tapping multiple times on an editable node.
https://bugs.webkit.org/show_bug.cgi?id=185777

Patch by Aditya Keerthi <[email protected]> on 2018-05-21
Reviewed by Tim Horton.

* fast/events/ios/click-event-while-editing-node-expected.txt: Added.
* fast/events/ios/click-event-while-editing-node.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (232039 => 232040)


--- trunk/LayoutTests/ChangeLog	2018-05-22 00:14:39 UTC (rev 232039)
+++ trunk/LayoutTests/ChangeLog	2018-05-22 00:19:28 UTC (rev 232040)
@@ -1,3 +1,13 @@
+2018-05-21  Aditya Keerthi  <[email protected]>
+
+        Added test to verify behaviour when tapping multiple times on an editable node.
+        https://bugs.webkit.org/show_bug.cgi?id=185777
+
+        Reviewed by Tim Horton.
+
+        * fast/events/ios/click-event-while-editing-node-expected.txt: Added.
+        * fast/events/ios/click-event-while-editing-node.html: Added.
+
 2018-05-21  Commit Queue  <[email protected]>
 
         Unreviewed, rolling out r232030.

Added: trunk/LayoutTests/fast/events/ios/click-event-while-editing-node-expected.txt (0 => 232040)


--- trunk/LayoutTests/fast/events/ios/click-event-while-editing-node-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/click-event-while-editing-node-expected.txt	2018-05-22 00:19:28 UTC (rev 232040)
@@ -0,0 +1,9 @@
+PASS document.getElementById('clicks').textContent is "2"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+The click event should be fired on a node that is being edited.
+
+The click count in the editable node is: 2
+
+Click me!

Added: trunk/LayoutTests/fast/events/ios/click-event-while-editing-node.html (0 => 232040)


--- trunk/LayoutTests/fast/events/ios/click-event-while-editing-node.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/click-event-while-editing-node.html	2018-05-22 00:19:28 UTC (rev 232040)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+    <script src=""
+    <script src=""
+</head>
+<body>
+    <div id="description">
+        <p>The click event should be fired on a node that is being edited.</p>
+        <p>The click count in the editable node is: <span id="clicks">0</span></p>
+    </div>
+    <div id="editable" contenteditable="true" style="width: 100%; height: 500px; border:1px solid black;">
+        <p>Click me!</p>
+    </div>
+</body>
+<script>
+clickCount = 0;
+editable.addEventListener("click", function(){
+     clickCount += 1;
+     clicks.textContent = clickCount;
+});
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    jsTestIsAsync = true;
+    UIHelper.activateAndWaitForInputSessionAt(50, 300).then(() => {
+        UIHelper.tapAt(50, 300).then(() => {
+            shouldBeEqualToString("document.getElementById('clicks').textContent", `${clickCount}`);
+            finishJSTest();
+        });
+    });
+}
+</script>
+<script src=""
+</html>

Modified: trunk/Source/WebKit/ChangeLog (232039 => 232040)


--- trunk/Source/WebKit/ChangeLog	2018-05-22 00:14:39 UTC (rev 232039)
+++ trunk/Source/WebKit/ChangeLog	2018-05-22 00:19:28 UTC (rev 232040)
@@ -1,3 +1,22 @@
+2018-05-21  Aditya Keerthi  <[email protected]>
+
+        [iOS] Click events only fire once when editing
+        https://bugs.webkit.org/show_bug.cgi?id=185777
+
+        Reviewed by Tim Horton.
+
+        gestureRecognizerShouldBegin: was returning false for the single tap gesture when a node was being
+        edited. This is an artifact of how the gesture was previously handled with the text selection assistant.
+        This condition is now removed, allowing the single tap gesture to go through and correctly propagate the
+        click event.
+
+        Also added an early return to _didGetTapHighlightForRequest: in order to prevent the tap highlight from
+        being shown when the node is already being assisted.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
+        (-[WKContentView gestureRecognizerShouldBegin:]):
+
 2018-05-21  Daniel Bates  <[email protected]>
 
         REGRESSION (r231107): CSP report-only policies are ignored for beacon, importScripts, fetch(), EventSource, and XHR

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (232039 => 232040)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-05-22 00:14:39 UTC (rev 232039)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2018-05-22 00:19:28 UTC (rev 232040)
@@ -1175,6 +1175,9 @@
     if (!_isTapHighlightIDValid || _latestTapID != requestID)
         return;
 
+    if (_potentialTapInProgress && hasAssistedNode(_assistedNodeInformation) && _positionInformation.nodeAtPositionIsAssistedNode)
+        return;
+
     _isTapHighlightIDValid = NO;
 
     _tapHighlightInformation.quads = highlightedQuads;
@@ -1546,8 +1549,7 @@
     if (gestureRecognizer == _highlightLongPressGestureRecognizer
         || gestureRecognizer == _doubleTapGestureRecognizer
         || gestureRecognizer == _nonBlockingDoubleTapGestureRecognizer
-        || gestureRecognizer == _twoFingerDoubleTapGestureRecognizer
-        || gestureRecognizer == _singleTapGestureRecognizer) {
+        || gestureRecognizer == _twoFingerDoubleTapGestureRecognizer) {
 
         if (hasAssistedNode(_assistedNodeInformation)) {
             // Request information about the position with sync message.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to