-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Enable automatic live resize on iPadOS at runtime
https://bugs.webkit.org/show_bug.cgi?id=274410 Reviewed by Abrar Rahman Protyasha. Enable automatic live resize on iPad, with runtime enablement guarded by a system feature flag. Additionally, remove usage of two SPIs that currently support automatic live resize behaviors: • `_UIWindowSceneDidEndLiveResizeNotification` • `-[UIWindowScene _isInLiveResize]` ...by instead changing how automatic live resize works: (a) Don't wait for the live resize gesture to end before allowing geometry updates to commence; instead, use an arbitrary hysteresis of 500 ms to determine when the viewport dimensions have stabilized, before ending live resize. (b) Use automatic live resize whenever the window itself is changing size; to detect this, keep track of the last known size of the window containing the web view, and only trigger live resize when this size is changing. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: * Source/WebKit/Platform/spi/ios/UIKitSPI.h: * Source/WebKit/Shared/WebPreferencesDefaultValues.h: * Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm: (WebKit::defaultAutomaticLiveResizeEnabled): * Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h: * Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm: (-[WKWebView didMoveToWindow]): (-[WKWebView _beginAutomaticLiveResizeIfNeeded]): Refactor this so that we debounce the new "end live resize" timer instead of just early returning when the size changes. (-[WKWebView _rescheduleEndLiveResizeTimer]): (-[WKWebView _acquireResizeAssertionForReason:]): Remove unnecessary runtime staging, since support for this SPI has long shipped. (-[WKWebView _endLiveResize]): (-[WKWebView _destroyEndLiveResizeObserver]): Deleted. Replace this notification observer with an `NSTimer` instead, which is debounced whenever the web view size changes, and otherwise fires after a fixed delay of half a second. Canonical link: https://commits.webkit.org/279030@main
- Loading branch information
Showing
6 changed files
with
76 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters