Title: [295360] trunk/Source
Revision
295360
Author
wenson_hs...@apple.com
Date
2022-06-07 12:52:13 -0700 (Tue, 07 Jun 2022)

Log Message

Upstream WebKit support for Stage Manager on iPadOS
https://bugs.webkit.org/show_bug.cgi?id=241372
rdar://94540740

Reviewed by Tim Horton.

Upstream support for viewport and snapshotting behaviors that are specific to window resizing on
iPad, when Stage Manager is enabled. In particular, this merges the existing `MULTITASKING_MODE`
and `MAC_CATALYST_LIVE_RESIZE` feature flags into a single `UIKIT_RESIZABLE_WINDOWS` flag, which is
used to guard both snapshotting and viewport code.

* Source/WTF/wtf/PlatformHave.h:
* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Source/WebKit/Shared/WebPageCreationParameters.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView dealloc]):
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView setFrame:]):
(-[WKWebView setBounds:]):
(-[WKWebView _registerForNotifications]):
(-[WKWebView _processWillSwapOrDidExit]):
(-[WKWebView didMoveToWindow]):
(-[WKWebView _isWindowResizingEnabled]):
(-[WKWebView _enhancedWindowingToggled:]):
(-[WKWebView _beginAnimatedResizeWithUpdates:]):
(-[WKWebView _multitaskingModeDidChange:]): Deleted.
* Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm:
(-[WKWebView _hasResizeAssertion]):
* Source/WebKit/UIProcess/PageClient.h:
(WebKit::PageClient::hasResizableWindows const):
(WebKit::PageClient::isInMultitaskingMode const): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::creationParameters):
(WebKit::WebPageProxy::setIsWindowResizingEnabled):
(WebKit::WebPageProxy::setIsInMultitaskingMode): Deleted.
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::hasResizableWindows const):
(WebKit::PageClientImpl::isInMultitaskingMode const): Deleted.
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::isDesktopClassBrowsingRecommended const):
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didCommitLoad):
(WebKit::WebPage::setIsWindowResizingEnabled):
(WebKit::WebPage::setIsInMultitaskingMode): Deleted.
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::dynamicViewportSizeUpdate):
(WebKit::WebPage::shouldEnableViewportBehaviorsForResizableWindows const):
(WebKit::WebPage::usesMultitaskingModeViewportBehaviors const): Deleted.

Canonical link: https://commits.webkit.org/251369@main

Modified Paths

Diff

Modified: trunk/Source/WTF/wtf/PlatformHave.h (295359 => 295360)


--- trunk/Source/WTF/wtf/PlatformHave.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WTF/wtf/PlatformHave.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -1214,3 +1214,7 @@
     || ((PLATFORM(IOS) || PLATFORM(MACCATALYST)) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 160000))
 #define HAVE_VK_IMAGE_TRANSLATION_SUPPORT 1
 #endif
+
+#if !defined(HAVE_UIKIT_RESIZABLE_WINDOWS) && PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160000
+#define HAVE_UIKIT_RESIZABLE_WINDOWS 1
+#endif

Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (295359 => 295360)


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -89,6 +89,7 @@
 #import <UIKit/UIWebScrollView.h>
 #import <UIKit/UIWebTiledView.h>
 #import <UIKit/UIWebTouchEventsGestureRecognizer.h>
+#import <UIKit/UIWindowScene_Private.h>
 #import <UIKit/UIWindow_Private.h>
 #import <UIKit/_UIApplicationRotationFollowing.h>
 #import <UIKit/_UIBackdropViewSettings.h>
@@ -149,6 +150,11 @@
 #import <UIKit/UIHoverEvent_RequiresApproval.h>
 #endif
 
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+#import <UIKit/UIWindowScene_RequiresApproval.h>
+#import <UIKit/_UIInvalidatable.h>
+#endif
+
 // FIXME: STAGING for rdar://75546704 Remove later.
 #define UIWKSelectionFlipped 2
 
@@ -1380,6 +1386,19 @@
 @end
 #endif
 
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+
+@protocol _UIInvalidatable <NSObject>
+- (void)_invalidate;
+@end
+
+@interface UIWindowScene ()
+- (id<_UIInvalidatable>)_holdLiveResizeSnapshotForReason:(NSString *)reason;
+@property (nonatomic, readonly) BOOL _enhancedWindowingEnabled;
+@end
+
+#endif // HAVE(UIKIT_RESIZABLE_WINDOWS)
+
 #endif // USE(APPLE_INTERNAL_SDK)
 
 @interface UITextInteractionAssistant (IPI)
@@ -1567,22 +1586,6 @@
 
 #endif
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
-
-#if __has_include(<UIKit/_UIInvalidatable.h>)
-#include <UIKit/_UIInvalidatable.h>
-#else
-@protocol _UIInvalidatable <NSObject>
-- (void)_invalidate;
-@end
-#endif
-
-@interface UIWindowScene (Staging_86494115)
-- (id<_UIInvalidatable>)_holdLiveResizeSnapshotForReason:(NSString *)reason;
-@end
-
-#endif // HAVE(MAC_CATALYST_LIVE_RESIZE)
-
 WTF_EXTERN_C_BEGIN
 
 BOOL UIKeyboardEnabledInputModesAllowOneToManyShortcuts(void);

Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp (295359 => 295360)


--- trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp	2022-06-07 19:52:13 UTC (rev 295360)
@@ -190,8 +190,8 @@
     encoder << requiresUserActionForEditingControlsManager;
 #endif
 
-#if HAVE(MULTITASKING_MODE)
-    encoder << isInMultitaskingMode;
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    encoder << hasResizableWindows;
 #endif
 
     encoder << contentSecurityPolicyModeForExtension;
@@ -605,8 +605,8 @@
         return std::nullopt;
 #endif
 
-#if HAVE(MULTITASKING_MODE)
-    if (!decoder.decode(parameters.isInMultitaskingMode))
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    if (!decoder.decode(parameters.hasResizableWindows))
         return std::nullopt;
 #endif
 

Modified: trunk/Source/WebKit/Shared/WebPageCreationParameters.h (295359 => 295360)


--- trunk/Source/WebKit/Shared/WebPageCreationParameters.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/Shared/WebPageCreationParameters.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -266,7 +266,7 @@
     bool requiresUserActionForEditingControlsManager { false };
 #endif
 
-    bool isInMultitaskingMode { false };
+    bool hasResizableWindows { false };
 
     WebCore::ContentSecurityPolicyModeForExtension contentSecurityPolicyModeForExtension { WebCore::ContentSecurityPolicyModeForExtension::None };
 };

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm	2022-06-07 19:52:13 UTC (rev 295360)
@@ -658,7 +658,7 @@
     CFNotificationCenterRemoveObserver(CFNotificationCenterGetDarwinNotifyCenter(), (__bridge const void *)(self), (__bridge CFStringRef)notificationName.get(), nullptr);
 #endif
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
     [self _invalidateResizeAssertions];
 #endif
 

Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -223,7 +223,7 @@
     std::optional<WebKit::TransactionID> _firstTransactionIDAfterPageRestore;
     double _scaleToRestore;
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
     Vector<RetainPtr<id<_UIInvalidatable>>> _resizeAssertions;
 #endif
 

Modified: trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -52,7 +52,7 @@
 - (void)_accessibilitySettingsDidChange:(NSNotification *)notification;
 
 - (void)_frameOrBoundsChanged;
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
 - (void)_invalidateResizeAssertions;
 #endif
 
@@ -172,8 +172,8 @@
 @property (nonatomic, readonly, getter=_isRetainingActiveFocusedState) BOOL _retainingActiveFocusedState;
 @property (nonatomic, readonly) int32_t _deviceOrientation;
 
-#if HAVE(MULTITASKING_MODE)
-@property (nonatomic, readonly) BOOL _isInMultitaskingMode;
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+@property (nonatomic, readonly) BOOL _isWindowResizingEnabled;
 #endif
 
 @end

Modified: trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm	2022-06-07 19:52:13 UTC (rev 295360)
@@ -123,7 +123,7 @@
     if (!CGSizeEqualToSize(oldFrame.size, frame.size)) {
         [self _frameOrBoundsChanged];
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
         [self _acquireResizeAssertionForReason:@"-[WKWebView setFrame:]"];
 #endif
     }
@@ -138,7 +138,7 @@
     if (!CGSizeEqualToSize(oldBounds.size, bounds.size)) {
         [self _frameOrBoundsChanged];
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
         [self _acquireResizeAssertionForReason:@"-[WKWebView setBounds:]"];
 #endif
     }
@@ -196,8 +196,8 @@
     [center addObserver:self selector:@selector(_accessibilitySettingsDidChange:) name:UIAccessibilityInvertColorsStatusDidChangeNotification object:nil];
     [center addObserver:self selector:@selector(_accessibilitySettingsDidChange:) name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil];
 
-#if HAVE(MULTITASKING_MODE)
-    [center addObserver:self selector:@selector(_multitaskingModeDidChange:) name:self.multitaskingModeChangedNotificationName object:nil];
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    [center addObserver:self selector:@selector(_enhancedWindowingToggled:) name:_UIWindowSceneEnhancedWindowingModeChanged object:nil];
 #endif
 }
 
@@ -706,7 +706,7 @@
     [self _hidePasswordView];
     [self _cancelAnimatedResize];
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
     [self _invalidateResizeAssertions];
 #endif
 
@@ -1562,15 +1562,25 @@
     _page->activityStateDidChange(WebCore::ActivityState::allFlags());
     _page->webViewDidMoveToWindow();
     [self _presentCaptivePortalModeAlertIfNeeded];
-#if HAVE(MULTITASKING_MODE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
     if (_page->hasRunningProcess() && self.window)
-        _page->setIsInMultitaskingMode(self._isInMultitaskingMode);
+        _page->setIsWindowResizingEnabled(self._isWindowResizingEnabled);
 #endif
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
     [self _invalidateResizeAssertions];
 #endif
 }
 
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+
+- (BOOL)_isWindowResizingEnabled
+{
+    UIWindowScene *scene = self.window.windowScene;
+    return [scene respondsToSelector:@selector(_enhancedWindowingEnabled)] && scene._enhancedWindowingEnabled;
+}
+
+#endif // HAVE(UIKIT_RESIZABLE_WINDOWS)
+
 - (void)_setOpaqueInternal:(BOOL)opaque
 {
     [super setOpaque:opaque];
@@ -2005,7 +2015,7 @@
     [self _scheduleVisibleContentRectUpdate];
 }
 
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
 
 - (void)_acquireResizeAssertionForReason:(NSString *)reason
 {
@@ -2055,7 +2065,7 @@
         [resizeAssertion _invalidate];
 }
 
-#endif // HAVE(MAC_CATALYST_LIVE_RESIZE)
+#endif // HAVE(UIKIT_RESIZABLE_WINDOWS)
 
 // Unobscured content rect where the user can interact. When the keyboard is up, this should be the area above or below the keyboard, wherever there is enough space.
 - (CGRect)_contentRectForUserInteraction
@@ -2759,9 +2769,9 @@
 
 #endif
 
-#if HAVE(MULTITASKING_MODE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
 
-- (void)_multitaskingModeDidChange:(NSNotification *)notification
+- (void)_enhancedWindowingToggled:(NSNotification *)notification
 {
     if (dynamic_objc_cast<UIWindowScene>(notification.object) != self.window.windowScene)
         return;
@@ -2769,10 +2779,10 @@
     if (!_page || !_page->hasRunningProcess())
         return;
 
-    _page->setIsInMultitaskingMode(self._isInMultitaskingMode);
+    _page->setIsWindowResizingEnabled(self._isWindowResizingEnabled);
 }
 
-#endif // HAVE(MULTITASKING_MODE)
+#endif // HAVE(UIKIT_RESIZABLE_WINDOWS)
 
 @end
 
@@ -3274,8 +3284,8 @@
     // Compute the new scale to keep the current content width in the scrollview.
     CGFloat oldWebViewWidthInContentViewCoordinates = oldUnobscuredContentRect.width();
     _animatedResizeOriginalContentWidth = [&] {
-#if HAVE(MULTITASKING_MODE)
-        if (self._isInMultitaskingMode)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+        if (self._isWindowResizingEnabled)
             return contentSizeInContentViewCoordinates.width;
 #endif
         return std::min(contentSizeInContentViewCoordinates.width, oldWebViewWidthInContentViewCoordinates);

Modified: trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm	2022-06-07 19:52:13 UTC (rev 295360)
@@ -483,7 +483,7 @@
 
 - (BOOL)_hasResizeAssertion
 {
-#if HAVE(MAC_CATALYST_LIVE_RESIZE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
     if (!_resizeAssertions.isEmpty())
         return YES;
 #endif

Modified: trunk/Source/WebKit/UIProcess/PageClient.h (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/PageClient.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/PageClient.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -554,7 +554,7 @@
     virtual WebCore::DataOwnerType dataOwnerForPasteboard(PasteboardAccessIntent) const { return WebCore::DataOwnerType::Undefined; }
 #endif
 
-    virtual bool isInMultitaskingMode() const { return false; }
+    virtual bool hasResizableWindows() const { return false; }
 
 #if ENABLE(IMAGE_ANALYSIS)
     virtual void requestTextRecognition(const URL& imageURL, const ShareableBitmap::Handle& imageData, const String& sourceLanguageIdentifier, const String& targetLanguageIdentifier, CompletionHandler<void(WebCore::TextRecognitionResult&&)>&& completion) { completion({ }); }

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.cpp (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-06-07 19:52:13 UTC (rev 295360)
@@ -8523,8 +8523,8 @@
     parameters.requiresUserActionForEditingControlsManager = m_configuration->requiresUserActionForEditingControlsManager();
 #endif
 
-#if HAVE(MULTITASKING_MODE)
-    parameters.isInMultitaskingMode = pageClient().isInMultitaskingMode();
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    parameters.hasResizableWindows = pageClient().hasResizableWindows();
 #endif
 
     return parameters;
@@ -11416,11 +11416,11 @@
 
 #endif
 
-#if HAVE(MULTITASKING_MODE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
 
-void WebPageProxy::setIsInMultitaskingMode(bool isInMultitaskingMode)
+void WebPageProxy::setIsWindowResizingEnabled(bool hasResizableWindows)
 {
-    send(Messages::WebPage::SetIsInMultitaskingMode(isInMultitaskingMode));
+    send(Messages::WebPage::SetIsWindowResizingEnabled(hasResizableWindows));
 }
 
 #endif

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -2110,8 +2110,8 @@
     void shouldAllowRemoveBackground(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&);
 #endif
 
-#if HAVE(MULTITASKING_MODE)
-    void setIsInMultitaskingMode(bool);
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    void setIsWindowResizingEnabled(bool);
 #endif
 
 #if PLATFORM(MAC)

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -310,7 +310,7 @@
     void beginElementFullscreenVideoExtraction(const ShareableBitmap::Handle&, WebCore::FloatRect) final;
     void cancelElementFullscreenVideoExtraction() final;
 
-    bool isInMultitaskingMode() const final;
+    bool hasResizableWindows() const final;
 
 #if ENABLE(VIDEO_PRESENTATION_MODE)
     void didEnterFullscreen() final;

Modified: trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm	2022-06-07 19:52:13 UTC (rev 295360)
@@ -1083,10 +1083,10 @@
     [m_contentView cancelElementFullscreenVideoExtraction];
 }
 
-bool PageClientImpl::isInMultitaskingMode() const
+bool PageClientImpl::hasResizableWindows() const
 {
-#if HAVE(MULTITASKING_MODE)
-    return [m_webView _isInMultitaskingMode];
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    return [m_webView _isWindowResizingEnabled];
 #else
     return false;
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (295359 => 295360)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2022-06-07 19:52:13 UTC (rev 295360)
@@ -1397,7 +1397,7 @@
         return false;
 
 #if !PLATFORM(MACCATALYST)
-    if (!pageClient().isInMultitaskingMode() && webViewSizeIsNarrow(viewSize()))
+    if (!pageClient().hasResizableWindows() && webViewSizeIsNarrow(viewSize()))
         return false;
 #endif
 

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp (295359 => 295360)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp	2022-06-07 19:52:13 UTC (rev 295360)
@@ -541,8 +541,8 @@
 #if HAVE(TOUCH_BAR)
     , m_requiresUserActionForEditingControlsManager(parameters.requiresUserActionForEditingControlsManager)
 #endif
-#if HAVE(MULTITASKING_MODE)
-    , m_isInMultitaskingMode(parameters.isInMultitaskingMode)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    , m_isWindowResizingEnabled(parameters.hasResizableWindows)
 #endif
 #if ENABLE(META_VIEWPORT)
     , m_forceAlwaysUserScalable(parameters.ignoresViewportScaleLimits)
@@ -6702,7 +6702,7 @@
     
     bool viewportChanged = false;
 
-    m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths(usesMultitaskingModeViewportBehaviors());
+    m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths(shouldEnableViewportBehaviorsForResizableWindows());
 
     LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_identifier.toUInt64() << " didCommitLoad setting content size to " << coreFrame->view()->contentsSize());
     if (m_viewportConfiguration.setContentsSize(coreFrame->view()->contentsSize()))
@@ -8115,18 +8115,18 @@
 
 #endif
 
-#if HAVE(MULTITASKING_MODE)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
 
-void WebPage::setIsInMultitaskingMode(bool value)
+void WebPage::setIsWindowResizingEnabled(bool value)
 {
-    if (m_isInMultitaskingMode == value)
+    if (m_isWindowResizingEnabled == value)
         return;
 
-    m_isInMultitaskingMode = value;
-    m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths(usesMultitaskingModeViewportBehaviors());
+    m_isWindowResizingEnabled = value;
+    m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths(shouldEnableViewportBehaviorsForResizableWindows());
 }
 
-#endif // HAVE(MULTITASKING_MODE)
+#endif // HAVE(UIKIT_RESIZABLE_WINDOWS)
 
 bool WebPage::handlesPageScaleGesture()
 {

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.h (295359 => 295360)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.h	2022-06-07 19:52:13 UTC (rev 295360)
@@ -1547,8 +1547,8 @@
     void shouldAllowRemoveBackground(const WebCore::ElementContext&, CompletionHandler<void(bool)>&&) const;
 #endif
 
-#if HAVE(MULTITASKING_MODE)
-    void setIsInMultitaskingMode(bool);
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    void setIsWindowResizingEnabled(bool);
 #endif
 
 private:
@@ -1801,7 +1801,7 @@
     void endPrintingImmediately();
 
 #if ENABLE(META_VIEWPORT)
-    bool usesMultitaskingModeViewportBehaviors() const;
+    bool shouldEnableViewportBehaviorsForResizableWindows() const;
 #endif
 
 #if HAVE(APP_ACCENT_COLORS)
@@ -2274,8 +2274,8 @@
 #endif
     OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges;
 
-#if HAVE(MULTITASKING_MODE)
-    bool m_isInMultitaskingMode { false };
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    bool m_isWindowResizingEnabled { false };
 #endif
 
 #if ENABLE(CONTEXT_MENUS)

Modified: trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in (295359 => 295360)


--- trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in	2022-06-07 19:52:13 UTC (rev 295360)
@@ -687,7 +687,7 @@
     ModelInlinePreviewDidFailToLoad(WebCore::GraphicsLayer::PlatformLayerID layerID, WebCore::ResourceError error)
 #endif
 
-#if HAVE(MULTITASKING_MODE)
-    SetIsInMultitaskingMode(bool isInMultitaskingMode)
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    SetIsWindowResizingEnabled(bool hasResizableWindows)
 #endif
 }

Modified: trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (295359 => 295360)


--- trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2022-06-07 18:38:05 UTC (rev 295359)
+++ trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm	2022-06-07 19:52:13 UTC (rev 295360)
@@ -3655,7 +3655,7 @@
     double visibleHorizontalFraction = 1;
     float relativeHorizontalPositionInNodeAtCenter = 0;
     float relativeVerticalPositionInNodeAtCenter = 0;
-    if (!usesMultitaskingModeViewportBehaviors()) {
+    if (!shouldEnableViewportBehaviorsForResizableWindows()) {
         visibleHorizontalFraction = frameView.unobscuredContentSize().width() / oldContentSize.width();
         IntPoint unobscuredContentRectCenter = frameView.unobscuredContentRect().center();
 
@@ -3695,7 +3695,7 @@
 
     IntSize newContentSize = frameView.contentsSize();
 
-    bool scaleToFitContent = (!usesMultitaskingModeViewportBehaviors() || !wasAtInitialScale) && m_userHasChangedPageScaleFactor;
+    bool scaleToFitContent = (!shouldEnableViewportBehaviorsForResizableWindows() || !wasAtInitialScale) && m_userHasChangedPageScaleFactor;
     double scale = scaleAfterViewportWidthChange(targetScale, scaleToFitContent, m_viewportConfiguration, targetUnobscuredRectInScrollViewCoordinates.width(), newContentSize, oldContentSize, visibleHorizontalFraction);
     FloatRect newUnobscuredContentRect = targetUnobscuredRect;
     FloatRect newExposedContentRect = targetExposedContentRect;
@@ -3711,7 +3711,7 @@
         double newUnobscuredRectHeight = targetUnobscuredRect.height() * scaleDifference;
         double newUnobscuredRectX;
         double newUnobscuredRectY;
-        if (usesMultitaskingModeViewportBehaviors()) {
+        if (shouldEnableViewportBehaviorsForResizableWindows()) {
             newUnobscuredRectX = oldUnobscuredContentRect.x();
             newUnobscuredRectY = oldUnobscuredContentRect.y();
         } else {
@@ -3992,10 +3992,10 @@
     return m_page->settings().shouldIgnoreMetaViewport();
 }
 
-bool WebPage::usesMultitaskingModeViewportBehaviors() const
+bool WebPage::shouldEnableViewportBehaviorsForResizableWindows() const
 {
-#if HAVE(MULTITASKING_MODE)
-    return shouldIgnoreMetaViewport() && m_isInMultitaskingMode;
+#if HAVE(UIKIT_RESIZABLE_WINDOWS)
+    return shouldIgnoreMetaViewport() && m_isWindowResizingEnabled;
 #else
     return false;
 #endif
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to