Title: [272435] trunk
Revision
272435
Author
[email protected]
Date
2021-02-05 12:48:22 -0800 (Fri, 05 Feb 2021)

Log Message

[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.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (272434 => 272435)


--- trunk/LayoutTests/ChangeLog	2021-02-05 20:27:19 UTC (rev 272434)
+++ trunk/LayoutTests/ChangeLog	2021-02-05 20:48:22 UTC (rev 272435)
@@ -1,3 +1,13 @@
+2021-02-05  Antti Koivisto  <[email protected]>
+
+        [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-05  Youenn Fablet  <[email protected]>
 
         Enable audio capture for speech recognition in GPUProcess

Added: trunk/LayoutTests/fast/events/hittest-pointer-event-none-descendants-expected.html (0 => 272435)


--- trunk/LayoutTests/fast/events/hittest-pointer-event-none-descendants-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/hittest-pointer-event-none-descendants-expected.html	2021-02-05 20:48:22 UTC (rev 272435)
@@ -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: trunk/LayoutTests/fast/events/hittest-pointer-event-none-descendants.html (0 => 272435)


--- trunk/LayoutTests/fast/events/hittest-pointer-event-none-descendants.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/hittest-pointer-event-none-descendants.html	2021-02-05 20:48:22 UTC (rev 272435)
@@ -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: trunk/LayoutTests/platform/ios/TestExpectations (272434 => 272435)


--- trunk/LayoutTests/platform/ios/TestExpectations	2021-02-05 20:27:19 UTC (rev 272434)
+++ trunk/LayoutTests/platform/ios/TestExpectations	2021-02-05 20:48:22 UTC (rev 272435)
@@ -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: trunk/Source/WebCore/ChangeLog (272434 => 272435)


--- trunk/Source/WebCore/ChangeLog	2021-02-05 20:27:19 UTC (rev 272434)
+++ trunk/Source/WebCore/ChangeLog	2021-02-05 20:48:22 UTC (rev 272435)
@@ -1,3 +1,21 @@
+2021-02-05  Antti Koivisto  <[email protected]>
+
+        [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-05  Youenn Fablet  <[email protected]>
 
         Enable audio capture for speech recognition in GPUProcess

Modified: trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp (272434 => 272435)


--- trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-02-05 20:27:19 UTC (rev 272434)
+++ trunk/Source/WebCore/layout/integration/LayoutIntegrationLineLayout.cpp	2021-02-05 20:48:22 UTC (rev 272435)
@@ -509,13 +509,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
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to