- Revision
- 275593
- Author
- [email protected]
- Date
- 2021-04-07 01:32:32 -0700 (Wed, 07 Apr 2021)
Log Message
[GTK][WPE] Wrong frame scrolled when view is horizontally scrolled with async scrolling enabled
https://bugs.webkit.org/show_bug.cgi?id=222900
Patch by Alejandro G. Castro <[email protected]> on 2021-04-07
Reviewed by Žan Doberšek.
Source/WebCore:
We need to use the scrolling offset in the parent when collecting
the descendant layers at a point. We substract the boundsOrigin to
make sure we transform the point considering the scrolling offset.
Test: fast/scrolling/scrolling-inside-scrolled-overflowarea.html
* page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
(WebCore::collectDescendantLayersAtPoint):
Tools:
We were not testing the async code path for WPE, it is important
we do it because it is the default option.
* WebKitTestRunner/wpe/TestControllerWPE.cpp:
(WTR::TestController::platformSpecificFeatureDefaultsForTest const):
Activating AsyncOverflowScrollingEnabled.
LayoutTests:
Add test for the use case.
* fast/scrolling/scrolling-inside-scrolled-overflowarea-expected.txt: Added.
* fast/scrolling/scrolling-inside-scrolled-overflowarea.html: Added.
* platform/ios/TestExpectations: The test uses mouseMoveTo and it is not supported in IOS.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (275592 => 275593)
--- trunk/LayoutTests/ChangeLog 2021-04-07 08:30:32 UTC (rev 275592)
+++ trunk/LayoutTests/ChangeLog 2021-04-07 08:32:32 UTC (rev 275593)
@@ -1,3 +1,16 @@
+2021-04-07 Alejandro G. Castro <[email protected]>
+
+ [GTK][WPE] Wrong frame scrolled when view is horizontally scrolled with async scrolling enabled
+ https://bugs.webkit.org/show_bug.cgi?id=222900
+
+ Reviewed by Žan Doberšek.
+
+ Add test for the use case.
+
+ * fast/scrolling/scrolling-inside-scrolled-overflowarea-expected.txt: Added.
+ * fast/scrolling/scrolling-inside-scrolled-overflowarea.html: Added.
+ * platform/ios/TestExpectations: The test uses mouseMoveTo and it is not supported in IOS.
+
2021-04-07 Ryosuke Niwa <[email protected]>
REGRESSION(r274812): Release assert in Document::updateLayout() after calling focus({preventScroll: true}) on a textarea
Added: trunk/LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea-expected.txt (0 => 275593)
--- trunk/LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea-expected.txt 2021-04-07 08:32:32 UTC (rev 275593)
@@ -0,0 +1,41 @@
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+
+Sending mouse events
+PASS: scrolled happened in the bottom div
+
Added: trunk/LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea.html (0 => 275593)
--- trunk/LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea.html (rev 0)
+++ trunk/LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea.html 2021-04-07 08:32:32 UTC (rev 275593)
@@ -0,0 +1,103 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <style>
+ .content {
+ height: 200px;
+ overflow: scroll;
+ background-image: linear-gradient(white, gray)
+ }
+ </style>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ function logResult(s)
+ {
+ document.getElementById('result').textContent += s + "\n";
+ }
+
+ function scrolled()
+ {
+ var divId = event.target.id;
+ if (divId == "divBottom")
+ logResult('PASS: scrolled happened in the bottom div');
+ else
+ logResult('FAIL: scrolled happened in the top div');
+
+ testRunner.notifyDone();
+ }
+
+ function scrollTest()
+ {
+ var externalScrollableArea = document.getElementById('externalScrollableArea');
+ var externalScrollableAreaBounds = externalScrollableArea.getBoundingClientRect();
+
+ logResult('Sending mouse events');
+ eventSender.mouseMoveTo(externalScrollableAreaBounds.left + 60, externalScrollableAreaBounds.bottom - 60);
+ eventSender.mouseScrollBy(0, -10);
+ }
+
+ function startTest()
+ {
+ var externalScrollableArea = document.getElementById('externalScrollableArea');
+ externalScrollableArea.scrollTop = externalScrollableArea.scrollHeight;
+
+ setTimeout(scrollTest, 0);
+ }
+
+ window.addEventListener('load', startTest, false);
+ </script>
+</head>
+<body>
+<div id="externalScrollableArea" style="overflow: scroll; width: 200px; height: 200px;">
+ <div class="content" id="divTop" _onscroll_="scrolled()">
+ <pre>
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ </pre>
+ </div>
+ <div class="content" id="divBottom" _onscroll_="scrolled()">
+ <pre>
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ content
+ </pre>
+ </div>
+</div>
+<pre id="result"></pre>
+</body>
+</html>
Modified: trunk/LayoutTests/platform/ios/TestExpectations (275592 => 275593)
--- trunk/LayoutTests/platform/ios/TestExpectations 2021-04-07 08:30:32 UTC (rev 275592)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2021-04-07 08:32:32 UTC (rev 275593)
@@ -1054,6 +1054,7 @@
fast/media/video-element-in-details-collapse.html [ Skip ]
fast/frames/user-gesture-timestamp-propagation.html [ Failure ]
fast/events/mouse-click-different-mouseDown-mouseUp-nodes.html [ Skip ]
+fast/scrolling/scrolling-inside-scrolled-overflowarea.html [ Skip ]
# The file-wrapper part of <attachment> is not yet working on iOS
fast/attachment/attachment-type-attribute.html [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (275592 => 275593)
--- trunk/Source/WebCore/ChangeLog 2021-04-07 08:30:32 UTC (rev 275592)
+++ trunk/Source/WebCore/ChangeLog 2021-04-07 08:32:32 UTC (rev 275593)
@@ -1,3 +1,19 @@
+2021-04-07 Alejandro G. Castro <[email protected]>
+
+ [GTK][WPE] Wrong frame scrolled when view is horizontally scrolled with async scrolling enabled
+ https://bugs.webkit.org/show_bug.cgi?id=222900
+
+ Reviewed by Žan Doberšek.
+
+ We need to use the scrolling offset in the parent when collecting
+ the descendant layers at a point. We substract the boundsOrigin to
+ make sure we transform the point considering the scrolling offset.
+
+ Test: fast/scrolling/scrolling-inside-scrolled-overflowarea.html
+
+ * page/scrolling/nicosia/ScrollingTreeNicosia.cpp:
+ (WebCore::collectDescendantLayersAtPoint):
+
2021-04-07 Ryosuke Niwa <[email protected]>
REGRESSION(r274812): Release assert in Document::updateLayout() after calling focus({preventScroll: true}) on a textarea
Modified: trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp (275592 => 275593)
--- trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp 2021-04-07 08:30:32 UTC (rev 275592)
+++ trunk/Source/WebCore/page/scrolling/nicosia/ScrollingTreeNicosia.cpp 2021-04-07 08:32:32 UTC (rev 275593)
@@ -94,7 +94,7 @@
float originX = childState.anchorPoint.x() * childState.size.width();
float originY = childState.anchorPoint.y() * childState.size.height();
auto transform = *(TransformationMatrix()
- .translate3d(originX + childState.position.x(), originY + childState.position.y(), childState.anchorPoint.z())
+ .translate3d(originX + childState.position.x() - state.boundsOrigin.x(), originY + childState.position.y() - state.boundsOrigin.y(), childState.anchorPoint.z())
.multiply(childState.transform)
.translate3d(-originX, -originY, -childState.anchorPoint.z()).inverse());
auto pointInChildSpace = transform.projectPoint(point);
Modified: trunk/Tools/ChangeLog (275592 => 275593)
--- trunk/Tools/ChangeLog 2021-04-07 08:30:32 UTC (rev 275592)
+++ trunk/Tools/ChangeLog 2021-04-07 08:32:32 UTC (rev 275593)
@@ -1,3 +1,17 @@
+2021-04-07 Alejandro G. Castro <[email protected]>
+
+ [GTK][WPE] Wrong frame scrolled when view is horizontally scrolled with async scrolling enabled
+ https://bugs.webkit.org/show_bug.cgi?id=222900
+
+ Reviewed by Žan Doberšek.
+
+ We were not testing the async code path for WPE, it is important
+ we do it because it is the default option.
+
+ * WebKitTestRunner/wpe/TestControllerWPE.cpp:
+ (WTR::TestController::platformSpecificFeatureDefaultsForTest const):
+ Activating AsyncOverflowScrollingEnabled.
+
2021-04-06 Myles C. Maxfield <[email protected]>
[GPU Process] Simplify DisplayList::Iterator part 5: Tweak the return type of DisplayList::Iterator::operator*()
Modified: trunk/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp (275592 => 275593)
--- trunk/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp 2021-04-07 08:30:32 UTC (rev 275592)
+++ trunk/Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp 2021-04-07 08:32:32 UTC (rev 275593)
@@ -143,7 +143,9 @@
TestFeatures TestController::platformSpecificFeatureDefaultsForTest(const TestCommand&) const
{
- return { };
+ TestFeatures features;
+ features.boolWebPreferenceFeatures.insert({ "AsyncOverflowScrollingEnabled", true });
+ return features;
}
} // namespace WTR