Title: [257938] trunk
Revision
257938
Author
simon.fra...@apple.com
Date
2020-03-05 12:32:14 -0800 (Thu, 05 Mar 2020)

Log Message

Generate layer event regions for async overflow scrolling on macOS
https://bugs.webkit.org/show_bug.cgi?id=208649

Reviewed by Antti Koivisto.

Source/WebCore:

Turn on the existing code for event region generation on macOS, and generate event
regions when async overflow scroll is enabled.

Tweak the region debug color to be more visible.

Tests: fast/scrolling/mac/border-radius-event-region.html
       fast/scrolling/mac/event-region-visibility-hidden.html

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateEventRegion):
(WebCore::RenderLayerBacking::paintDebugOverlays):

LayoutTests:

* TestExpectations:
* fast/scrolling/mac/border-radius-event-region-expected.txt: Added.
* fast/scrolling/mac/border-radius-event-region.html: Added.
* fast/scrolling/mac/event-region-visibility-hidden-expected.txt: Added.
* fast/scrolling/mac/event-region-visibility-hidden.html: Added.
* platform/mac-wk2/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (257937 => 257938)


--- trunk/LayoutTests/ChangeLog	2020-03-05 19:44:20 UTC (rev 257937)
+++ trunk/LayoutTests/ChangeLog	2020-03-05 20:32:14 UTC (rev 257938)
@@ -1,3 +1,17 @@
+2020-03-05  Simon Fraser  <simon.fra...@apple.com>
+
+        Generate layer event regions for async overflow scrolling on macOS
+        https://bugs.webkit.org/show_bug.cgi?id=208649
+
+        Reviewed by Antti Koivisto.
+
+        * TestExpectations:
+        * fast/scrolling/mac/border-radius-event-region-expected.txt: Added.
+        * fast/scrolling/mac/border-radius-event-region.html: Added.
+        * fast/scrolling/mac/event-region-visibility-hidden-expected.txt: Added.
+        * fast/scrolling/mac/event-region-visibility-hidden.html: Added.
+        * platform/mac-wk2/TestExpectations:
+
 2020-03-05  Jason Lawrence  <lawrenc...@apple.com>
 
         REGRESSION: (r257760?) [ Mac wk2 Debug ] ASSERTION FAILED: child->parentObject() == this in WebCore::AccessibilityObject::insertChild

Modified: trunk/LayoutTests/TestExpectations (257937 => 257938)


--- trunk/LayoutTests/TestExpectations	2020-03-05 19:44:20 UTC (rev 257937)
+++ trunk/LayoutTests/TestExpectations	2020-03-05 20:32:14 UTC (rev 257938)
@@ -46,6 +46,7 @@
 fast/events/touch/ios [ Skip ]
 fast/history/ios [ Skip ]
 fast/scrolling/ios [ Skip ]
+fast/scrolling/mac [ Skip ]
 fast/scrolling/ipad [ Skip ]
 fast/text/mac [ Skip ]
 scrollingcoordinator [ Skip ]

Added: trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt (0 => 257938)


--- trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt	2020-03-05 20:32:14 UTC (rev 257938)
@@ -0,0 +1,273 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 785.00 1653.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 785.00 1653.00)
+      (contentsOpaque 1)
+      (children 24
+        (GraphicsLayer
+          (position 8.00 13.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 13.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (6,0) width=194 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 13.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (31,0) width=169 height=4)
+            (rect (15,4) width=185 height=11)
+            (rect (4,15) width=196 height=16)
+            (rect (0,31) width=200 height=169)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 217.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (172,0) width=28 height=3)
+            (rect (144,3) width=56 height=6)
+            (rect (117,9) width=83 height=10)
+            (rect (92,19) width=108 height=13)
+            (rect (70,32) width=130 height=17)
+            (rect (49,49) width=151 height=21)
+            (rect (32,70) width=168 height=22)
+            (rect (19,92) width=181 height=25)
+            (rect (9,117) width=191 height=27)
+            (rect (3,144) width=197 height=28)
+            (rect (0,172) width=200 height=28)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 217.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (20,0) width=180 height=21)
+            (rect (6,21) width=194 height=55)
+            (rect (0,76) width=200 height=124)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 217.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (15,0) width=185 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 421.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 421.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=194 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 421.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=169 height=4)
+            (rect (0,4) width=185 height=11)
+            (rect (0,15) width=196 height=16)
+            (rect (0,31) width=200 height=169)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 625.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=28 height=3)
+            (rect (0,3) width=56 height=6)
+            (rect (0,9) width=83 height=10)
+            (rect (0,19) width=108 height=13)
+            (rect (0,32) width=130 height=17)
+            (rect (0,49) width=151 height=21)
+            (rect (0,70) width=168 height=22)
+            (rect (0,92) width=181 height=25)
+            (rect (0,117) width=191 height=27)
+            (rect (0,144) width=197 height=28)
+            (rect (0,172) width=200 height=28)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 625.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=180 height=21)
+            (rect (0,21) width=194 height=54)
+            (rect (0,75) width=200 height=125)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 625.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=185 height=6)
+            (rect (0,6) width=200 height=194)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 829.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 829.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (6,194) width=194 height=6)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 829.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=169)
+            (rect (4,169) width=196 height=16)
+            (rect (15,185) width=185 height=11)
+            (rect (31,196) width=169 height=4)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 1033.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=28)
+            (rect (3,28) width=197 height=28)
+            (rect (9,56) width=191 height=27)
+            (rect (19,83) width=181 height=25)
+            (rect (32,108) width=168 height=22)
+            (rect (49,130) width=151 height=21)
+            (rect (70,151) width=130 height=17)
+            (rect (92,168) width=108 height=13)
+            (rect (117,181) width=83 height=10)
+            (rect (144,191) width=56 height=6)
+            (rect (172,197) width=28 height=3)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 1033.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=125)
+            (rect (6,125) width=194 height=54)
+            (rect (21,179) width=179 height=21)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 1033.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (15,194) width=185 height=6)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 1237.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=200)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 1237.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (0,194) width=194 height=6)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 1237.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=169)
+            (rect (0,169) width=196 height=16)
+            (rect (0,185) width=185 height=11)
+            (rect (0,196) width=169 height=4)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 1441.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=28)
+            (rect (0,28) width=197 height=28)
+            (rect (0,56) width=191 height=27)
+            (rect (0,83) width=181 height=25)
+            (rect (0,108) width=168 height=22)
+            (rect (0,130) width=151 height=21)
+            (rect (0,151) width=130 height=17)
+            (rect (0,168) width=108 height=13)
+            (rect (0,181) width=83 height=10)
+            (rect (0,191) width=56 height=6)
+            (rect (0,197) width=28 height=3)
+          )
+        )
+        (GraphicsLayer
+          (position 208.00 1441.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=124)
+            (rect (0,124) width=194 height=55)
+            (rect (0,179) width=180 height=21)
+          )
+        )
+        (GraphicsLayer
+          (position 408.00 1441.00)
+          (bounds 200.00 200.00)
+          (drawsContent 1)
+          (event region
+            (rect (0,0) width=200 height=194)
+            (rect (0,194) width=185 height=6)
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region.html (0 => 257938)


--- trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/border-radius-event-region.html	2020-03-05 20:32:14 UTC (rev 257938)
@@ -0,0 +1,40 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<style>
+.testdiv {
+    display: inline-block;
+    box-sizing: border-box;
+    border: 2px solid blue;
+    position: relative;
+    height: 200px;
+    width: 200px;
+    will-change: transform;
+}
+
+</style>
+<script>
+window._onload_ = function () {
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    const properties = [ 'border-top-left-radius', 'border-top-right-radius', 'border-bottom-left-radius', 'border-bottom-right-radius' ];
+    const values = [ '5px', '20px', '50px', '200px', '40px 150px', '50px 20px'];
+
+    for (const property of properties) {
+        for (const value of values) {
+            const div = document.createElement("div");
+            div.setAttribute("class", "testdiv");
+            div.setAttribute("style", property + ": " + value);
+            document.body.appendChild(div);
+        }
+    }
+
+    if (window.internals)
+        results.innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+}
+</script>
+<body>
+<pre id="results"></pre>
+</body>
+</html>
+

Added: trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt (0 => 257938)


--- trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt	2020-03-05 20:32:14 UTC (rev 257938)
@@ -0,0 +1,47 @@
+ 
+  
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 4
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (2,2) width=50 height=50)
+          )
+        )
+        (GraphicsLayer
+          (position 216.00 8.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (2,2) width=50 height=50)
+          )
+        )
+        (GraphicsLayer
+          (position 424.00 8.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (152,152) width=50 height=50)
+          )
+        )
+        (GraphicsLayer
+          (position 8.00 216.00)
+          (bounds 204.00 204.00)
+          (drawsContent 1)
+          (event region
+            (rect (152,152) width=50 height=50)
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden.html (0 => 257938)


--- trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden.html	                        (rev 0)
+++ trunk/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden.html	2020-03-05 20:32:14 UTC (rev 257938)
@@ -0,0 +1,54 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<style>
+.testdiv {
+    display: inline-block;
+    border: 2px solid blue;
+    position: relative;
+    height: 200px;
+    width: 200px;
+    background-color: blue;
+    will-change: transform;
+}
+.inner {
+    height: 50px;
+    width: 50px;
+    background-color: green;
+}
+.positioned {
+    position: absolute;
+    left: 150px;
+    top: 150px;
+}
+</style>
+<script>
+window._onload_ = function () {
+    if (!window.internals)
+        return;
+    if (window.testRunner)
+        testRunner.dumpAsText();
+
+    document.body.offsetLeft;
+
+    test2.style.visibility = 'visible';
+    test4.style.visibility = 'visible';
+
+    results.innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+}
+</script>
+<body>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner" style="visibility:visible"></div>
+</div>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner" id="test2"></div>
+</div>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner positioned" style="visibility:visible"></div>
+</div>
+<div class="testdiv" style="visibility:hidden">
+    <div class="inner positioned" id="test4"></div>
+</div>
+<pre id="results"></pre>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (257937 => 257938)


--- trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-03-05 19:44:20 UTC (rev 257937)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations	2020-03-05 20:32:14 UTC (rev 257938)
@@ -13,6 +13,7 @@
 editing/pasteboard/dom-paste [ Pass ]
 fast/forms/select/mac-wk2 [ Pass ]
 fast/sandbox/mac [ Pass ]
+fast/scrolling/mac [ Pass ]
 fast/visual-viewport/tiled-drawing [ Pass ]
 fast/web-share [ Pass ]
 scrollingcoordinator [ Pass ]

Modified: trunk/Source/WebCore/ChangeLog (257937 => 257938)


--- trunk/Source/WebCore/ChangeLog	2020-03-05 19:44:20 UTC (rev 257937)
+++ trunk/Source/WebCore/ChangeLog	2020-03-05 20:32:14 UTC (rev 257938)
@@ -1,3 +1,22 @@
+2020-03-05  Simon Fraser  <simon.fra...@apple.com>
+
+        Generate layer event regions for async overflow scrolling on macOS
+        https://bugs.webkit.org/show_bug.cgi?id=208649
+
+        Reviewed by Antti Koivisto.
+
+        Turn on the existing code for event region generation on macOS, and generate event
+        regions when async overflow scroll is enabled.
+        
+        Tweak the region debug color to be more visible.
+
+        Tests: fast/scrolling/mac/border-radius-event-region.html
+               fast/scrolling/mac/event-region-visibility-hidden.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateEventRegion):
+        (WebCore::RenderLayerBacking::paintDebugOverlays):
+
 2020-03-05  Jer Noble  <jer.no...@apple.com>
 
         [GPUP] Implement RemoteAudioSession

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (257937 => 257938)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2020-03-05 19:44:20 UTC (rev 257937)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2020-03-05 20:32:14 UTC (rev 257938)
@@ -1614,17 +1614,20 @@
 
 void RenderLayerBacking::updateEventRegion()
 {
-#if PLATFORM(IOS_FAMILY)
     if (paintsIntoCompositedAncestor())
         return;
 
     bool hasTouchActionElements = false;
-#if ENABLE(POINTER_EVENTS)
+#if PLATFORM(IOS_FAMILY) && ENABLE(POINTER_EVENTS)
     hasTouchActionElements = renderer().document().mayHaveElementsWithNonAutoTouchAction();
 #endif
     if (m_owningLayer.isRenderViewLayer() && !hasTouchActionElements)
         return;
 
+    auto& settings = renderer().settings();
+    if (!settings.asyncFrameScrollingEnabled() && !settings.asyncOverflowScrollingEnabled())
+        return;
+
     auto updateEventRegionForLayer = [&](GraphicsLayer& graphicsLayer) {
         GraphicsContext nullContext(nullptr);
         EventRegion eventRegion;
@@ -1649,7 +1652,6 @@
 
     if (m_scrolledContentsLayer)
         updateEventRegionForLayer(*m_scrolledContentsLayer);
-#endif
 }
 
 bool RenderLayerBacking::updateAncestorClippingStack(Vector<CompositedClipData>&& clippingData)
@@ -3015,7 +3017,7 @@
 
     // The interactive part.
     auto& eventRegion = graphicsLayer->eventRegion();
-    Color regionColor(0, 0, 0, 5);
+    Color regionColor(0, 0, 255, 50);
     context.setFillColor(regionColor);
     for (auto rect : eventRegion.region().rects())
         context.fillRect(rect);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to