Skip to content

Commit

Permalink
REGRESSION (UI-side compositing) changing between non-overlay and ove…
Browse files Browse the repository at this point in the history
…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
nmoucht committed Mar 21, 2024
1 parent 18d622f commit 81451da
Show file tree
Hide file tree
Showing 21 changed files with 146 additions and 22 deletions.
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. .
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>
9 changes: 9 additions & 0 deletions Source/WebCore/page/LocalFrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6193,6 +6193,15 @@ void LocalFrameView::invalidateScrollAnchoringElement()
m_scrollAnchoringController->invalidateAnchorElement();
}

void LocalFrameView::scrollbarStyleDidChange()
{
if (auto scrollableAreas = this->scrollableAreas()) {
for (auto& scrollableArea : *scrollableAreas)
scrollableArea.scrollbarsController().updateScrollbarStyle();
}
scrollbarsController().updateScrollbarStyle();
}

} // namespace WebCore

#undef PAGE_ID
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/page/LocalFrameView.h
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,8 @@ class LocalFrameView final : public FrameView {
void invalidateScrollAnchoringElement() final;
ScrollAnchoringController* scrollAnchoringController() { return m_scrollAnchoringController.get(); }

WEBCORE_EXPORT void scrollbarStyleDidChange();

private:
explicit LocalFrameView(LocalFrame&);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ void AsyncScrollingCoordinator::setFrameScrollingNodeState(ScrollingNodeID nodeI
frameScrollingNode->setLayoutViewport(frameView.layoutViewportRect());
frameScrollingNode->setAsyncFrameOrOverflowScrollingEnabled(settings.asyncFrameScrollingEnabled() || settings.asyncOverflowScrollingEnabled());
frameScrollingNode->setScrollingPerformanceTestingEnabled(settings.scrollingPerformanceTestingEnabled());
frameScrollingNode->setOverlayScrollbarsEnabled(WebCore::DeprecatedGlobalSettings::usesOverlayScrollbars());
frameScrollingNode->setOverlayScrollbarsEnabled(ScrollbarTheme::theme().usesOverlayScrollbars());
frameScrollingNode->setWheelEventGesturesBecomeNonBlocking(settings.wheelEventGesturesBecomeNonBlocking());

frameScrollingNode->setMinLayoutViewportOrigin(frameView.minStableLayoutViewportOrigin());
Expand Down
8 changes: 8 additions & 0 deletions Source/WebCore/platform/Scrollbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,4 +547,12 @@ int Scrollbar::minimumThumbLength() const
return m_scrollableArea.scrollbarsController().minimumThumbLength(m_orientation);
}

void Scrollbar::updateScrollbarThickness()
{
if (!isCustomScrollbar()) {
int thickness = ScrollbarTheme::theme().scrollbarThickness(widthStyle());
setFrameRect(IntRect(0, 0, thickness, thickness));
}
}

} // namespace WebCore
1 change: 1 addition & 0 deletions Source/WebCore/platform/Scrollbar.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class Scrollbar : public Widget {

bool shouldRegisterScrollbar() const;
int minimumThumbLength() const;
void updateScrollbarThickness();

virtual bool isMacScrollbar() const { return false; }

Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/platform/ScrollbarsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,13 @@ void ScrollbarsController::mayBeginScrollGesture()
setScrollbarAnimationsUnsuspendedByUserInteraction(true);
}

void ScrollbarsController::updateScrollbarsThickness()
{
if (auto verticalScrollbar = scrollableArea().verticalScrollbar())
verticalScrollbar->updateScrollbarThickness();

if (auto horizontalScrollbar = scrollableArea().horizontalScrollbar())
horizontalScrollbar->updateScrollbarThickness();
}

} // namespace WebCore
7 changes: 7 additions & 0 deletions Source/WebCore/platform/ScrollbarsController.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "FloatSize.h"
#include "UserInterfaceLayoutDirection.h"
#include <wtf/FastMalloc.h>
#include <wtf/WeakHashSet.h>
#include <wtf/text/WTFString.h>

namespace WebCore {
Expand Down Expand Up @@ -102,6 +103,12 @@ class ScrollbarsController {
WEBCORE_EXPORT virtual int minimumThumbLength(WebCore::ScrollbarOrientation) { return 0; }
WEBCORE_EXPORT virtual void scrollbarLayoutDirectionChanged(UserInterfaceLayoutDirection) { }

WEBCORE_EXPORT virtual void updateScrollerStyle() { }

WEBCORE_EXPORT void updateScrollbarsThickness();

WEBCORE_EXPORT virtual void updateScrollbarStyle() { }

private:
ScrollableArea& m_scrollableArea;
bool m_scrollbarAnimationsUnsuspendedByUserInteraction { true };
Expand Down
4 changes: 2 additions & 2 deletions Source/WebCore/platform/mac/ScrollbarsControllerMac.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace WebCore {

class WheelEventTestMonitor;

class ScrollbarsControllerMac : public ScrollbarsController {
class ScrollbarsControllerMac final : public ScrollbarsController {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(ScrollbarsControllerMac);
public:
Expand Down Expand Up @@ -90,7 +90,7 @@ class ScrollbarsControllerMac : public ScrollbarsController {


// Public to be callable from Obj-C.
void updateScrollerStyle();
void updateScrollerStyle() final;
bool scrollbarPaintTimerIsActive() const;
void startScrollbarPaintTimer();
void stopScrollbarPaintTimer();
Expand Down
19 changes: 5 additions & 14 deletions Source/WebCore/platform/mac/ScrollbarsControllerMac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -957,14 +957,7 @@ - (void)invalidate
NSScrollerImp *oldVerticalPainter = [m_scrollerImpPair verticalScrollerImp];
auto* verticalScrollbarMac = dynamicDowncast<ScrollbarMac>(verticalScrollbar);
verticalScrollbarMac->createScrollerImp(WTFMove(oldVerticalPainter));

[m_scrollerImpPair setVerticalScrollerImp:verticalScrollbarMac->scrollerImp()];

// The different scrollbar styles have different thicknesses, so we must re-set the
// frameRect to the new thickness, and the re-layout below will ensure the position
// and length are properly updated.
int thickness = macTheme->scrollbarThickness(verticalScrollbar->widthStyle());
verticalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
}

Scrollbar* horizontalScrollbar = scrollableArea().horizontalScrollbar();
Expand All @@ -974,16 +967,14 @@ - (void)invalidate
NSScrollerImp *oldHorizontalPainter = [m_scrollerImpPair horizontalScrollerImp];
auto* horizontalScrollbarMac = dynamicDowncast<ScrollbarMac>(horizontalScrollbar);
horizontalScrollbarMac->createScrollerImp(WTFMove(oldHorizontalPainter));

[m_scrollerImpPair setHorizontalScrollerImp:horizontalScrollbarMac->scrollerImp()];

// The different scrollbar styles have different thicknesses, so we must re-set the
// frameRect to the new thickness, and the re-layout below will ensure the position
// and length are properly updated.
int thickness = macTheme->scrollbarThickness(horizontalScrollbar->widthStyle());
horizontalScrollbar->setFrameRect(IntRect(0, 0, thickness, thickness));
}

// The different scrollbar styles have different thicknesses, so we must re-set the
// frameRect to the new thickness, and the re-layout below will ensure the position
// and length are properly updated.
updateScrollbarsThickness();

// If m_needsScrollerStyleUpdate is true, then the page is restoring from the back/forward cache, and
// a relayout will happen on its own. Otherwise, we must initiate a re-layout ourselves.
scrollableArea().scrollbarStyleChanged(newStyle == NSScrollerStyleOverlay ? ScrollbarStyle::Overlay : ScrollbarStyle::AlwaysVisible, !m_needsScrollerStyleUpdate);
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/rendering/RenderLayerScrollableArea.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -649,6 +649,7 @@ IntSize RenderLayerScrollableArea::reachableTotalContentsSize() const

void RenderLayerScrollableArea::availableContentSizeChanged(AvailableSizeChangeReason reason)
{
ALWAYS_LOG_WITH_STREAM(stream << " RenderLayerScrollableArea::availableContentSizeChanged " << scrollingNodeID());
ScrollableArea::availableContentSizeChanged(reason);

auto& renderer = m_layer.renderer();
Expand All @@ -657,6 +658,7 @@ void RenderLayerScrollableArea::availableContentSizeChanged(AvailableSizeChangeR
renderBlock->setShouldForceRelayoutChildren(true);
renderer.setNeedsLayout();
}
ALWAYS_LOG_WITH_STREAM(stream << " RenderLayerScrollableArea::availableContentSizeChanged " << m_layer.renderer().needsLayout());
}

bool RenderLayerScrollableArea::shouldSuspendScrollAnimations() const
Expand Down
9 changes: 9 additions & 0 deletions Source/WebCore/testing/Internals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,15 @@ ExceptionOr<Vector<uint64_t>> Internals::scrollingNodeIDForNode(Node* node)
return returnNodeID;
}

ExceptionOr<unsigned> Internals::scrollableAreaWidth(Node& node)
{
auto areaOrException = scrollableAreaForNode(&node);
if (areaOrException.hasException())
return areaOrException.releaseException();
auto* scrollableArea = areaOrException.releaseReturnValue();
return scrollableArea->contentsSize().width();
}

static OptionSet<PlatformLayerTreeAsTextFlags> toPlatformLayerTreeFlags(unsigned short flags)
{
OptionSet<PlatformLayerTreeAsTextFlags> platformLayerTreeFlags = { };
Expand Down
1 change: 1 addition & 0 deletions Source/WebCore/testing/Internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,7 @@ class Internals final : public RefCounted<Internals>, private ContextDestruction

ExceptionOr<unsigned> wheelEventHandlerCount();
ExceptionOr<unsigned> touchEventHandlerCount();
ExceptionOr<unsigned> scrollableAreaWidth(Node&);

ExceptionOr<Ref<DOMRectList>> touchEventRectsForEvent(const String&);
ExceptionOr<Ref<DOMRectList>> passiveTouchEventListenerRects();
Expand Down
2 changes: 2 additions & 0 deletions Source/WebCore/testing/Internals.idl
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,8 @@ typedef (FetchRequest or FetchResponse) FetchObject;

unsigned long numberOfIDBTransactions();

unsigned long scrollableAreaWidth(Node node);

unsigned long numberOfLiveNodes();
unsigned long numberOfLiveDocuments();
unsigned long referencingNodeCount(Document document);
Expand Down
11 changes: 11 additions & 0 deletions Source/WebCore/testing/Internals.mm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#import "EventHandler.h"
#import "HTMLMediaElement.h"
#import "HitTestResult.h"
#import "LocalFrameView.h"
#import "MediaPlayerPrivate.h"
#import "Range.h"
#import "SharedBuffer.h"
Expand Down Expand Up @@ -154,6 +155,16 @@ - (NSAttributedString *)_attributedStringForRange:(NSRange)range

NSScrollerStyle style = enabled ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
[NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:style];

auto* document = contextDocument();
if (!document || !document->frame())
return;

auto* localFrame = dynamicDowncast<LocalFrame>(document->frame()->mainFrame());
if (!localFrame)
return;

localFrame->view()->scrollbarStyleDidChange();
}

#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ friend class RemoteScrollingCoordinatorProxyMac;

bool m_usesOverlayScrollbars { false };

std::optional<WebCore::ScrollbarStyle> m_scrollbarStyle;

std::optional<TransactionID> m_transactionIDAfterEndingTransientZoom;
std::optional<double> m_transientZoomScale;
std::optional<WebCore::FloatPoint> m_transientZoomOrigin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,15 @@ explicit RemoteLayerTreeDisplayLinkClient(WebPageProxyIdentifier pageID)
removeTransientZoomFromLayer();
m_transactionIDAfterEndingTransientZoom = { };
}
if (m_usesOverlayScrollbars != m_webPageProxy->scrollingCoordinatorProxy()->overlayScrollbarsEnabled()) {
m_usesOverlayScrollbars = m_webPageProxy->scrollingCoordinatorProxy()->overlayScrollbarsEnabled();
WebCore::DeprecatedGlobalSettings::setUsesOverlayScrollbars(m_usesOverlayScrollbars);
auto usesOverlayScrollbars = m_webPageProxy->scrollingCoordinatorProxy()->overlayScrollbarsEnabled();
auto newScrollbarStyle = usesOverlayScrollbars ? ScrollbarStyle::Overlay : ScrollbarStyle::AlwaysVisible;
if (!m_scrollbarStyle || m_scrollbarStyle != newScrollbarStyle) {
m_scrollbarStyle = newScrollbarStyle;
WebCore::DeprecatedGlobalSettings::setUsesOverlayScrollbars(usesOverlayScrollbars);

ScrollerStyle::setUseOverlayScrollbars(m_usesOverlayScrollbars);
ScrollerStyle::setUseOverlayScrollbars(usesOverlayScrollbars);

NSScrollerStyle style = m_usesOverlayScrollbars ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
NSScrollerStyle style = usesOverlayScrollbars ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
[NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:style];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ class RemoteScrollbarsController final : public WebCore::ScrollbarsController {
void updateScrollbarEnabledState(WebCore::Scrollbar&) final;
void scrollbarLayoutDirectionChanged(WebCore::UserInterfaceLayoutDirection) final;

void updateScrollbarStyle() final;

private:
bool m_horizontalOverlayScrollbarIsVisible { false };
bool m_verticalOverlayScrollbarIsVisible { false };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#if PLATFORM(MAC)

#include <WebCore/ScrollableArea.h>
#include <WebCore/ScrollbarThemeMac.h>
#include <WebCore/ScrollingCoordinator.h>
#include <pal/spi/mac/NSScrollerImpSPI.h>

Expand Down Expand Up @@ -124,5 +125,19 @@
scrollingCoordinator->setScrollbarEnabled(scrollbar);
}

void RemoteScrollbarsController::updateScrollbarStyle()
{
auto& theme = WebCore::ScrollbarTheme::theme();
if (theme.isMockTheme())
return;

// The different scrollbar styles have different thicknesses, so we must re-set the
// frameRect to the new thickness, and the re-layout below will ensure the position
// and length are properly updated.
updateScrollbarsThickness();

scrollableArea().scrollbarStyleChanged(theme.usesOverlayScrollbars() ? WebCore::ScrollbarStyle::Overlay : WebCore::ScrollbarStyle::AlwaysVisible, true);
}

}
#endif // PLATFORM(MAC)
5 changes: 5 additions & 0 deletions Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1206,6 +1206,11 @@ bool shouldTransformObject(id object) const override

static_cast<ScrollbarThemeMac&>(theme).preferencesChanged();

for (auto& page : m_pageMap.values()) {
if (RefPtr frameView = page->localMainFrameView())
frameView->scrollbarStyleDidChange();
}

NSScrollerStyle style = useOverlayScrollbars ? NSScrollerStyleOverlay : NSScrollerStyleLegacy;
[NSScrollerImpPair _updateAllScrollerImpPairsForNewRecommendedScrollerStyle:style];
}
Expand Down

0 comments on commit 81451da

Please sign in to comment.