Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c9f1bebd8e25c4d0c16472d4c046be474632f23e
https://github.com/WebKit/WebKit/commit/c9f1bebd8e25c4d0c16472d4c046be474632f23e
Author: Wenson Hsieh <[email protected]>
Date: 2025-07-08 (Tue, 08 Jul 2025)
Changed paths:
M
LayoutTests/fast/page-color-sampling/color-sampling-for-sticky-element-after-scrolling.html
A
LayoutTests/fast/page-color-sampling/no-resampling-after-scrolling-expected.txt
A LayoutTests/fast/page-color-sampling/no-resampling-after-scrolling.html
M LayoutTests/resources/ui-helper.js
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/LocalFrameView.h
M Source/WebCore/page/Page.cpp
M Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm
M Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
M Source/WebKit/Shared/WebPreferencesDefaultValues.h
Log Message:
-----------
[Liquid Glass] Websites that have fixed/sticky headers after scrolling should
not extend color into pocket
https://bugs.webkit.org/show_bug.cgi?id=295569
rdar://155267492
Reviewed by Abrar Rahman Protyasha.
Add support for a new internal setting,
`TopContentInsetBackgroundCanChangeAfterScrolling`, that
controls whether or not the top sampled fixed/sticky element background color
is allowed to change
as the user scrolls the page. By default, this is only enabled on iPhone (based
on a user interface
idiom check).
*
LayoutTests/fast/page-color-sampling/color-sampling-for-sticky-element-after-scrolling.html:
Force the flag on in this layout test, whose purpose is to check that we're
able to resample when
scrolling. This test still has user-facing impact when running under iPhone UI
idiom.
*
LayoutTests/fast/page-color-sampling/no-resampling-after-scrolling-expected.txt:
Added.
* LayoutTests/fast/page-color-sampling/no-resampling-after-scrolling.html:
Added.
Add a new layout test that exercises this behavior, by forcing the flag off and
scrolling with a
sticky-positioned header.
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.async waitForZoomingOrScrollingToEnd):
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::reset):
(WebCore::LocalFrameView::show):
(WebCore::LocalFrameView::setLastUserScrollType):
Add a flag to keep track of whether we've observed _any_ user-driven explicit
scrolling since the
page load committed.
* Source/WebCore/page/LocalFrameView.h:
* Source/WebCore/page/Page.cpp:
(WebCore::Page::updateFixedContainerEdges):
Implement the main fix here — in the case where:
1. `TopContentInsetBackgroundCanChangeAfterScrolling` is disabled (i.e. macOS
or iPadOS).
2. The main frame has been scrolled explicitly by the user.
3. Document load has finished (i.e. the main document is no longer parsing).
...avoid resampling the top viewport edge; this naturally falls back to the
last sampled color, or
no color at all if we haven't seen a fixed element near the top edge yet.
* Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
(WebKit::defaultTopContentInsetBackgroundCanChangeAfterScrolling):
* Source/WebKit/Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultTopContentInsetBackgroundCanChangeAfterScrolling):
* Source/WebKit/Shared/WebPreferencesDefaultValues.h:
Canonical link: https://commits.webkit.org/297118@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