Title: [241877] branches/safari-607-branch

Diff

Modified: branches/safari-607-branch/LayoutTests/ChangeLog (241876 => 241877)


--- branches/safari-607-branch/LayoutTests/ChangeLog	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/LayoutTests/ChangeLog	2019-02-21 21:26:37 UTC (rev 241877)
@@ -1,3 +1,7 @@
+2019-02-20  Alan Coon  <[email protected]>
+
+        Revert r237978. rdar://problem/48244945
+
 2019-02-13  Babak Shafiei  <[email protected]>
 
         Cherry-pick r241499. rdar://problem/48065634

Deleted: branches/safari-607-branch/LayoutTests/fast/events/click-handler-on-body-simple-expected.txt (241876 => 241877)


--- branches/safari-607-branch/LayoutTests/fast/events/click-handler-on-body-simple-expected.txt	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/LayoutTests/fast/events/click-handler-on-body-simple-expected.txt	2019-02-21 21:26:37 UTC (rev 241877)
@@ -1 +0,0 @@
-clicked

Deleted: branches/safari-607-branch/LayoutTests/fast/events/click-handler-on-body-simple.html (241876 => 241877)


--- branches/safari-607-branch/LayoutTests/fast/events/click-handler-on-body-simple.html	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/LayoutTests/fast/events/click-handler-on-body-simple.html	2019-02-21 21:26:37 UTC (rev 241877)
@@ -1,37 +0,0 @@
-<html>
-<head>
-<script src=""
-<style>
-div {
-    width: 400px;
-    height: 400px;
-}
-</style>
-<script>
-async function test() {
-    if (!window.testRunner || !testRunner.runUIScript)
-        return;
-
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-
-    document.body.addEventListener("click", function( event ) {
-        result.innerHTML = "clicked";
-    }, false);
-
-    let element = document.getElementById("clickme");
-    let rect = element.getBoundingClientRect();
-    let x = rect.left + rect.width / 2;
-    let y = rect.top + rect.height / 2;
-
-    await UIHelper.activateAt(x, y);
-
-    testRunner.notifyDone();
-}
-</script>
-</head>
-<body _onload_="test()">
-<div id=clickme></div>
-<pre id=result></pre>
-</body>
-</html>

Deleted: branches/safari-607-branch/LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple-expected.txt (241876 => 241877)


--- branches/safari-607-branch/LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple-expected.txt	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple-expected.txt	2019-02-21 21:26:37 UTC (rev 241877)
@@ -1 +0,0 @@
-tapped

Deleted: branches/safari-607-branch/LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple.html (241876 => 241877)


--- branches/safari-607-branch/LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple.html	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/LayoutTests/fast/events/touch/ios/touch-handler-on-body-simple.html	2019-02-21 21:26:37 UTC (rev 241877)
@@ -1,37 +0,0 @@
-<html>
-<head>
-<script src=""
-<style>
-div {
-    width: 400px;
-    height: 400px;
-}
-</style>
-<script>
-async function test() {
-    if (!window.testRunner || !testRunner.runUIScript)
-        return;
-
-    testRunner.dumpAsText();
-    testRunner.waitUntilDone();
-
-    document.body.addEventListener("touchstart", function( event ) {
-        result.innerHTML = "tapped";
-    }, false);
-
-    let element = document.getElementById("tapthis");
-    let rect = element.getBoundingClientRect();
-    let x = rect.left + rect.width / 2;
-    let y = rect.top + rect.height / 2;
-
-	await tapAtPoint(x, y);
-
-    testRunner.notifyDone();
-}
-</script>
-</head>
-<body _onload_="test()">
-<div id=tapthis></div>
-<pre id=result></pre>
-</body>
-</html>

Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (241876 => 241877)


--- branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog	2019-02-21 21:26:37 UTC (rev 241877)
@@ -1,3 +1,7 @@
+2019-02-20  Alan Coon  <[email protected]>
+
+        Revert r237978. rdar://problem/48244945
+
 2019-02-18  Babak Shafiei  <[email protected]>
 
         Apply patch. rdar://problem/48122553

Modified: branches/safari-607-branch/Source/WebCore/page/ios/FrameIOS.mm (241876 => 241877)


--- branches/safari-607-branch/Source/WebCore/page/ios/FrameIOS.mm	2019-02-21 21:06:37 UTC (rev 241876)
+++ branches/safari-607-branch/Source/WebCore/page/ios/FrameIOS.mm	2019-02-21 21:26:37 UTC (rev 241877)
@@ -390,6 +390,9 @@
 Node* Frame::nodeRespondingToClickEvents(const FloatPoint& viewportLocation, FloatPoint& adjustedViewportLocation, SecurityOrigin* securityOrigin)
 {
     auto&& ancestorRespondingToClickEvents = [securityOrigin](const HitTestResult& hitTestResult, Node* terminationNode, IntRect* nodeBounds) -> Node* {
+        bool bodyHasBeenReached = false;
+        bool pointerCursorStillValid = true;
+
         if (nodeBounds)
             *nodeBounds = IntRect();
 
@@ -397,8 +400,35 @@
         if (!node || (securityOrigin && !securityOrigin->isSameOriginAs(node->document().securityOrigin())))
             return nullptr;
 
+        Node* pointerCursorNode = nullptr;
         for (; node && node != terminationNode; node = node->parentInComposedTree()) {
+            // We only accept pointer nodes before reaching the body tag.
+            if (node->hasTagName(HTMLNames::bodyTag)) {
+#if USE(UIKIT_EDITING)
+                // Make sure we cover the case of an empty editable body.
+                if (!pointerCursorNode && node->isContentEditable())
+                    pointerCursorNode = node;
+#endif
+                bodyHasBeenReached = true;
+                pointerCursorStillValid = false;
+            }
+
+            // If we already have a pointer, and we reach a table, don't accept it.
+            if (pointerCursorNode && (node->hasTagName(HTMLNames::tableTag) || node->hasTagName(HTMLNames::tbodyTag)))
+                pointerCursorStillValid = false;
+
+            // If we haven't reached the body, and we are still paying attention to pointer cursors, and the node has a pointer cursor...
+            if (pointerCursorStillValid && node->renderStyle() && node->renderStyle()->cursor() == CursorType::Pointer)
+                pointerCursorNode = node;
+            // We want the lowest unbroken chain of pointer cursors.
+            else if (pointerCursorNode)
+                pointerCursorStillValid = false;
+
             if (node->willRespondToMouseClickEvents() || node->willRespondToMouseMoveEvents() || (is<Element>(*node) && downcast<Element>(*node).isMouseFocusable())) {
+                // If we're at the body or higher, use the pointer cursor node (which may be null).
+                if (bodyHasBeenReached)
+                    node = pointerCursorNode;
+
                 // If we are interested about the frame, use it.
                 if (nodeBounds) {
                     // This is a check to see whether this node is an area element. The only way this can happen is if this is the first check.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to