-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
REGRESSION (UI-side compositing) changing between non-overlay and ove…
…rlay scrollbars should adjust the size of the scrollable area https://bugs.webkit.org/show_bug.cgi?id=263618 rdar://117507268 Reviewed by Simon Fraser. This patch fixes a couple bugs related to switching back and forth dynamically between overlay and non-overlay scrollbars. First, setFrameScrollingNodeState() was not always called when switching the default, so iterate through each page and call LocalFrameView::overlayScrollbarDefaultDidChange to force a scrolling commit to plumb across this state change. Second, when we get the state change on the ui-process side, we call _updateAllScrollerImpPairsForNewRecommendedScrollerStyle, which notifies all the scroller imp pairs in the process of the new style. On the web process side, we had code to adjust the scrollbar thickness and force a relayout, which now doesn't work since there are no NSScrollerImpPairs in the web process. Instead, replicate this code in RemoteScrollbarsController and loop through the scrollable areas in the FrameView. This takes care of updating scrollable areas with overflow, while #19561 will take care of updating scrollable areas without overflow. Also add some additional testing infrastructure to compare the size of the scrollable area before and after toggling scrollbar style. * Source/WebCore/page/LocalFrameView.cpp: (WebCore::LocalFrameView::usesOverlayScrollbars const): (WebCore::LocalFrameView::overlayScrollbarDefaultDidChange): * Source/WebCore/page/LocalFrameView.h: * Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState): * Source/WebCore/page/scrolling/ScrollingTree.h: (WebCore::ScrollingTree::scrollingTreeNodeMarkScrollbarStyleChange): (WebCore::ScrollingTree::scrollingTreeNodesWithScrollbarStyleChange): (WebCore::ScrollingTree::clearScrollingTreeNodesWithScrollbarStyleChange): * Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::markHasScrollbarStyleChange): * Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h: * Source/WebCore/page/scrolling/mac/ScrollerPairMac.mm: (-[WebScrollerImpPairDelegateMac scrollerImpPair:updateScrollerStyleForNewRecommendedScrollerStyle:]): * Source/WebCore/platform/Scrollbar.cpp: (WebCore::Scrollbar::updateScrollbarThickness): * Source/WebCore/platform/Scrollbar.h: * Source/WebCore/platform/ScrollbarsController.cpp: (WebCore::ScrollbarsController::updateScrollbarsThickness): * Source/WebCore/platform/ScrollbarsController.h: (WebCore::ScrollbarsController::updateScrollerStyle): * Source/WebCore/platform/mac/ScrollbarsControllerMac.h: * Source/WebCore/platform/mac/ScrollbarsControllerMac.mm: (WebCore::ScrollbarsControllerMac::updateScrollerStyle): * Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: (WebKit::RemoteScrollingCoordinatorProxy::scrollingNodesHaveScrollbarStyleChange): * Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: * Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h: * Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm: (WebKit::RemoteLayerTreeDrawingAreaProxyMac::didCommitLayerTree): * Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.h: * Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteScrollingTreeMac.mm: (WebKit::RemoteScrollingTreeMac::scrollingTreeNodeMarkScrollbarStyleChange): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollbarsController.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollbarsController.mm: (WebKit::macScrollbarTheme): (WebKit::RemoteScrollbarsController::updateScrollerStyle): * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.h: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.messages.in: * Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteScrollingCoordinator.mm: (WebKit::RemoteScrollingCoordinator::scrollingTreeNodesHaveScrollbarsWithStyleChange): * Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::scrollerStylePreferenceChanged): Canonical link: https://commits.webkit.org/276439@main
- Loading branch information
Showing
21 changed files
with
146 additions
and
22 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
LayoutTests/fast/scrolling/mac/scrollable-area-size-for-overlay-scrollbars-expected.txt
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,10 @@ | ||
Tests that scrollable area size is properly updated when toggling scrollbar style | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS preChangeSize is > window.internals.scrollableAreaWidth(document.getElementById("scroller")) | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. . |
36 changes: 36 additions & 0 deletions
36
LayoutTests/fast/scrolling/mac/scrollable-area-size-for-overlay-scrollbars.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true MockScrollbarsEnabled=false ] --> | ||
<html> | ||
<head> | ||
<style> | ||
.container { | ||
height: 200px; | ||
width: 200px; | ||
border: 1px solid black; | ||
overflow-y: scroll; | ||
} | ||
</style> | ||
<script src="../../../resources/js-test.js"></script> | ||
<script src="../../../resources/ui-helper.js"></script> | ||
<script> | ||
if (window.testRunner) | ||
testRunner.waitUntilDone(); | ||
description("Tests that scrollable area size is properly updated when toggling scrollbar style"); | ||
window.internals.setUsesOverlayScrollbars(true); | ||
|
||
async function doTest() | ||
{ | ||
preChangeSize = window.internals.scrollableAreaWidth(document.getElementById("scroller")); | ||
window.internals.setUsesOverlayScrollbars(false); | ||
shouldBeGreaterThan("preChangeSize", "window.internals.scrollableAreaWidth(document.getElementById(\"scroller\"))"); | ||
testRunner.notifyDone(); | ||
} | ||
window.addEventListener('load', doTest, false); | ||
</script> | ||
</head> | ||
<body> | ||
<div id="scroller" class="container"> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. .</p> | ||
|
||
</div> | ||
</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
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
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