Title: [247736] branches/safari-608-branch
Revision
247736
Author
[email protected]
Date
2019-07-23 13:40:46 -0700 (Tue, 23 Jul 2019)

Log Message

Cherry-pick r247650. rdar://problem/53449730

    Links stop working after long-pressing a link (WK1)
    https://bugs.webkit.org/show_bug.cgi?id=199952
    <rdar://problem/52291860>

    Patch by Antoine Quint <[email protected]> on 2019-07-19
    Reviewed by Wenson Hsieh.

    Source/WebCore:

    Test: fast/events/touch/ios/click-after-long-press.html

    When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
    WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
    process the next tap after a drag interaction.

    * page/ios/EventHandlerIOS.mm:
    (WebCore::EventHandler::tryToBeginDragAtPoint):

    LayoutTests:

    * fast/events/touch/ios/click-after-long-press-expected.txt: Added.
    * fast/events/touch/ios/click-after-long-press.html: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247650 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-608-branch/LayoutTests/ChangeLog (247735 => 247736)


--- branches/safari-608-branch/LayoutTests/ChangeLog	2019-07-23 20:39:25 UTC (rev 247735)
+++ branches/safari-608-branch/LayoutTests/ChangeLog	2019-07-23 20:40:46 UTC (rev 247736)
@@ -1,3 +1,43 @@
+2019-07-23  Alan Coon  <[email protected]>
+
+        Cherry-pick r247650. rdar://problem/53449730
+
+    Links stop working after long-pressing a link (WK1)
+    https://bugs.webkit.org/show_bug.cgi?id=199952
+    <rdar://problem/52291860>
+    
+    Patch by Antoine Quint <[email protected]> on 2019-07-19
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebCore:
+    
+    Test: fast/events/touch/ios/click-after-long-press.html
+    
+    When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
+    WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
+    process the next tap after a drag interaction.
+    
+    * page/ios/EventHandlerIOS.mm:
+    (WebCore::EventHandler::tryToBeginDragAtPoint):
+    
+    LayoutTests:
+    
+    * fast/events/touch/ios/click-after-long-press-expected.txt: Added.
+    * fast/events/touch/ios/click-after-long-press.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-19  Antoine Quint  <[email protected]>
+
+            Links stop working after long-pressing a link (WK1)
+            https://bugs.webkit.org/show_bug.cgi?id=199952
+            <rdar://problem/52291860>
+
+            Reviewed by Wenson Hsieh.
+
+            * fast/events/touch/ios/click-after-long-press-expected.txt: Added.
+            * fast/events/touch/ios/click-after-long-press.html: Added.
+
 2019-07-19  Kocsen Chung  <[email protected]>
 
         Cherry-pick r247648. rdar://problem/53279094

Added: branches/safari-608-branch/LayoutTests/fast/events/touch/ios/click-after-long-press-expected.txt (0 => 247736)


--- branches/safari-608-branch/LayoutTests/fast/events/touch/ios/click-after-long-press-expected.txt	                        (rev 0)
+++ branches/safari-608-branch/LayoutTests/fast/events/touch/ios/click-after-long-press-expected.txt	2019-07-23 20:40:46 UTC (rev 247736)
@@ -0,0 +1 @@
+PASS

Added: branches/safari-608-branch/LayoutTests/fast/events/touch/ios/click-after-long-press.html (0 => 247736)


--- branches/safari-608-branch/LayoutTests/fast/events/touch/ios/click-after-long-press.html	                        (rev 0)
+++ branches/safari-608-branch/LayoutTests/fast/events/touch/ios/click-after-long-press.html	2019-07-23 20:40:46 UTC (rev 247736)
@@ -0,0 +1,70 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<html>
+<head>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        let ranAllSteps = false;
+
+        function longPress(continuation)
+        {
+            // We start by long-pressing on the target which should display a menu.
+            testRunner.runUIScript(`
+            (function() {
+                uiController.longPressAtPoint(100, 100, function() {
+                    uiController.uiScriptComplete();
+                });
+             })();`, tapToDismiss);
+        }
+
+        function tapToDismiss()
+        {
+            // Then we tap to dismiss the panel.
+            testRunner.runUIScript(`
+            (function() {
+                uiController.singleTapAtPoint(0, 0, function() {
+                    uiController.uiScriptComplete();
+                });
+             })();`, tapToClick);
+        }
+
+        function tapToClick()
+        {
+            // And tap again to trigger a click event.
+            document.getElementById('target').addEventListener("click", event => {
+                event.currentTarget.textContent = "PASS";
+                testRunner.notifyDone();
+            });
+
+            testRunner.runUIScript(`
+            (function() {
+                uiController.singleTapAtPoint(100, 100, function() {
+                    uiController.uiScriptComplete();
+                });
+             })();`);
+        }
+
+        window.addEventListener('load', event => {
+            if (testRunner.runUIScript)
+                longPress();
+        });
+    </script>
+    <style>
+        #target {
+            height: 100px;
+            width: 200px;
+        }
+    </style>
+    <meta name="viewport" content="initial-scale=1">
+</head>
+<body>
+<div id="target">
+    <img src="" width="320" height="240" alt="Dice">
+    FAIL.
+</div>
+</body>
+</html>

Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (247735 => 247736)


--- branches/safari-608-branch/Source/WebCore/ChangeLog	2019-07-23 20:39:25 UTC (rev 247735)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog	2019-07-23 20:40:46 UTC (rev 247736)
@@ -1,3 +1,49 @@
+2019-07-23  Alan Coon  <[email protected]>
+
+        Cherry-pick r247650. rdar://problem/53449730
+
+    Links stop working after long-pressing a link (WK1)
+    https://bugs.webkit.org/show_bug.cgi?id=199952
+    <rdar://problem/52291860>
+    
+    Patch by Antoine Quint <[email protected]> on 2019-07-19
+    Reviewed by Wenson Hsieh.
+    
+    Source/WebCore:
+    
+    Test: fast/events/touch/ios/click-after-long-press.html
+    
+    When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
+    WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
+    process the next tap after a drag interaction.
+    
+    * page/ios/EventHandlerIOS.mm:
+    (WebCore::EventHandler::tryToBeginDragAtPoint):
+    
+    LayoutTests:
+    
+    * fast/events/touch/ios/click-after-long-press-expected.txt: Added.
+    * fast/events/touch/ios/click-after-long-press.html: Added.
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247650 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-07-19  Antoine Quint  <[email protected]>
+
+            Links stop working after long-pressing a link (WK1)
+            https://bugs.webkit.org/show_bug.cgi?id=199952
+            <rdar://problem/52291860>
+
+            Reviewed by Wenson Hsieh.
+
+            Test: fast/events/touch/ios/click-after-long-press.html
+
+            When EventHandler::tryToBeginDragAtPoint() is called, we must reset m_mousePressed to false so that
+            WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed() when we would
+            process the next tap after a drag interaction.
+
+            * page/ios/EventHandlerIOS.mm:
+            (WebCore::EventHandler::tryToBeginDragAtPoint):
+
 2019-07-18  Alan Coon  <[email protected]>
 
         Cherry-pick r247568. rdar://problem/53279098

Modified: branches/safari-608-branch/Source/WebCore/page/ios/EventHandlerIOS.mm (247735 => 247736)


--- branches/safari-608-branch/Source/WebCore/page/ios/EventHandlerIOS.mm	2019-07-23 20:39:25 UTC (rev 247735)
+++ branches/safari-608-branch/Source/WebCore/page/ios/EventHandlerIOS.mm	2019-07-23 20:40:46 UTC (rev 247736)
@@ -698,6 +698,9 @@
     bool handledDrag = m_mouseDownMayStartDrag && handleMouseDraggedEvent(hitTestedMouseEvent, DontCheckDragHysteresis);
     // Reset this bit to prevent autoscrolling from updating the selection with the last mouse location.
     m_mouseDownMayStartSelect = false;
+    // Reset this bit to ensure that WebChromeClientIOS::observedContentChange() is called by EventHandler::mousePressed()
+    // when we would process the next tap after a drag interaction.
+    m_mousePressed = false;
     return handledDrag;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to