Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: 4a75204691978d5a12d49d79967265a3669db9b4 https://github.com/WebKit/WebKit/commit/4a75204691978d5a12d49d79967265a3669db9b4 Author: Wenson Hsieh <wenson_hs...@apple.com> Date: 2025-08-27 (Wed, 27 Aug 2025)
Changed paths: M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h M Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h M Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm Log Message: ----------- [Liquid Glass] [macOS] Safari tab bar changes colors when switching between default viewer and fullscreen https://bugs.webkit.org/show_bug.cgi?id=298001 rdar://158063198 Reviewed by Aditya Keerthi. When entering element fullscreen, the web view is swapped for a `WebCoreFullScreenPlaceholderView` that fills the same frame, while the real web view is moved out into the view controller for fullscreen presentation. With regards to the top scroll pocket (i.e. the background behind the tab bar), this causes a flash if the capture color of the top pocket is different than the background color of Safari's title bar (i.e. the system background color) when beginning or ending the transition animation, as the color changes from the top pocket color of the web view to the system background. To fix this, we teach `WebCoreFullScreenPlaceholderView` (now `WKFullScreenPlaceholderView`, a subclass) to manage its own top scroll pocket that matches the original web view's color, style, and height (i.e. top content inset amount), and similarly adopt `NSScrollViewSeparatorTrackingAdapter`. The end result is that as the web view is being unparented, the top scroll pocket is swapped out with the placeholder view's scroll pocket, whose color (and other properties) match the original pocket. See below for more details. * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _copyTopScrollPocket]): Add an internal helper method to create a clone of the top scroll pocket. * Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h: * Source/WebKit/UIProcess/mac/WKFullScreenWindowController.h: * Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm: Make an internal `WKFullScreenPlaceholderView` that subclasses `WebCoreFullScreenPlaceholderView` and implements the `NSScrollViewSeparatorTrackingAdapter` methods necessary to ensure that Safari's title bar container view's scroll pocket ducks out of the way, revealing this placeholder pocket. (-[WKFullScreenPlaceholderView scrollViewFrame]): (-[WKFullScreenPlaceholderView hasScrolledContentsUnderTitlebar]): (-[WKFullScreenPlaceholderView setTopScrollPocket:topContentInset:]): (-[WKFullScreenPlaceholderView setFrame:]): (-[WKFullScreenPlaceholderView setBounds:]): (-[WKFullScreenPlaceholderView setFrameSize:]): (-[WKFullScreenPlaceholderView setBoundsSize:]): Ensure that we properly recompute and update the placeholder scroll pocket's frame whenever the size of this placeholder view changes. This ensures that the placeholder's scroll pocket frame doesn't become stale as the Safari window is resized, while the actual web view is in the element fullscreen view controller. (-[WKFullScreenPlaceholderView _recomputeScrollPocketFrame]): (-[WKFullScreenPlaceholderView scrollViewDrawsMagicPocket]): (-[WKFullScreenPlaceholderView registerPocketContainer:onEdge:]): (-[WKFullScreenPlaceholderView unregisterPocketContainer:onEdge:]): (-[WKFullScreenWindowController initWithWindow:webView:page:]): (-[WKFullScreenWindowController webViewPlaceholder]): (-[WKFullScreenWindowController _continueEnteringFullscreenAfterPostingNotification:]): See description for more details. (-[WKFullScreenWindowController completeFinishExitFullScreenAnimation]): Make sure we unregister the scroll view adapter before unparenting and clearing out the placeholder. Canonical link: https://commits.webkit.org/299240@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes