Title: [271054] trunk
Revision
271054
Author
[email protected]
Date
2020-12-22 08:48:30 -0800 (Tue, 22 Dec 2020)

Log Message

Sibling element wheel event regions can be wrong
https://bugs.webkit.org/show_bug.cgi?id=220071
Source/WebCore:

<rdar://problem/72435466>

Reviewed by Daniel Bates.

RenderStyle contains eventListenerRegionTypes() data which derive from registered
wheel event handlers, so style sharing needs to avoid sharing style between elements
with different handlers. For now, just disable style sharing for any elements
which event handlers.

Test: fast/scrolling/mac/wheel-event-listener-region-siblings.html

* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::canShareStyleWithElement const):

LayoutTests:

Reviewed by Daniel Bates.

* fast/scrolling/mac/wheel-event-listener-region-siblings-expected.txt: Added.
* fast/scrolling/mac/wheel-event-listener-region-siblings.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (271053 => 271054)


--- trunk/LayoutTests/ChangeLog	2020-12-22 16:09:03 UTC (rev 271053)
+++ trunk/LayoutTests/ChangeLog	2020-12-22 16:48:30 UTC (rev 271054)
@@ -1,5 +1,15 @@
 2020-12-22  Simon Fraser  <[email protected]>
 
+        Sibling element wheel event regions can be wrong
+        https://bugs.webkit.org/show_bug.cgi?id=220071
+
+        Reviewed by Daniel Bates.
+
+        * fast/scrolling/mac/wheel-event-listener-region-siblings-expected.txt: Added.
+        * fast/scrolling/mac/wheel-event-listener-region-siblings.html: Added.
+
+2020-12-22  Simon Fraser  <[email protected]>
+
         Layout overflow is computed incorrectly inside flexbox (breaks sticky positioning)
         https://bugs.webkit.org/show_bug.cgi?id=220075
 

Added: trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-siblings-expected.txt (0 => 271054)


--- trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-siblings-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-siblings-expected.txt	2020-12-22 16:48:30 UTC (rev 271054)
@@ -0,0 +1,25 @@
+Passive
+Active
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (drawsContent 1)
+      (backgroundColor #FFFFFF)
+      (event region
+        (rect (0,0) width=800 height=600)
+      (wheel event listener region
+        (rect (28,20) width=102 height=102)
+        (rect (28,142) width=102 height=102)
+        (non-passive
+          (rect (28,142) width=102 height=102)
+        )
+      )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-siblings.html (0 => 271054)


--- trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-siblings.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/wheel-event-listener-region-siblings.html	2020-12-22 16:48:30 UTC (rev 271054)
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<html>
+<style>
+    .box {
+        margin: 20px;
+        width: 100px;
+        height: 100px;
+        border: 1px solid black;
+    }
+    
+</style>
+<script>
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    window.addEventListener('load', () => {
+        document.getElementById('passive').addEventListener('wheel', () => {
+            console.log('passive listener');
+        }, { passive: true });
+
+        document.getElementById('active').addEventListener('wheel', () => {
+            console.log('active listener');
+        }, { passive: false });
+
+        if (window.internals)
+            document.getElementById('console').textContent = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION | internals.LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES);
+
+    }, false);
+</script>
+<body>
+    <div class="box" id="passive">Passive</div>
+    <div class="box" id="active">Active</div>
+<pre id="console"></pre>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (271053 => 271054)


--- trunk/Source/WebCore/ChangeLog	2020-12-22 16:09:03 UTC (rev 271053)
+++ trunk/Source/WebCore/ChangeLog	2020-12-22 16:48:30 UTC (rev 271054)
@@ -1,5 +1,23 @@
 2020-12-22  Simon Fraser  <[email protected]>
 
+        Sibling element wheel event regions can be wrong
+        https://bugs.webkit.org/show_bug.cgi?id=220071
+        <rdar://problem/72435466>
+
+        Reviewed by Daniel Bates.
+
+        RenderStyle contains eventListenerRegionTypes() data which derive from registered
+        wheel event handlers, so style sharing needs to avoid sharing style between elements
+        with different handlers. For now, just disable style sharing for any elements
+        which event handlers.
+
+        Test: fast/scrolling/mac/wheel-event-listener-region-siblings.html
+
+        * style/StyleSharingResolver.cpp:
+        (WebCore::Style::SharingResolver::canShareStyleWithElement const):
+
+2020-12-22  Simon Fraser  <[email protected]>
+
         Layout overflow is computed incorrectly inside flexbox (breaks sticky positioning)
         https://bugs.webkit.org/show_bug.cgi?id=220075
         <rdar://problem/70956639>

Modified: trunk/Source/WebCore/style/StyleSharingResolver.cpp (271053 => 271054)


--- trunk/Source/WebCore/style/StyleSharingResolver.cpp	2020-12-22 16:09:03 UTC (rev 271053)
+++ trunk/Source/WebCore/style/StyleSharingResolver.cpp	2020-12-22 16:48:30 UTC (rev 271054)
@@ -300,6 +300,11 @@
     if (candidateElement.shadowRoot() && !candidateElement.shadowRoot()->styleScope().resolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty())
         return false;
 
+#if ENABLE(WHEEL_EVENT_REGIONS)
+    if (candidateElement.hasEventListeners() || element.hasEventListeners())
+        return false;
+#endif
+
 #if ENABLE(FULLSCREEN_API)
     if (&candidateElement == m_document.fullscreenManager().currentFullscreenElement() || &element == m_document.fullscreenManager().currentFullscreenElement())
         return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to