Title: [272947] branches/safari-611-branch
Revision
272947
Author
repst...@apple.com
Date
2021-02-16 17:16:10 -0800 (Tue, 16 Feb 2021)

Log Message

Cherry-pick r272435. rdar://problem/74410448

    [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes
    https://bugs.webkit.org/show_bug.cgi?id=221460

    Reviewed by Zalan Bujtas.

    Source/WebCore:

    Descendants of pointer-events:none boxes may still be hittestable if they override the value.
    LFC integration hit testing code didn't take this into account.

    Test: fast/events/hittest-pointer-event-none-descendants.html

    * layout/integration/LayoutIntegrationLineLayout.cpp:
    (WebCore::LayoutIntegration::LineLayout::hitTest):

    Replaced and inline-block boxes do the visibility/pointer-events test themselves.
    This code just needs to take care of text boxes.

    LayoutTests:

    * fast/events/hittest-pointer-event-none-descendants-expected.html: Added.
    * fast/events/hittest-pointer-event-none-descendants.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-611-branch/LayoutTests/ChangeLog (272946 => 272947)


--- branches/safari-611-branch/LayoutTests/ChangeLog	2021-02-17 01:15:54 UTC (rev 272946)
+++ branches/safari-611-branch/LayoutTests/ChangeLog	2021-02-17 01:16:10 UTC (rev 272947)
@@ -1,5 +1,45 @@
 2021-02-16  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272435. rdar://problem/74410448
+
+    [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes
+    https://bugs.webkit.org/show_bug.cgi?id=221460
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Descendants of pointer-events:none boxes may still be hittestable if they override the value.
+    LFC integration hit testing code didn't take this into account.
+    
+    Test: fast/events/hittest-pointer-event-none-descendants.html
+    
+    * layout/integration/LayoutIntegrationLineLayout.cpp:
+    (WebCore::LayoutIntegration::LineLayout::hitTest):
+    
+    Replaced and inline-block boxes do the visibility/pointer-events test themselves.
+    This code just needs to take care of text boxes.
+    
+    LayoutTests:
+    
+    * fast/events/hittest-pointer-event-none-descendants-expected.html: Added.
+    * fast/events/hittest-pointer-event-none-descendants.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-05  Antti Koivisto  <an...@apple.com>
+
+            [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes
+            https://bugs.webkit.org/show_bug.cgi?id=221460
+
+            Reviewed by Zalan Bujtas.
+
+            * fast/events/hittest-pointer-event-none-descendants-expected.html: Added.
+            * fast/events/hittest-pointer-event-none-descendants.html: Added.
+
+2021-02-16  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272390. rdar://problem/74409535
 
     AX: expose focusable elements even if element or ancestor has aria-hidden=true

Added: branches/safari-611-branch/LayoutTests/fast/events/hittest-pointer-event-none-descendants-expected.html (0 => 272947)


--- branches/safari-611-branch/LayoutTests/fast/events/hittest-pointer-event-none-descendants-expected.html	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/events/hittest-pointer-event-none-descendants-expected.html	2021-02-17 01:16:10 UTC (rev 272947)
@@ -0,0 +1,10 @@
+<style>
+.container { display:inline-block; }
+.target { background-color: green; height:200px; width:200px; }
+</style>
+<body>
+<div class=container>
+<div class=target>
+hover me
+</div>
+</div>

Added: branches/safari-611-branch/LayoutTests/fast/events/hittest-pointer-event-none-descendants.html (0 => 272947)


--- branches/safari-611-branch/LayoutTests/fast/events/hittest-pointer-event-none-descendants.html	                        (rev 0)
+++ branches/safari-611-branch/LayoutTests/fast/events/hittest-pointer-event-none-descendants.html	2021-02-17 01:16:10 UTC (rev 272947)
@@ -0,0 +1,26 @@
+<style>
+.container { pointer-events:none; display:inline-block; }
+.target { background-color: red; height:200px; width:200px; pointer-events:auto}
+.target:hover { background-color: green; }
+</style>
+<script>
+async function test() {
+    if (!window.testRunner)
+        return;
+    testRunner.waitUntilDone();
+
+    await new Promise(requestAnimationFrame);
+
+    eventSender.mouseMoveTo(100, 100);
+
+    await new Promise(requestAnimationFrame);
+    
+    testRunner.notifyDone();
+}
+</script>
+<body _onload_="test()">
+<div class=container>
+<div class=target>
+hover me
+</div>
+</div>

Modified: branches/safari-611-branch/LayoutTests/platform/ios/TestExpectations (272946 => 272947)


--- branches/safari-611-branch/LayoutTests/platform/ios/TestExpectations	2021-02-17 01:15:54 UTC (rev 272946)
+++ branches/safari-611-branch/LayoutTests/platform/ios/TestExpectations	2021-02-17 01:16:10 UTC (rev 272947)
@@ -473,6 +473,7 @@
 fast/events/frame-click-focus.html [ Skip ]
 fast/events/frame-detached-in-mousedown.html [ Skip ]
 fast/events/frame-scroll-fake-mouse-move.html [ Skip ]
+fast/events/hittest-pointer-event-none-descendants.html [ Skip ]
 fast/events/iframe-onmousemove.html [ Skip ]
 fast/events/input-events-drag-and-drop.html [ Skip ]
 fast/events/input-events-insert-by-drop.html [ Skip ]

Modified: branches/safari-611-branch/Source/WebCore/ChangeLog (272946 => 272947)


--- branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-17 01:15:54 UTC (rev 272946)
+++ branches/safari-611-branch/Source/WebCore/ChangeLog	2021-02-17 01:16:10 UTC (rev 272947)
@@ -1,5 +1,53 @@
 2021-02-16  Ruben Turcios  <rubent...@apple.com>
 
+        Cherry-pick r272435. rdar://problem/74410448
+
+    [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes
+    https://bugs.webkit.org/show_bug.cgi?id=221460
+    
+    Reviewed by Zalan Bujtas.
+    
+    Source/WebCore:
+    
+    Descendants of pointer-events:none boxes may still be hittestable if they override the value.
+    LFC integration hit testing code didn't take this into account.
+    
+    Test: fast/events/hittest-pointer-event-none-descendants.html
+    
+    * layout/integration/LayoutIntegrationLineLayout.cpp:
+    (WebCore::LayoutIntegration::LineLayout::hitTest):
+    
+    Replaced and inline-block boxes do the visibility/pointer-events test themselves.
+    This code just needs to take care of text boxes.
+    
+    LayoutTests:
+    
+    * fast/events/hittest-pointer-event-none-descendants-expected.html: Added.
+    * fast/events/hittest-pointer-event-none-descendants.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@272435 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-02-05  Antti Koivisto  <an...@apple.com>
+
+            [LFC][Integration] Hit testing broken for descendants of pointer-events:none boxes
+            https://bugs.webkit.org/show_bug.cgi?id=221460
+
+            Reviewed by Zalan Bujtas.
+
+            Descendants of pointer-events:none boxes may still be hittestable if they override the value.
+            LFC integration hit testing code didn't take this into account.
+
+            Test: fast/events/hittest-pointer-event-none-descendants.html
+
+            * layout/integration/LayoutIntegrationLineLayout.cpp:
+            (WebCore::LayoutIntegration::LineLayout::hitTest):
+
+            Replaced and inline-block boxes do the visibility/pointer-events test themselves.
+            This code just needs to take care of text boxes.
+
+2021-02-16  Ruben Turcios  <rubent...@apple.com>
+
         Cherry-pick r272394. rdar://problem/74409285
 
     Avoid creating JS wrapper on a removed node when the subtree is not observable

Modified: branches/safari-611-branch/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (272946 => 272947)


--- branches/safari-611-branch/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-02-17 01:15:54 UTC (rev 272946)
+++ branches/safari-611-branch/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-02-17 01:16:10 UTC (rev 272947)
@@ -506,13 +506,13 @@
         if (!locationInContainer.intersects(runRect))
             continue;
 
-        auto& style = run.style();
-        if (style.visibility() != Visibility::Visible || style.pointerEvents() == PointerEvents::None)
-            continue;
-
         auto& renderer = m_boxTree.rendererForLayoutBox(run.layoutBox());
 
         if (is<RenderText>(renderer)) {
+            auto& style = run.style();
+            if (style.visibility() != Visibility::Visible || style.pointerEvents() == PointerEvents::None)
+                continue;
+
             renderer.updateHitTestResult(result, locationInContainer.point() - toLayoutSize(accumulatedOffset));
             if (result.addNodeToListBasedTestResult(renderer.nodeForHitTest(), request, locationInContainer, runRect) == HitTestProgress::Stop)
                 return true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to