Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5c93ade672f8cebd902fc2e07d4656f7a4db0d00
https://github.com/WebKit/WebKit/commit/5c93ade672f8cebd902fc2e07d4656f7a4db0d00
Author: Lily Spiniolas <[email protected]>
Date: 2026-06-30 (Tue, 30 Jun 2026)
Changed paths:
M Source/WebKit/Shared/WebPageCreationParameters.h
M Source/WebKit/Shared/WebPageCreationParameters.serialization.in
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
M Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ObscuredContentInsets.mm
Log Message:
-----------
[macOS] Scroll pocket color may be lost in fullscreen after refresh
https://bugs.webkit.org/show_bug.cgi?id=317824
rdar://179516708
Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.
In Safari, if the option to automatically hide the toolbar in fullscreen
is enabled, the top obscured content inset becomes zero while the toolbar
is hidden.
In WebPage::sidesRequiringFixedContainerEdges(), we skip the top edge
if the top obscured content inset is zero. This means that, if a user
is in fullscreen with the toolbar hidden, navigates to a website with
a fixed top header, scrolls down, and then reveals the toolbar, the
scroll pocket color will not match the header.
To fix this, we add an aditional case where we add the top edge:
when the window is in fullscreen, and the toolbar overlay height
is greater than zero.
Tested by new `ObscuredContentInsets` API tests
`ScrollPocketCoversFullScreenTitlebarAfterReload`
and `ScrollPocketCoversFullScreenTitlebarAfterMovingIntoFullScreenWindow`.
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/Shared/WebPageCreationParameters.serialization.in:
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setWindowIsInNativeFullScreen):
(WebKit::WebPageProxy::setFullScreenTitlebarOverlayIsRevealed):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(-[WKWindowVisibilityObserver startObserving:]):
(-[WKWindowVisibilityObserver _windowDidEnterFullScreen:]):
(-[WKWindowVisibilityObserver _windowDidExitFullScreen:]):
(WebKit::WebViewImpl::windowDidEnterOrExitFullScreen):
(WebKit::WebViewImpl::viewDidMoveToWindow):
(WebKit::WebViewImpl::setFullScreenTitlebarOverlayHeight):
(-[WKWindowVisibilityObserver _windowDidEnterOrExitFullScreen:]): Deleted.
* Source/WebKit/WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::sidesRequiringFixedContainerEdges const):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ObscuredContentInsets.mm:
(TestWebKitAPI::TEST(ObscuredContentInsets,
ScrollPocketCoversFullScreenTitlebar)):
(TestWebKitAPI::createFullScreenCapableWindow):
(TestWebKitAPI::TEST(ObscuredContentInsets,
ScrollPocketCoversFullScreenTitlebarAfterReload)):
(TestWebKitAPI::TEST(ObscuredContentInsets,
ScrollPocketCoversFullScreenTitlebarAfterMovingIntoFullScreenWindow)):
Canonical link: https://commits.webkit.org/316145@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications