Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: f1caad5335df2a781bf0998c20bdde7234fcad8d
https://github.com/WebKit/WebKit/commit/f1caad5335df2a781bf0998c20bdde7234fcad8d
Author: Wenson Hsieh <[email protected]>
Date: 2025-06-24 (Tue, 24 Jun 2025)
Changed paths:
M Source/WebCore/WebCore.xcodeproj/project.pbxproj
M Source/WebCore/page/PageColorSampler.h
M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
M Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h
M Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
M Tools/TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm
A Tools/TestWebKitAPI/Tests/WebKitCocoa/top-fixed-element.html
Log Message:
-----------
[Liquid Glass] [iOS] Blank gap above top fixed header when rubber-banding
against top of page
https://bugs.webkit.org/show_bug.cgi?id=294933
rdar://154233194
Reviewed by Abrar Rahman Protyasha.
Make an adjustment to how we compute `-_obscuredInsetsForFixedColorExtension`
on iOS, such that we
expand the height of the top fixed color to span the area above the content
while rubber-banding.
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/page/PageColorSampler.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _obscuredInsetsForFixedColorExtension]):
There are a few conditions where we avoid performing this extension:
1. If the scroll view is not scrolled past the top `adjustedContentInset`,
we're not rubber-
banding, so there's no gap to close in the first place.
2. If there is no predominant color on the top, then there is either no
detected fixed header near
the top of the page, or the fixed header near the top of the page has a
backdrop filter. In
either case we just fall back to the background color, which is what would
show up in the gap
anyways without extending the height of the color extension view.
3. If the sampled page top color is different than the sampled top
fixed/sticky color, then there's
no need to extend the height of the color extension view because the color
extension view isn't
adjacent to the top of the page. This can occur in the case where the
header is sticky, or
changes between static and fixed depending on the page's scroll position.
4. If the under-page background color is the same as the sampled top fixed
color, then there's no
need to extend the height of the color extension view since the result
would be visually similar
anyways.
If none of the conditions above are met, we expand the height of the color
extension view.
* Source/WebKit/UIProcess/API/ios/WKWebViewPrivateForTestingIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _colorExtensionViewForTesting:]):
Add a testing-only helper to retrieve color extension views on each side.
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SampledPageTopColor.mm:
(TEST(SampledPageTopColor, TopColorExtensionWhenRubberBanding)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/top-fixed-element.html: Added.
Add an API test to exercise this new behavior, by checking the height of fixed
color extension
views before and after scrolling past the top scroll extent.
Canonical link: https://commits.webkit.org/296602@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