Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7928c62c0d1c69e1c9deafec127b236cc4663626
https://github.com/WebKit/WebKit/commit/7928c62c0d1c69e1c9deafec127b236cc4663626
Author: Aditya Keerthi <[email protected]>
Date: 2025-11-19 (Wed, 19 Nov 2025)
Changed paths:
A
LayoutTests/fast/viewport/ios/viewport-fit-auto-safe-area-inset-change-expected.txt
A
LayoutTests/fast/viewport/ios/viewport-fit-auto-safe-area-inset-change.html
M LayoutTests/resources/ui-helper.js
M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
M Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm
Log Message:
-----------
[iOS] Viewport size does not update when `viewport-fit` value is changed
https://bugs.webkit.org/show_bug.cgi?id=302696
rdar://164943708
Reviewed by Abrar Rahman Protyasha and Wenson Hsieh.
When the `viewport-fit` value is changed, the adjusted content inset on the
`WKScrollView` is also changed. These insets should affect the viewport size.
However, there is currently no logic that ensures the view layout size is
updated following a change to the adjusted content inset. In the common case,
where safe areas are changed by the system, the size update is driven by
`-[WKWebView layoutSubviews]`, which triggers an update under
`-[WKWebView _frameOrBoundsMayHaveChanged]`. This does not account for
WebKit-driven changes.
Fix by dispatching a view layout size update whenever the adjusted content inset
is changed. This is a no-op if the size has not actually changed.
*
LayoutTests/fast/viewport/ios/viewport-fit-auto-safe-area-inset-change-expected.txt:
Added.
* LayoutTests/fast/viewport/ios/viewport-fit-auto-safe-area-inset-change.html:
Added.
* LayoutTests/resources/ui-helper.js:
(window.UIHelper.async setSafeAreaInsets):
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView scrollViewDidChangeAdjustedContentInset:]):
Exclude watchOS to align with existing safe area management logic.
* Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm:
(TestWebKitAPI::TEST(WKScrollViewTests,
ContentInsetAdjustmentBehaviorChangeAfterViewportFitChange)):
Canonical link: https://commits.webkit.org/303251@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications