Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
REGRESSION: CSS scroll-behavior: smooth with overflow: hidden breaks …
…JS scrollTo/scrollLeft/scrollTop https://bugs.webkit.org/show_bug.cgi?id=238497 <rdar://90990040> Reviewed by Simon Fraser. Add scrollable area to frame view's list of scrollable areas if necessary in scrollToOffset. This is necessary as Document::runScrollSteps() looks through the list of scrollable areas to service animations on the scrollable area. It is necessary to add the scrollable area in scrollToOffset as for a scrollable area that is not user scrollable (such as a scrollable area with overflow: hidden) it would not be added, so the animation would not occur. * LayoutTests/fast/scrolling/smooth-scroll-with-overflow-hidden-expected.txt: Added. * LayoutTests/fast/scrolling/smooth-scroll-with-overflow-hidden.html: Added. * Source/WebCore/page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): * Source/WebCore/platform/ScrollableArea.h: (WebCore::ScrollableArea::isVisibleToHitTesting const): * Source/WebCore/rendering/RenderLayerScrollableArea.cpp: (WebCore::RenderLayerScrollableArea::clear): (WebCore::RenderLayerScrollableArea::scrollToOffset): (WebCore::RenderLayerScrollableArea::isVisibleToHitTesting const): (WebCore::RenderLayerScrollableArea::updateScrollableAreaSet): (WebCore::RenderLayerScrollableArea::registerScrollableArea): * Source/WebCore/rendering/RenderLayerScrollableArea.h: Canonical link: https://commits.webkit.org/251454@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295448 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
10 changed files
with
100 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
PASS scrollContainer.scrollLeft is 500 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] --> | ||
<html> | ||
<head> | ||
<style> | ||
.scroll-container { | ||
height: 250px; | ||
width: 300px; | ||
border: 1px solid black; | ||
overflow-y: scroll; | ||
overflow: hidden; | ||
} | ||
|
||
.contents { | ||
height: 100%; | ||
width: 400%; | ||
background-image: repeating-linear-gradient(to right, white, silver 250px); | ||
} | ||
</style> | ||
<script src="../../../resources/ui-helper.js"></script> | ||
<script src="../../../resources/js-test-pre.js"></script> | ||
<script> | ||
jsTestIsAsync = true; | ||
|
||
async function runTest() | ||
{ | ||
scrollContainer = document.querySelector('.scroll-container'); | ||
|
||
eventSender.monitorWheelEvents(); | ||
|
||
scrollContainer.scrollTo({ | ||
top: 0, | ||
left: 500, | ||
behavior: 'smooth' | ||
}); | ||
|
||
await UIHelper.waitForScrollCompletion(); | ||
|
||
shouldBe('scrollContainer.scrollLeft', '500'); | ||
finishJSTest(); | ||
} | ||
|
||
window.addEventListener('load', () => { | ||
setTimeout(runTest, 0); | ||
}, false); | ||
</script> | ||
</head> | ||
<body> | ||
<div class="scroll-container"> | ||
<div class="contents"></div> | ||
</div> | ||
<div id="console"></div> | ||
<script src="../../../resources/js-test-post.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters