Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[GTK][WPE] Wrong frame scrolled when view is horizontally scrolled wi…
…th async scrolling enabled

https://bugs.webkit.org/show_bug.cgi?id=222900

Patch by Alejandro G. Castro <alex@igalia.com> 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.

Canonical link: https://commits.webkit.org/236238@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
alexgcastro authored and webkit-commit-queue committed Apr 7, 2021
1 parent 617bcf9 commit 2554b6e
Show file tree
Hide file tree
Showing 8 changed files with 192 additions and 2 deletions.
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
2021-04-07 Alejandro G. Castro <alex@igalia.com>

[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 <rniwa@webkit.org>

REGRESSION(r274812): Release assert in Document::updateLayout() after calling focus({preventScroll: true}) on a textarea
Expand Down
@@ -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

103 changes: 103 additions & 0 deletions LayoutTests/fast/scrolling/scrolling-inside-scrolled-overflowarea.html
@@ -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>
1 change: 1 addition & 0 deletions LayoutTests/platform/ios/TestExpectations
Expand Up @@ -1054,6 +1054,7 @@ fast/frames/flattening/scrolling-in-object.html [ Skip ]
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 ]
Expand Down
16 changes: 16 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,19 @@
2021-04-07 Alejandro G. Castro <alex@igalia.com>

[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 <rniwa@webkit.org>

REGRESSION(r274812): Release assert in Document::updateLayout() after calling focus({preventScroll: true}) on a textarea
Expand Down
Expand Up @@ -94,7 +94,7 @@ static bool collectDescendantLayersAtPoint(Vector<RefPtr<CompositionLayer>>& lay
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);
Expand Down
14 changes: 14 additions & 0 deletions Tools/ChangeLog
@@ -1,3 +1,17 @@
2021-04-07 Alejandro G. Castro <alex@igalia.com>

[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 <mmaxfield@apple.com>

[GPU Process] Simplify DisplayList::Iterator part 5: Tweak the return type of DisplayList::Iterator::operator*()
Expand Down
4 changes: 3 additions & 1 deletion Tools/WebKitTestRunner/wpe/TestControllerWPE.cpp
Expand Up @@ -143,7 +143,9 @@ bool TestController::platformResetStateToConsistentValues(const TestOptions&)

TestFeatures TestController::platformSpecificFeatureDefaultsForTest(const TestCommand&) const
{
return { };
TestFeatures features;
features.boolWebPreferenceFeatures.insert({ "AsyncOverflowScrollingEnabled", true });
return features;
}

} // namespace WTR

0 comments on commit 2554b6e

Please sign in to comment.