Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 66975840c9fa80bd68a3582c79eda2a7032d36fe
https://github.com/WebKit/WebKit/commit/66975840c9fa80bd68a3582c79eda2a7032d36fe
Author: Wenson Hsieh <[email protected]>
Date: 2025-06-23 (Mon, 23 Jun 2025)
Changed paths:
M Source/WebKit/Platform/spi/mac/AppKitSPI.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/Cocoa/WKColorExtensionView.mm
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
Log Message:
-----------
[macOS] Adopt -[NSScrollPocket setPrefersSolidColorHardPocket:] for
WKWebView's top scroll edge effect
https://bugs.webkit.org/show_bug.cgi?id=294856
rdar://154114377
Reviewed by Abrar Rahman Protyasha.
Adopt `-[NSScrollPocket setPrefersSolidColorHardPocket:]`, which gives a hint
to AppKit's scroll
pocket that it sits on top of content with a solid background color, and that
it doesn't need to
insert any expensive visual effect views to blur the underlying content, when
using the hard pocket
appearance.
This is true in the case where either:
1. There's a fixed color extension view at the top of the viewport.
2. The page is scrolled to the top (i.e. the pocket is just over the page
background color).
* Source/WebKit/Platform/spi/mac/AppKitSPI.h:
Remove an old staging declaration.
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView colorExtensionViewWillDisappear:]):
(-[WKWebView colorExtensionViewDidAppear:]):
Call into `updatePrefersSolidColorHardPocket()` below.
* Source/WebKit/UIProcess/Cocoa/WKColorExtensionView.mm:
(-[WKColorExtensionView initWithFrame:delegate:]):
Set `.hidden=YES` upon initialization here, so that when we update to the
initial background color,
`isBeingRevealed` is true and we'll actually call into
`-colorExtensionViewDidAppear:`.
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::pageDidScroll):
Call into `updatePrefersSolidColorHardPocket()` below.
(WebKit::WebViewImpl::updatePrefersSolidColorHardPocket):
Consolidate logic for updating `-[NSScrollPocket prefersSolidColorHardPocket]`
state into a single
helper method; called whenever:
- The top fixed color extension view is about to fade out, or
- The top fixed color extension view is done fading in, or
- `m_pageIsScrolledToTop` is changing.
Canonical link: https://commits.webkit.org/296542@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