Diff
Modified: branches/safari-610-branch/LayoutTests/ChangeLog (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/ChangeLog 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/ChangeLog 2020-09-18 19:36:24 UTC (rev 267271)
@@ -1,5 +1,109 @@
2020-09-17 Alan Coon <[email protected]>
+ Cherry-pick r266846. rdar://problem/68740511
+
+ Don't create event regions when the page has no subscrollers
+ https://bugs.webkit.org/show_bug.cgi?id=216355
+ <rdar://problem/67900642>
+
+ Reviewed by Simon Fraser.
+
+ Source/WebCore:
+
+ Tests: fast/scrolling/mac/event-region-subscroller-frame.html
+ fast/scrolling/mac/event-region-subscroller-overflow.html
+
+ Unless the page uses features like touch-action we don't need event regions for plain main frame scrolling.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::hasSubscrollers const):
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollingCoordinator::hasSubscrollers const):
+ * page/scrolling/ScrollingStateScrollingNode.cpp:
+ (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
+ (WebCore::ScrollingStateScrollingNode::~ScrollingStateScrollingNode):
+ * page/scrolling/ScrollingStateTree.h:
+ (WebCore::ScrollingStateTree::scrollingNodeCount const):
+ (WebCore::ScrollingStateTree::scrollingNodeAdded):
+ (WebCore::ScrollingStateTree::scrollingNodeRemoved):
+
+ Count scrolling nodes in the state tree. It is updated during updateCompositingLayers, before event region generation.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::maintainsEventRegion const):
+
+ Don't maintain event region if there are no subscrollers and none of the other reasons were hit.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateCompositingLayers):
+
+ Invalidate event regions if a subscroller appears.
+
+ (WebCore::RenderLayerCompositor::invalidateEventRegionForAllFrames):
+ * rendering/RenderLayerCompositor.h:
+
+ LayoutTests:
+
+ Add overflow scrollers to some existing tests so they still generate event regions.
+
+ * fast/scrolling/ios/border-radius-event-region-expected.txt:
+ * fast/scrolling/ios/border-radius-event-region.html:
+ * fast/scrolling/ios/event-region-float-expected.txt:
+ * fast/scrolling/ios/event-region-float.html:
+ * fast/scrolling/ios/event-region-pointer-events-expected.txt:
+ * fast/scrolling/ios/event-region-pointer-events.html:
+ * fast/scrolling/ios/event-region-scale-transform-shared-expected.txt:
+ * fast/scrolling/ios/event-region-scale-transform-shared.html:
+ * fast/scrolling/ios/event-region-translate-transform-shared-expected.txt:
+ * fast/scrolling/ios/event-region-translate-transform-shared.html:
+ * fast/scrolling/ios/event-region-visibility-hidden-expected.txt:
+ * fast/scrolling/ios/event-region-visibility-hidden.html:
+ * fast/scrolling/mac/border-radius-event-region-expected.txt:
+ * fast/scrolling/mac/border-radius-event-region.html:
+ * fast/scrolling/mac/event-region-subscroller-frame-expected.txt: Added.
+ * fast/scrolling/mac/event-region-subscroller-frame.html: Added.
+ * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt: Added.
+ * fast/scrolling/mac/event-region-subscroller-overflow.html: Copied from LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html.
+ * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
+ * fast/scrolling/mac/event-region-visibility-hidden.html:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-09-10 Antti Koivisto <[email protected]>
+
+ Don't create event regions when the page has no subscrollers
+ https://bugs.webkit.org/show_bug.cgi?id=216355
+ <rdar://problem/67900642>
+
+ Reviewed by Simon Fraser.
+
+ Add overflow scrollers to some existing tests so they still generate event regions.
+
+ * fast/scrolling/ios/border-radius-event-region-expected.txt:
+ * fast/scrolling/ios/border-radius-event-region.html:
+ * fast/scrolling/ios/event-region-float-expected.txt:
+ * fast/scrolling/ios/event-region-float.html:
+ * fast/scrolling/ios/event-region-pointer-events-expected.txt:
+ * fast/scrolling/ios/event-region-pointer-events.html:
+ * fast/scrolling/ios/event-region-scale-transform-shared-expected.txt:
+ * fast/scrolling/ios/event-region-scale-transform-shared.html:
+ * fast/scrolling/ios/event-region-translate-transform-shared-expected.txt:
+ * fast/scrolling/ios/event-region-translate-transform-shared.html:
+ * fast/scrolling/ios/event-region-visibility-hidden-expected.txt:
+ * fast/scrolling/ios/event-region-visibility-hidden.html:
+ * fast/scrolling/mac/border-radius-event-region-expected.txt:
+ * fast/scrolling/mac/border-radius-event-region.html:
+ * fast/scrolling/mac/event-region-subscroller-frame-expected.txt: Added.
+ * fast/scrolling/mac/event-region-subscroller-frame.html: Added.
+ * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt: Added.
+ * fast/scrolling/mac/event-region-subscroller-overflow.html: Copied from LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html.
+ * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
+ * fast/scrolling/mac/event-region-visibility-hidden.html:
+
+2020-09-17 Alan Coon <[email protected]>
+
Cherry-pick r266232. rdar://problem/68178664
Step animations invalidate style on every rendering update whether or not they need to
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/border-radius-event-region-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/border-radius-event-region-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/border-radius-event-region-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -1,13 +1,37 @@
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 800.00 1661.00)
+ (bounds 800.00 1719.00)
(children 1
(GraphicsLayer
- (bounds 800.00 1661.00)
+ (bounds 800.00 1719.00)
(contentsOpaque 1)
- (children 24
+ (children 25
(GraphicsLayer
- (position 8.00 13.00)
+ (position 8.00 8.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 8.00 71.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -15,7 +39,7 @@
)
)
(GraphicsLayer
- (position 208.00 13.00)
+ (position 208.00 71.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -24,7 +48,7 @@
)
)
(GraphicsLayer
- (position 408.00 13.00)
+ (position 408.00 71.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -35,7 +59,7 @@
)
)
(GraphicsLayer
- (position 8.00 218.00)
+ (position 8.00 276.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -53,7 +77,7 @@
)
)
(GraphicsLayer
- (position 208.00 218.00)
+ (position 208.00 276.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -63,7 +87,7 @@
)
)
(GraphicsLayer
- (position 408.00 218.00)
+ (position 408.00 276.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -72,7 +96,7 @@
)
)
(GraphicsLayer
- (position 8.00 423.00)
+ (position 8.00 481.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -80,7 +104,7 @@
)
)
(GraphicsLayer
- (position 208.00 423.00)
+ (position 208.00 481.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -89,7 +113,7 @@
)
)
(GraphicsLayer
- (position 408.00 423.00)
+ (position 408.00 481.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -100,7 +124,7 @@
)
)
(GraphicsLayer
- (position 8.00 628.00)
+ (position 8.00 686.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -118,7 +142,7 @@
)
)
(GraphicsLayer
- (position 208.00 628.00)
+ (position 208.00 686.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -128,7 +152,7 @@
)
)
(GraphicsLayer
- (position 408.00 628.00)
+ (position 408.00 686.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -137,7 +161,7 @@
)
)
(GraphicsLayer
- (position 8.00 833.00)
+ (position 8.00 891.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -145,7 +169,7 @@
)
)
(GraphicsLayer
- (position 208.00 833.00)
+ (position 208.00 891.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -154,7 +178,7 @@
)
)
(GraphicsLayer
- (position 408.00 833.00)
+ (position 408.00 891.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -165,7 +189,7 @@
)
)
(GraphicsLayer
- (position 8.00 1038.00)
+ (position 8.00 1096.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -183,7 +207,7 @@
)
)
(GraphicsLayer
- (position 208.00 1038.00)
+ (position 208.00 1096.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -193,7 +217,7 @@
)
)
(GraphicsLayer
- (position 408.00 1038.00)
+ (position 408.00 1096.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -202,7 +226,7 @@
)
)
(GraphicsLayer
- (position 8.00 1243.00)
+ (position 8.00 1301.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -210,7 +234,7 @@
)
)
(GraphicsLayer
- (position 208.00 1243.00)
+ (position 208.00 1301.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -219,7 +243,7 @@
)
)
(GraphicsLayer
- (position 408.00 1243.00)
+ (position 408.00 1301.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -230,7 +254,7 @@
)
)
(GraphicsLayer
- (position 8.00 1448.00)
+ (position 8.00 1506.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -248,7 +272,7 @@
)
)
(GraphicsLayer
- (position 208.00 1448.00)
+ (position 208.00 1506.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -258,7 +282,7 @@
)
)
(GraphicsLayer
- (position 408.00 1448.00)
+ (position 408.00 1506.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/border-radius-event-region.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/border-radius-event-region.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/border-radius-event-region.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -10,6 +10,15 @@
width: 200px;
will-change: transform;
}
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+ width: 50px;
+}
</style>
<script>
window._onload_ = function () {
@@ -33,7 +42,7 @@
}
</script>
<body>
+<div class="scroller"><div class="scrollcontent"></div></div>
<pre id="results"></pre>
</body>
</html>
-
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-float-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-float-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-float-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -5,8 +5,32 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
- (children 1
+ (children 2
(GraphicsLayer
+ (position 8.00 208.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 200.00 200.00)
(drawsContent 1)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-float.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-float.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-float.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -16,11 +16,21 @@
float: right;
visibility: visible;
}
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+ width: 50px;
+}
</style>
<body>
<div class="container">
<div class="inner"></div>
</div>
+<div class="scroller"><div class="scrollcontent"></div></div>
<pre id="results"></pre>
<script>
if (window.testRunner)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-pointer-events-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-pointer-events-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-pointer-events-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -9,8 +9,32 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
- (children 3
+ (children 4
(GraphicsLayer
+ (position 8.00 213.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 200.00 200.00)
(drawsContent 1)
@@ -33,13 +57,37 @@
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 800.00 673.00)
+ (bounds 800.00 1059.00)
(children 1
(GraphicsLayer
- (bounds 800.00 673.00)
+ (bounds 800.00 1059.00)
(contentsOpaque 1)
- (children 3
+ (children 4
(GraphicsLayer
+ (position 8.00 213.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 200.00 200.00)
(drawsContent 1)
@@ -71,13 +119,37 @@
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 800.00 1205.00)
+ (bounds 800.00 1927.00)
(children 1
(GraphicsLayer
- (bounds 800.00 1205.00)
+ (bounds 800.00 1927.00)
(contentsOpaque 1)
- (children 3
+ (children 4
(GraphicsLayer
+ (position 8.00 213.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 200.00 200.00)
(drawsContent 1)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-pointer-events.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-pointer-events.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-pointer-events.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -15,7 +15,14 @@
width: 200px;
background-color: green;
}
-
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+}
</style>
<script>
window._onload_ = function () {
@@ -53,6 +60,7 @@
<div id="test3" class="inner"></div>
</div>
</div>
+<div class="scroller"><div class="scrollcontent"></div></div>
<pre id="results"></pre>
</body>
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -5,8 +5,32 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
- (children 2
+ (children 3
(GraphicsLayer
+ (position 8.00 508.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 500.00 500.00)
(contentsOpaque 1)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-scale-transform-shared.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -38,6 +38,15 @@
height: 500px;
background-color: silver;
}
+ .scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+ }
+ .scrollcontent {
+ height: 100px;
+ width: 50px;
+ }
</style>
<script>
if (window.testRunner)
@@ -57,6 +66,7 @@
</div>
</div>
</div>
+ <div class="scroller"><div class="scrollcontent"></div></div>
<pre id="layers"></pre>
</body>
</html>
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -5,8 +5,32 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
- (children 2
+ (children 3
(GraphicsLayer
+ (position 8.00 508.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 500.00 500.00)
(contentsOpaque 1)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-translate-transform-shared.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -38,6 +38,15 @@
height: 500px;
background-color: silver;
}
+ .scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+ }
+ .scrollcontent {
+ height: 100px;
+ width: 50px;
+ }
</style>
<script>
if (window.testRunner)
@@ -57,6 +66,7 @@
</div>
</div>
</div>
+ <div class="scroller"><div class="scrollcontent"></div></div>
<pre id="layers"></pre>
</body>
</html>
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -7,8 +7,32 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
- (children 4
+ (children 5
(GraphicsLayer
+ (position 8.00 426.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 204.00 204.00)
(drawsContent 1)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -20,6 +20,15 @@
left: 150px;
top: 150px;
}
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+ width: 50px;
+}
</style>
<script>
window._onload_ = function () {
@@ -49,6 +58,7 @@
<div class="testdiv" style="visibility:hidden">
<div class="inner positioned" id="test4"></div>
</div>
+<div class="scroller"><div class="scrollcontent"></div></div>
<pre id="results"></pre>
</body>
</html>
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -1,13 +1,57 @@
(GraphicsLayer
(anchor 0.00 0.00)
- (bounds 785.00 1653.00)
+ (bounds 785.00 1711.00)
(children 1
(GraphicsLayer
- (bounds 785.00 1653.00)
+ (bounds 785.00 1711.00)
(contentsOpaque 1)
- (children 24
+ (children 25
(GraphicsLayer
- (position 8.00 13.00)
+ (position 8.00 8.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 2
+ (GraphicsLayer
+ (bounds 35.00 35.00)
+ (event region
+ (rect (0,0) width=35 height=35)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (children 3
+ (GraphicsLayer
+ (position 0.00 35.00)
+ (bounds 35.00 15.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 35.00 0.00)
+ (bounds 15.00 35.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 35.00 35.00)
+ (bounds 15.00 15.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 8.00 71.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -15,7 +59,7 @@
)
)
(GraphicsLayer
- (position 208.00 13.00)
+ (position 208.00 71.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -24,7 +68,7 @@
)
)
(GraphicsLayer
- (position 408.00 13.00)
+ (position 408.00 71.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -35,7 +79,7 @@
)
)
(GraphicsLayer
- (position 8.00 217.00)
+ (position 8.00 275.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -53,7 +97,7 @@
)
)
(GraphicsLayer
- (position 208.00 217.00)
+ (position 208.00 275.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -63,7 +107,7 @@
)
)
(GraphicsLayer
- (position 408.00 217.00)
+ (position 408.00 275.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -72,7 +116,7 @@
)
)
(GraphicsLayer
- (position 8.00 421.00)
+ (position 8.00 479.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -80,7 +124,7 @@
)
)
(GraphicsLayer
- (position 208.00 421.00)
+ (position 208.00 479.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -89,7 +133,7 @@
)
)
(GraphicsLayer
- (position 408.00 421.00)
+ (position 408.00 479.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -100,7 +144,7 @@
)
)
(GraphicsLayer
- (position 8.00 625.00)
+ (position 8.00 683.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -118,7 +162,7 @@
)
)
(GraphicsLayer
- (position 208.00 625.00)
+ (position 208.00 683.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -128,7 +172,7 @@
)
)
(GraphicsLayer
- (position 408.00 625.00)
+ (position 408.00 683.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -137,7 +181,7 @@
)
)
(GraphicsLayer
- (position 8.00 829.00)
+ (position 8.00 887.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -145,7 +189,7 @@
)
)
(GraphicsLayer
- (position 208.00 829.00)
+ (position 208.00 887.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -154,7 +198,7 @@
)
)
(GraphicsLayer
- (position 408.00 829.00)
+ (position 408.00 887.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -165,7 +209,7 @@
)
)
(GraphicsLayer
- (position 8.00 1033.00)
+ (position 8.00 1091.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -183,7 +227,7 @@
)
)
(GraphicsLayer
- (position 208.00 1033.00)
+ (position 208.00 1091.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -193,7 +237,7 @@
)
)
(GraphicsLayer
- (position 408.00 1033.00)
+ (position 408.00 1091.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -202,7 +246,7 @@
)
)
(GraphicsLayer
- (position 8.00 1237.00)
+ (position 8.00 1295.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -210,7 +254,7 @@
)
)
(GraphicsLayer
- (position 208.00 1237.00)
+ (position 208.00 1295.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -219,7 +263,7 @@
)
)
(GraphicsLayer
- (position 408.00 1237.00)
+ (position 408.00 1295.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -230,7 +274,7 @@
)
)
(GraphicsLayer
- (position 8.00 1441.00)
+ (position 8.00 1499.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -248,7 +292,7 @@
)
)
(GraphicsLayer
- (position 208.00 1441.00)
+ (position 208.00 1499.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
@@ -258,7 +302,7 @@
)
)
(GraphicsLayer
- (position 408.00 1441.00)
+ (position 408.00 1499.00)
(bounds 200.00 200.00)
(drawsContent 1)
(event region
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/border-radius-event-region.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -10,7 +10,15 @@
width: 200px;
will-change: transform;
}
-
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+ width: 50px;
+}
</style>
<script>
window._onload_ = function () {
@@ -34,6 +42,7 @@
}
</script>
<body>
+<div class="scroller"><div class="scrollcontent"></div></div>
<pre id="results"></pre>
</body>
</html>
Added: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-frame-expected.txt (0 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-frame-expected.txt (rev 0)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-frame-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -0,0 +1,88 @@
+
+Before adding scrollable content to frame:
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+After adding scrollable content to frame:
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 2
+ (GraphicsLayer
+ (position 212.00 104.00)
+ (bounds 104.00 104.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (position 2.00 2.00)
+ (children 2
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 85.00 100.00)
+ (event region
+ (rect (0,0) width=85 height=100)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 85.00 216.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 85.00 216.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 85.00 0.00)
+ (bounds 15.00 100.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ (event region
+ (rect (0,0) width=200 height=200)
+ )
+ )
+ )
+ )
+ )
+)
+
Added: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-frame.html (0 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-frame.html (rev 0)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-frame.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -0,0 +1,40 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=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)
+ return;
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+
+ results.innerText = "Before adding scrollable content to frame:\n\n"
+ results.innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+
+ frame._onload_ = () => {
+ results.innerText += "After adding scrollable content to frame:\n\n"
+ results.innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+ testRunner.notifyDone();
+ }
+
+ frame.setAttribute("srcdoc", "<body style='height:200px'>");
+}
+</script>
+<body>
+<div class="testdiv">
+</div>
+<iframe id="frame" width=100 height=100></iframe>
+
+<pre id="results"></pre>
+</body>
+</html>
Added: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow-expected.txt (0 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow-expected.txt (rev 0)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -0,0 +1,87 @@
+ Before adding scroller:
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+)
+After adding scroller:
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 785.00 603.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 785.00 603.00)
+ (contentsOpaque 1)
+ (children 2
+ (GraphicsLayer
+ (position 8.00 212.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 2
+ (GraphicsLayer
+ (bounds 35.00 35.00)
+ (event region
+ (rect (0,0) width=35 height=35)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 35.00 100.00)
+ (drawsContent 1)
+ (event region
+ (rect (0,0) width=35 height=100)
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (children 3
+ (GraphicsLayer
+ (position 0.00 35.00)
+ (bounds 35.00 15.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 35.00 0.00)
+ (bounds 15.00 35.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 35.00 35.00)
+ (bounds 15.00 15.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 200.00 200.00)
+ (drawsContent 1)
+ (event region
+ (rect (0,0) width=200 height=200)
+ )
+ )
+ )
+ )
+ )
+)
+
Copied: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow.html (from rev 267270, branches/safari-610-branch/LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html) (0 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow.html (rev 0)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-subscroller-overflow.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -0,0 +1,51 @@
+<!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;
+}
+.inner {
+ height: 200px;
+ width: 200px;
+ background-color: green;
+}
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+ background-color:red;
+}
+</style>
+<script>
+window._onload_ = function () {
+ if (!window.internals)
+ return;
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ results.innerText = "Before adding scroller:\n\n"
+ results.innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+
+ scroller.removeAttribute("hidden");
+
+ results.innerText += "After adding scroller:\n\n"
+ results.innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_EVENT_REGION);
+}
+</script>
+<body>
+<div class="testdiv">
+</div>
+<div id="scroller" class="scroller" hidden><div class="scrollcontent"></div></div>
+
+<pre id="results"></pre>
+</body>
+</html>
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden-expected.txt 2020-09-18 19:36:24 UTC (rev 267271)
@@ -7,8 +7,52 @@
(GraphicsLayer
(bounds 800.00 600.00)
(contentsOpaque 1)
- (children 4
+ (children 5
(GraphicsLayer
+ (position 8.00 424.00)
+ (bounds 50.00 50.00)
+ (event region
+ (rect (0,0) width=50 height=50)
+ )
+ (children 2
+ (GraphicsLayer
+ (bounds 35.00 35.00)
+ (event region
+ (rect (0,0) width=35 height=35)
+ )
+ (children 1
+ (GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 50.00 100.00)
+ (event region
+ (rect (0,0) width=50 height=100)
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (bounds 50.00 50.00)
+ (children 3
+ (GraphicsLayer
+ (position 0.00 35.00)
+ (bounds 35.00 15.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 35.00 0.00)
+ (bounds 15.00 35.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 35.00 35.00)
+ (bounds 15.00 15.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
(position 8.00 8.00)
(bounds 204.00 204.00)
(drawsContent 1)
Modified: branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden.html (267270 => 267271)
--- branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden.html 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/LayoutTests/fast/scrolling/mac/event-region-visibility-hidden.html 2020-09-18 19:36:24 UTC (rev 267271)
@@ -20,6 +20,15 @@
left: 150px;
top: 150px;
}
+.scroller {
+ overflow: scroll;
+ height: 50px;
+ width: 50px;
+}
+.scrollcontent {
+ height: 100px;
+ width: 50px;
+}
</style>
<script>
window._onload_ = function () {
@@ -49,6 +58,7 @@
<div class="testdiv" style="visibility:hidden">
<div class="inner positioned" id="test4"></div>
</div>
+<div class="scroller"><div class="scrollcontent"></div></div>
<pre id="results"></pre>
</body>
</html>
Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/ChangeLog 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog 2020-09-18 19:36:24 UTC (rev 267271)
@@ -1,5 +1,119 @@
2020-09-17 Alan Coon <[email protected]>
+ Cherry-pick r266846. rdar://problem/68740511
+
+ Don't create event regions when the page has no subscrollers
+ https://bugs.webkit.org/show_bug.cgi?id=216355
+ <rdar://problem/67900642>
+
+ Reviewed by Simon Fraser.
+
+ Source/WebCore:
+
+ Tests: fast/scrolling/mac/event-region-subscroller-frame.html
+ fast/scrolling/mac/event-region-subscroller-overflow.html
+
+ Unless the page uses features like touch-action we don't need event regions for plain main frame scrolling.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::hasSubscrollers const):
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollingCoordinator::hasSubscrollers const):
+ * page/scrolling/ScrollingStateScrollingNode.cpp:
+ (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
+ (WebCore::ScrollingStateScrollingNode::~ScrollingStateScrollingNode):
+ * page/scrolling/ScrollingStateTree.h:
+ (WebCore::ScrollingStateTree::scrollingNodeCount const):
+ (WebCore::ScrollingStateTree::scrollingNodeAdded):
+ (WebCore::ScrollingStateTree::scrollingNodeRemoved):
+
+ Count scrolling nodes in the state tree. It is updated during updateCompositingLayers, before event region generation.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::maintainsEventRegion const):
+
+ Don't maintain event region if there are no subscrollers and none of the other reasons were hit.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateCompositingLayers):
+
+ Invalidate event regions if a subscroller appears.
+
+ (WebCore::RenderLayerCompositor::invalidateEventRegionForAllFrames):
+ * rendering/RenderLayerCompositor.h:
+
+ LayoutTests:
+
+ Add overflow scrollers to some existing tests so they still generate event regions.
+
+ * fast/scrolling/ios/border-radius-event-region-expected.txt:
+ * fast/scrolling/ios/border-radius-event-region.html:
+ * fast/scrolling/ios/event-region-float-expected.txt:
+ * fast/scrolling/ios/event-region-float.html:
+ * fast/scrolling/ios/event-region-pointer-events-expected.txt:
+ * fast/scrolling/ios/event-region-pointer-events.html:
+ * fast/scrolling/ios/event-region-scale-transform-shared-expected.txt:
+ * fast/scrolling/ios/event-region-scale-transform-shared.html:
+ * fast/scrolling/ios/event-region-translate-transform-shared-expected.txt:
+ * fast/scrolling/ios/event-region-translate-transform-shared.html:
+ * fast/scrolling/ios/event-region-visibility-hidden-expected.txt:
+ * fast/scrolling/ios/event-region-visibility-hidden.html:
+ * fast/scrolling/mac/border-radius-event-region-expected.txt:
+ * fast/scrolling/mac/border-radius-event-region.html:
+ * fast/scrolling/mac/event-region-subscroller-frame-expected.txt: Added.
+ * fast/scrolling/mac/event-region-subscroller-frame.html: Added.
+ * fast/scrolling/mac/event-region-subscroller-overflow-expected.txt: Added.
+ * fast/scrolling/mac/event-region-subscroller-overflow.html: Copied from LayoutTests/fast/scrolling/ios/event-region-visibility-hidden.html.
+ * fast/scrolling/mac/event-region-visibility-hidden-expected.txt:
+ * fast/scrolling/mac/event-region-visibility-hidden.html:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-09-10 Antti Koivisto <[email protected]>
+
+ Don't create event regions when the page has no subscrollers
+ https://bugs.webkit.org/show_bug.cgi?id=216355
+ <rdar://problem/67900642>
+
+ Reviewed by Simon Fraser.
+
+ Tests: fast/scrolling/mac/event-region-subscroller-frame.html
+ fast/scrolling/mac/event-region-subscroller-overflow.html
+
+ Unless the page uses features like touch-action we don't need event regions for plain main frame scrolling.
+
+ * page/scrolling/AsyncScrollingCoordinator.cpp:
+ (WebCore::AsyncScrollingCoordinator::hasSubscrollers const):
+ * page/scrolling/AsyncScrollingCoordinator.h:
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollingCoordinator::hasSubscrollers const):
+ * page/scrolling/ScrollingStateScrollingNode.cpp:
+ (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
+ (WebCore::ScrollingStateScrollingNode::~ScrollingStateScrollingNode):
+ * page/scrolling/ScrollingStateTree.h:
+ (WebCore::ScrollingStateTree::scrollingNodeCount const):
+ (WebCore::ScrollingStateTree::scrollingNodeAdded):
+ (WebCore::ScrollingStateTree::scrollingNodeRemoved):
+
+ Count scrolling nodes in the state tree. It is updated during updateCompositingLayers, before event region generation.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::maintainsEventRegion const):
+
+ Don't maintain event region if there are no subscrollers and none of the other reasons were hit.
+
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::updateCompositingLayers):
+
+ Invalidate event regions if a subscroller appears.
+
+ (WebCore::RenderLayerCompositor::invalidateEventRegionForAllFrames):
+ * rendering/RenderLayerCompositor.h:
+
+2020-09-17 Alan Coon <[email protected]>
+
Cherry-pick r266677. rdar://problem/68740521
[MotionMark] RenderLayer::paintLayerContents spends ~5% of the time in MonotonicTime::now() in Multiply
Modified: branches/safari-610-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp 2020-09-18 19:36:24 UTC (rev 267271)
@@ -826,6 +826,11 @@
m_scrollingTree->windowScreenDidChange(displayID, nominalFramesPerSecond);
}
+bool AsyncScrollingCoordinator::hasSubscrollers() const
+{
+ return m_scrollingStateTree && m_scrollingStateTree->scrollingNodeCount() > 1;
+}
+
bool AsyncScrollingCoordinator::isUserScrollInProgress(ScrollingNodeID nodeID) const
{
if (m_scrollingTree)
Modified: branches/safari-610-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h 2020-09-18 19:36:24 UTC (rev 267271)
@@ -145,6 +145,8 @@
WEBCORE_EXPORT void windowScreenDidChange(PlatformDisplayID, Optional<unsigned> nominalFramesPerSecond) final;
+ WEBCORE_EXPORT bool hasSubscrollers() const final;
+
virtual void scheduleTreeStateCommit() = 0;
void ensureRootStateNodeForFrameView(FrameView&);
Modified: branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2020-09-18 19:36:24 UTC (rev 267271)
@@ -175,6 +175,7 @@
virtual bool isScrollSnapInProgress(ScrollingNodeID) const { return false; }
virtual void updateScrollSnapPropertiesWithFrameView(const FrameView&) { }
virtual void setScrollPinningBehavior(ScrollPinningBehavior) { }
+ virtual bool hasSubscrollers() const { return false; }
// Generated a unique id for scrolling nodes.
ScrollingNodeID uniqueScrollingNodeID();
Modified: branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2020-09-18 19:36:24 UTC (rev 267271)
@@ -36,6 +36,7 @@
ScrollingStateScrollingNode::ScrollingStateScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeType nodeType, ScrollingNodeID nodeID)
: ScrollingStateNode(nodeType, stateTree, nodeID)
{
+ scrollingStateTree().scrollingNodeAdded();
}
ScrollingStateScrollingNode::ScrollingStateScrollingNode(const ScrollingStateScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
@@ -59,6 +60,8 @@
#endif
, m_isMonitoringWheelEvents(stateNode.isMonitoringWheelEvents())
{
+ scrollingStateTree().scrollingNodeAdded();
+
if (hasChangedProperty(ScrollContainerLayer))
setScrollContainerLayer(stateNode.scrollContainerLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
@@ -72,7 +75,10 @@
setHorizontalScrollbarLayer(stateNode.horizontalScrollbarLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
}
-ScrollingStateScrollingNode::~ScrollingStateScrollingNode() = default;
+ScrollingStateScrollingNode::~ScrollingStateScrollingNode()
+{
+ scrollingStateTree().scrollingNodeRemoved();
+}
void ScrollingStateScrollingNode::setPropertyChangedBitsAfterReattach()
{
Modified: branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingStateTree.h (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingStateTree.h 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/page/scrolling/ScrollingStateTree.h 2020-09-18 19:36:24 UTC (rev 267271)
@@ -68,6 +68,7 @@
void setHasNewRootStateNode(bool hasNewRoot) { m_hasNewRootStateNode = hasNewRoot; }
unsigned nodeCount() const { return m_stateNodeMap.size(); }
+ unsigned scrollingNodeCount() const { return m_scrollingNodeCount; }
typedef HashMap<ScrollingNodeID, RefPtr<ScrollingStateNode>> StateNodeMap;
const StateNodeMap& nodeMap() const { return m_stateNodeMap; }
@@ -77,6 +78,14 @@
void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect& viewportRect, ScrollingLayerPositionAction);
+ void scrollingNodeAdded() { ++m_scrollingNodeCount; }
+ void scrollingNodeRemoved()
+ {
+ ASSERT(m_scrollingNodeCount);
+ --m_scrollingNodeCount;
+ }
+
+
private:
void setRootStateNode(Ref<ScrollingStateFrameScrollingNode>&&);
void addNode(ScrollingStateNode&);
@@ -103,6 +112,7 @@
RefPtr<ScrollingStateFrameScrollingNode> m_rootStateNode;
bool m_hasChangedProperties { false };
bool m_hasNewRootStateNode { false };
+ unsigned m_scrollingNodeCount { 0 };
LayerRepresentation::Type m_preferredLayerRepresentation { LayerRepresentation::GraphicsLayerRepresentation };
};
Modified: branches/safari-610-branch/Source/WebCore/rendering/RenderLayerBacking.cpp (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/rendering/RenderLayerBacking.cpp 2020-09-18 19:36:24 UTC (rev 267271)
@@ -1723,6 +1723,9 @@
if (!settings.asyncFrameScrollingEnabled() && !settings.asyncOverflowScrollingEnabled())
return false;
+ if (!m_owningLayer.page().scrollingCoordinator()->hasSubscrollers())
+ return false;
+
return true;
}
Modified: branches/safari-610-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/rendering/RenderLayerCompositor.cpp 2020-09-18 19:36:24 UTC (rev 267271)
@@ -857,6 +857,9 @@
if (!m_renderView.frame().isMainFrame())
scrollingTreeState.parentNodeID = frameHostingNodeForFrame(m_renderView.frame());
+ auto* scrollingCoordinator = this->scrollingCoordinator();
+ bool hadSubscrollers = scrollingCoordinator ? scrollingCoordinator->hasSubscrollers() : false;
+
UpdateBackingTraversalState traversalState;
Vector<Ref<GraphicsLayer>> childList;
updateBackingAndHierarchy(*updateRoot, childList, traversalState, scrollingTreeState);
@@ -872,6 +875,9 @@
destroyRootLayer();
else if (m_rootContentsLayer)
m_rootContentsLayer->setChildren(WTFMove(childList));
+
+ if (scrollingCoordinator && scrollingCoordinator->hasSubscrollers() != hadSubscrollers)
+ invalidateEventRegionForAllFrames();
}
#if !LOG_DISABLED
@@ -2373,6 +2379,14 @@
}
}
+void RenderLayerCompositor::invalidateEventRegionForAllFrames()
+{
+ for (auto* frame = &page().mainFrame(); frame; frame = frame->tree().traverseNext()) {
+ if (auto* view = frame->contentRenderer())
+ view->compositor().invalidateEventRegionForAllLayers();
+ }
+}
+
void RenderLayerCompositor::invalidateEventRegionForAllLayers()
{
applyToCompositedLayerIncludingDescendants(*m_renderView.layer(), [](auto& layer) {
Modified: branches/safari-610-branch/Source/WebCore/rendering/RenderLayerCompositor.h (267270 => 267271)
--- branches/safari-610-branch/Source/WebCore/rendering/RenderLayerCompositor.h 2020-09-18 19:36:17 UTC (rev 267270)
+++ branches/safari-610-branch/Source/WebCore/rendering/RenderLayerCompositor.h 2020-09-18 19:36:24 UTC (rev 267271)
@@ -285,6 +285,7 @@
void setIsInWindow(bool);
void clearBackingForAllLayers();
+ void invalidateEventRegionForAllFrames();
void invalidateEventRegionForAllLayers();
void layerBecameComposited(const RenderLayer&);