Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 643493bea2f9824959ebb9824bfb011aedf7498c
https://github.com/WebKit/WebKit/commit/643493bea2f9824959ebb9824bfb011aedf7498c
Author: Lily Spiniolas <[email protected]>
Date: 2026-01-23 (Fri, 23 Jan 2026)
Changed paths:
M Source/WTF/wtf/PlatformHave.h
M Source/WebCore/page/ChromeClient.h
M Source/WebCore/page/FrameView.cpp
M Source/WebCore/page/FrameView.h
M Source/WebCore/platform/ScrollView.cpp
M Source/WebCore/platform/ScrollView.h
M Source/WebCore/platform/graphics/CornerRadii.h
M Source/WebCore/testing/Internals.cpp
M Source/WebCore/testing/Internals.h
M Source/WebCore/testing/Internals.idl
M Source/WebKit/Platform/spi/mac/AppKitSPI.h
M Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in
M Source/WebKit/Shared/WebPageCreationParameters.h
M Source/WebKit/Shared/WebPageCreationParameters.serialization.in
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/WebPageProxyInternals.h
M Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm
M Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h
M Tools/TestWebKitAPI/Tests/mac/ScrollbarTests.mm
Log Message:
-----------
[macOS] Scroll bars of root scroller may be cutoff due to corner radii of
window
https://bugs.webkit.org/show_bug.cgi?id=305426
rdar://156100532
Reviewed by Abrar Rahman Protyasha.
Reland 306039@main with corrected `PlatformHave` defintion.
On Mac, WKWebView now participates in the container concentricity
system by implementing `_cornerConfiguration` and
`_viewDidChangeEffectiveCornerRadii`, allowing WKWebView to determine
the corner radii of windows when the view is the window's content view,
and allowing WKWebView to determine the corner radii of parents views
that have an `NSCornerConfiguration`.
When `_viewDidChangeEffectiveCornerRadii` is called, we check if the
corner radii actually changed. If they did, we notify the web process
of the new radii and update the scrollbars to reposition them in order
to avoid the obscured corners by insetting by the corner radius minus
the radius of the scrollbar's cap. We take `obscuredContentInsets` into
account here as well by using whichever inset is larger.
Note that this change does not yet fix the issue of custom CSS scroll
bars getting cutoff. A separate patch will be needed to address that
bug.
Tested by new API tests:
+ ScrollbarTests.ScrollbarAvoidanceForTitledWindow
+ ScrollbarTests.ScrollbarAvoidanceForWindowWithUnifiedCompactToolbar
+ ScrollbarTests.ScrollbarAvoidanceForWindowWithUnifiedToolbar
+ ScrollbarTests.ScrollbarAvoidanceNoCornerRadii
+ ScrollbarTests.ScrollbarAvoidanceInConcentricContainerWithUniformCornerRadii
+
ScrollbarTests.ScrollbarAvoidanceInConcentricContainerWithNonUniformCornerRadii
* Source/WTF/wtf/PlatformHave.h:
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::scrollbarAvoidanceCornerRadii const):
* Source/WebCore/page/FrameView.cpp:
(WebCore::FrameView::scrollbarAvoidanceCornerRadii const):
* Source/WebCore/page/FrameView.h:
* Source/WebCore/platform/ScrollView.cpp:
(WebCore::ScrollView::scrollbarAvoidanceCornerRadii const):
(WebCore::ScrollView::updateScrollbars):
* Source/WebCore/platform/ScrollView.h:
* Source/WebCore/platform/graphics/CornerRadii.h:
(WebCore::CornerRadii::CornerRadii):
(WebCore::CornerRadii::m_topRight):
(WebCore::CornerRadii::m_bottomLeft):
(WebCore::CornerRadii::m_bottomRight):
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::horizontalScrollbarFrameRect const):
(WebCore::Internals::verticalScrollbarFrameRect const):
* Source/WebCore/testing/Internals.h:
* Source/WebCore/testing/Internals.idl:
* Source/WebKit/Platform/spi/mac/AppKitSPI.h:
* Source/WebKit/Shared/WebCoreArgumentCoders.serialization.in:
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _viewDidChangeEffectiveCornerRadii]):
(-[WKWebView _cornerConfiguration]):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/WebPageProxyInternals.h:
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setScrollbarAvoidanceCornerRadii):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::scrollbarAvoidanceCornerRadii const):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::setScrollbarAvoidanceCornerRadii):
* Tools/TestWebKitAPI/Tests/TestWebKitAPI/mac/AppKitSPI.h:
* Tools/TestWebKitAPI/Tests/mac/ScrollbarTests.mm:
(-[ContainerView setCustomCornerRadius:]):
(-[ContainerView _cornerConfiguration]):
(TestWebKitAPI::scrollbarFrameRect):
(TestWebKitAPI::verifyVerticalScrollbarFrameRectIsCorrect):
(TestWebKitAPI::verifyHorizontalScrollbarFrameRectIsCorrect):
(TestWebKitAPI::verifyScrollbarFrameRectsAreCorrect):
(TestWebKitAPI::verifyWebViewHasExpectedCornerRadii):
(TestWebKitAPI::scrollbarAvoidanceTestWebView):
(TestWebKitAPI::scrollbarAvoidanceTestWindow):
(TestWebKitAPI::TEST(ScrollbarTests, ScrollbarAvoidanceForTitledWindow)):
(TestWebKitAPI::TEST(ScrollbarTests,
ScrollbarAvoidanceForWindowWithUnifiedCompactToolbar)):
(TestWebKitAPI::TEST(ScrollbarTests,
ScrollbarAvoidanceForWindowWithUnifiedToolbar)):
(TestWebKitAPI::TEST(ScrollbarTests, ScrollbarAvoidanceNoCornerRadii)):
(TestWebKitAPI::runTestCaseWithCornerRadii):
(TestWebKitAPI::TEST(ScrollbarTests,
ScrollbarAvoidanceInConcentricContainerWithUniformCornerRadii)):
(TestWebKitAPI::TEST(ScrollbarTests,
ScrollbarAvoidanceInConcentricContainerWithNonUniformCornerRadii)):
Canonical link: https://commits.webkit.org/306100@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications