Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4aa18d17c49cf630bf160a0d0e410d15aa346d03
https://github.com/WebKit/WebKit/commit/4aa18d17c49cf630bf160a0d0e410d15aa346d03
Author: Wenson Hsieh <[email protected]>
Date: 2025-06-13 (Fri, 13 Jun 2025)
Changed paths:
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ObscuredContentInsets.mm
Log Message:
-----------
[macOS] [Liquid Glass] Safari: tab bar background is the wrong color after
toggling dark mode
https://bugs.webkit.org/show_bug.cgi?id=294431
rdar://153116362
Reviewed by Aditya Keerthi.
When switching between dark and light mode, the scroll pocket (i.e. the view
behind the scroll edge
effect in the top obscured content area of the web view) can end up with an
incorrect
`-captureColor` if the new tab just loads an empty page. This happens if
`underPageBackgroundColor`
returns the wrong color (white in dark mode, or dark gray in light mode), which
in turn happens if:
1. `underPageBackgroundColorOverride` is invalid (the client has not
customized the color)
2. `pageExtendedBackgroundColor` is invalid (the web page is totally empty)
3. `+controlBackgroundColor`, a semantic color, gets mapped to the wrong
`WebCore::Color` before
being round-tripped back into a non-semantic `NSColor`, due to
`roundAndClampToSRGBALossy`.
Work around this for now by splitting out existing logic in
`underPageBackgroundColor()` into
`underPageBackgroundColorIgnoringPlatformColor()` (the latter of which ignores
the platform color,
which is `+controlBackgroundColor` on macOS). Then adjust
`updateTopScrollPocketCaptureColor()` to
set the capture color to `underPageBackgroundColorIgnoringPlatformColor()`, and
directly fall back
to `+controlBackgroundColor` (without round-tripping through `WebCore::Color`)
if the former color
is invalid.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::underPageBackgroundColorIgnoringPlatformColor const):
(WebKit::WebPageProxy::underPageBackgroundColor const):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::updateTopScrollPocketCaptureColor):
See above for more detail.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ObscuredContentInsets.mm:
(TestWebKitAPI::TEST(ObscuredContentInsets, ScrollPocketCaptureColor)):
Augment an existing API test to verify that the initial scroll edge effect
capture color is equal to
the semantic `+[NSColor controlBackgroundColor]`.
Canonical link: https://commits.webkit.org/296199@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes