[webkit-changes] [WebKit/WebKit] 14ac3c: WKWebView _obscuredInsets sometimes incorrectly ap...
aestes
noreply at github.com
Thu Aug 29 11:15:02 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 14ac3c34ea68a5a108f2a0687b35473da0f4bab2
https://github.com/WebKit/WebKit/commit/14ac3c34ea68a5a108f2a0687b35473da0f4bab2
Author: Andy Estes <aestes at apple.com>
Date: 2024-08-29 (Thu, 29 Aug 2024)
Changed paths:
M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
Log Message:
-----------
WKWebView _obscuredInsets sometimes incorrectly applied in element fullscreen
https://bugs.webkit.org/show_bug.cgi?id=278842
rdar://131878433
Reviewed by Wenson Hsieh.
When entering element fullscreen, WKFullScreenWindowController saves the state of various WKWebView
properties then resets them to values appropriate for presenting the web view in the element
fullscreen window. Later, it restores the saved properties when exiting element fullscreen.
However, nothing prevents clients from modifying these properties *during* element fullscreen,
overwriting the values previously set by WKFullScreenWindowController and potentially invalidating
the element fullscreen presentation.
While this is an general problem with the design of element fullscreen that this change doesn't
fully address, there is a scenario where _obscuredInsets and _unobscuredSafeAreaInsets are likely
to change at a known time: when WKFullScreenWindowController inserts the web view into the element
fullscreen window the web view's safeAreaInsets may change, and if the client has subclassed
WKWebView and overrode -safeAreaInsetsDidChange then it may choose to modify _obscuredInsets and
_unobscuredSafeAreaInsets (since these values are often derived from safeAreaInsets). The result is
that the content in element fullscreen may be inset even though there are no views obscuring the
web view.
To address this scenario, this changes WKFullScreenWindowController to specifically reset
_obscuredInsets and _unobscuredSafeAreaInsets after the call to -insertSubview:atIndex: in case the
client synchronously modified these properties in response to the web view being reparented.
* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
(-[WKFullScreenWindowController _enterFullScreen:windowScene:]):
Canonical link: https://commits.webkit.org/282915@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list