Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: af80de9496321c94809f3be7b8d79d7a5e9bd6dc
https://github.com/WebKit/WebKit/commit/af80de9496321c94809f3be7b8d79d7a5e9bd6dc
Author: Wenson Hsieh <[email protected]>
Date: 2025-10-14 (Tue, 14 Oct 2025)
Changed paths:
M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
A Tools/TestWebKitAPI/Tests/WebKitCocoa/safe-area-env.html
M Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm
Log Message:
-----------
Incorrect safe area values with scrollview inset and obscured inset (in
clients other than Safari)
https://bugs.webkit.org/show_bug.cgi?id=300232
rdar://162521096
Reviewed by Abrar Rahman Protyasha.
Make a small adjustment to how safe area inset CSS environment variables are
computed, when obscured
insets are set. Currently, `-_computedUnobscuredSafeAreaInset` will return
either an override value
in `_unobscuredSafeAreaInsets` if the WebKit client uses the
`_setUnobscuredSafeAreaInsets:` SPI,
and otherwise falls back to `-[WKWebView safeAreaInsets]`.
However, this is incorrect in the case where:
- Safe area insets are nonzero.
- Obscured insets are set on sides with safe area insets (either through
`-_setObscuredInsets:`,
or the newer API `-setObscuredContentInsets:`.
Because the layout viewport begins after the obscured inset area on all sides,
plumbing the full
safe area inset amount on any of these edges causes that CSS safe area inset
value to be excessively
large (and in the case where the obscured content inset is larger than the safe
area inset, the safe
area inset for CSS should simply be 0).
Correct this by automatically subtracting obscured insets from safe area insets
in the case where
`_haveSetUnobscuredSafeAreaInsets` is false.
Tests:
WKScrollViewTests.SafeAreaEnvironmentVariablesAccountForObscuredContentInsets
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _computedUnobscuredSafeAreaInset]):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/safe-area-env.html: Added.
* Tools/TestWebKitAPI/Tests/ios/WKScrollViewTests.mm:
(TestWebKitAPI::TEST(WKScrollViewTests,
SafeAreaEnvironmentVariablesAccountForObscuredContentInsets)):
Canonical link: https://commits.webkit.org/301534@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