Changeset 295360 in webkit
- Timestamp:
- Jun 7, 2022, 12:52:13 PM (4 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
-
WTF/wtf/PlatformHave.h (modified) (1 diff)
-
WebKit/Platform/spi/ios/UIKitSPI.h (modified) (4 diffs)
-
WebKit/Shared/WebPageCreationParameters.cpp (modified) (2 diffs)
-
WebKit/Shared/WebPageCreationParameters.h (modified) (1 diff)
-
WebKit/UIProcess/API/Cocoa/WKWebView.mm (modified) (1 diff)
-
WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h (modified) (1 diff)
-
WebKit/UIProcess/API/ios/WKWebViewIOS.h (modified) (2 diffs)
-
WebKit/UIProcess/API/ios/WKWebViewIOS.mm (modified) (10 diffs)
-
WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm (modified) (1 diff)
-
WebKit/UIProcess/PageClient.h (modified) (1 diff)
-
WebKit/UIProcess/WebPageProxy.cpp (modified) (2 diffs)
-
WebKit/UIProcess/WebPageProxy.h (modified) (1 diff)
-
WebKit/UIProcess/ios/PageClientImplIOS.h (modified) (1 diff)
-
WebKit/UIProcess/ios/PageClientImplIOS.mm (modified) (1 diff)
-
WebKit/UIProcess/ios/WebPageProxyIOS.mm (modified) (1 diff)
-
WebKit/WebProcess/WebPage/WebPage.cpp (modified) (3 diffs)
-
WebKit/WebProcess/WebPage/WebPage.h (modified) (3 diffs)
-
WebKit/WebProcess/WebPage/WebPage.messages.in (modified) (1 diff)
-
WebKit/WebProcess/WebPage/ios/WebPageIOS.mm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/wtf/PlatformHave.h
r295357 r295360 1215 1215 #define HAVE_VK_IMAGE_TRANSLATION_SUPPORT 1 1216 1216 #endif 1217 1218 #if !defined(HAVE_UIKIT_RESIZABLE_WINDOWS) && PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 160000 1219 #define HAVE_UIKIT_RESIZABLE_WINDOWS 1 1220 #endif -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r294641 r295360 90 90 #import <UIKit/UIWebTiledView.h> 91 91 #import <UIKit/UIWebTouchEventsGestureRecognizer.h> 92 #import <UIKit/UIWindowScene_Private.h> 92 93 #import <UIKit/UIWindow_Private.h> 93 94 #import <UIKit/_UIApplicationRotationFollowing.h> … … 148 149 #if HAVE(UIKIT_HOVER_EVENT_PROTOCOL) 149 150 #import <UIKit/UIHoverEvent_RequiresApproval.h> 151 #endif 152 153 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 154 #import <UIKit/UIWindowScene_RequiresApproval.h> 155 #import <UIKit/_UIInvalidatable.h> 150 156 #endif 151 157 … … 1381 1387 #endif 1382 1388 1389 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 1390 1391 @protocol _UIInvalidatable <NSObject> 1392 - (void)_invalidate; 1393 @end 1394 1395 @interface UIWindowScene () 1396 - (id<_UIInvalidatable>)_holdLiveResizeSnapshotForReason:(NSString *)reason; 1397 @property (nonatomic, readonly) BOOL _enhancedWindowingEnabled; 1398 @end 1399 1400 #endif // HAVE(UIKIT_RESIZABLE_WINDOWS) 1401 1383 1402 #endif // USE(APPLE_INTERNAL_SDK) 1384 1403 … … 1568 1587 #endif 1569 1588 1570 #if HAVE(MAC_CATALYST_LIVE_RESIZE)1571 1572 #if __has_include(<UIKit/_UIInvalidatable.h>)1573 #include <UIKit/_UIInvalidatable.h>1574 #else1575 @protocol _UIInvalidatable <NSObject>1576 - (void)_invalidate;1577 @end1578 #endif1579 1580 @interface UIWindowScene (Staging_86494115)1581 - (id<_UIInvalidatable>)_holdLiveResizeSnapshotForReason:(NSString *)reason;1582 @end1583 1584 #endif // HAVE(MAC_CATALYST_LIVE_RESIZE)1585 1586 1589 WTF_EXTERN_C_BEGIN 1587 1590 -
trunk/Source/WebKit/Shared/WebPageCreationParameters.cpp
r293994 r295360 191 191 #endif 192 192 193 #if HAVE( MULTITASKING_MODE)194 encoder << isInMultitaskingMode;193 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 194 encoder << hasResizableWindows; 195 195 #endif 196 196 … … 606 606 #endif 607 607 608 #if HAVE( MULTITASKING_MODE)609 if (!decoder.decode(parameters. isInMultitaskingMode))608 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 609 if (!decoder.decode(parameters.hasResizableWindows)) 610 610 return std::nullopt; 611 611 #endif -
trunk/Source/WebKit/Shared/WebPageCreationParameters.h
r293994 r295360 267 267 #endif 268 268 269 bool isInMultitaskingMode{ false };269 bool hasResizableWindows { false }; 270 270 271 271 WebCore::ContentSecurityPolicyModeForExtension contentSecurityPolicyModeForExtension { WebCore::ContentSecurityPolicyModeForExtension::None }; -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm
r295346 r295360 659 659 #endif 660 660 661 #if HAVE( MAC_CATALYST_LIVE_RESIZE)661 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 662 662 [self _invalidateResizeAssertions]; 663 663 #endif -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
r293231 r295360 224 224 double _scaleToRestore; 225 225 226 #if HAVE( MAC_CATALYST_LIVE_RESIZE)226 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 227 227 Vector<RetainPtr<id<_UIInvalidatable>>> _resizeAssertions; 228 228 #endif -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
r295223 r295360 53 53 54 54 - (void)_frameOrBoundsChanged; 55 #if HAVE( MAC_CATALYST_LIVE_RESIZE)55 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 56 56 - (void)_invalidateResizeAssertions; 57 57 #endif … … 173 173 @property (nonatomic, readonly) int32_t _deviceOrientation; 174 174 175 #if HAVE( MULTITASKING_MODE)176 @property (nonatomic, readonly) BOOL _is InMultitaskingMode;175 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 176 @property (nonatomic, readonly) BOOL _isWindowResizingEnabled; 177 177 #endif 178 178 -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
r295223 r295360 124 124 [self _frameOrBoundsChanged]; 125 125 126 #if HAVE( MAC_CATALYST_LIVE_RESIZE)126 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 127 127 [self _acquireResizeAssertionForReason:@"-[WKWebView setFrame:]"]; 128 128 #endif … … 139 139 [self _frameOrBoundsChanged]; 140 140 141 #if HAVE( MAC_CATALYST_LIVE_RESIZE)141 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 142 142 [self _acquireResizeAssertionForReason:@"-[WKWebView setBounds:]"]; 143 143 #endif … … 197 197 [center addObserver:self selector:@selector(_accessibilitySettingsDidChange:) name:UIAccessibilityReduceMotionStatusDidChangeNotification object:nil]; 198 198 199 #if HAVE( MULTITASKING_MODE)200 [center addObserver:self selector:@selector(_ multitaskingModeDidChange:) name:self.multitaskingModeChangedNotificationNameobject:nil];199 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 200 [center addObserver:self selector:@selector(_enhancedWindowingToggled:) name:_UIWindowSceneEnhancedWindowingModeChanged object:nil]; 201 201 #endif 202 202 } … … 707 707 [self _cancelAnimatedResize]; 708 708 709 #if HAVE( MAC_CATALYST_LIVE_RESIZE)709 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 710 710 [self _invalidateResizeAssertions]; 711 711 #endif … … 1563 1563 _page->webViewDidMoveToWindow(); 1564 1564 [self _presentCaptivePortalModeAlertIfNeeded]; 1565 #if HAVE( MULTITASKING_MODE)1565 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 1566 1566 if (_page->hasRunningProcess() && self.window) 1567 _page->setIs InMultitaskingMode(self._isInMultitaskingMode);1568 #endif 1569 #if HAVE( MAC_CATALYST_LIVE_RESIZE)1567 _page->setIsWindowResizingEnabled(self._isWindowResizingEnabled); 1568 #endif 1569 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 1570 1570 [self _invalidateResizeAssertions]; 1571 1571 #endif 1572 1572 } 1573 1574 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 1575 1576 - (BOOL)_isWindowResizingEnabled 1577 { 1578 UIWindowScene *scene = self.window.windowScene; 1579 return [scene respondsToSelector:@selector(_enhancedWindowingEnabled)] && scene._enhancedWindowingEnabled; 1580 } 1581 1582 #endif // HAVE(UIKIT_RESIZABLE_WINDOWS) 1573 1583 1574 1584 - (void)_setOpaqueInternal:(BOOL)opaque … … 2006 2016 } 2007 2017 2008 #if HAVE( MAC_CATALYST_LIVE_RESIZE)2018 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 2009 2019 2010 2020 - (void)_acquireResizeAssertionForReason:(NSString *)reason … … 2056 2066 } 2057 2067 2058 #endif // HAVE( MAC_CATALYST_LIVE_RESIZE)2068 #endif // HAVE(UIKIT_RESIZABLE_WINDOWS) 2059 2069 2060 2070 // 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. … … 2760 2770 #endif 2761 2771 2762 #if HAVE( MULTITASKING_MODE)2763 2764 - (void)_ multitaskingModeDidChange:(NSNotification *)notification2772 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 2773 2774 - (void)_enhancedWindowingToggled:(NSNotification *)notification 2765 2775 { 2766 2776 if (dynamic_objc_cast<UIWindowScene>(notification.object) != self.window.windowScene) … … 2770 2780 return; 2771 2781 2772 _page->setIs InMultitaskingMode(self._isInMultitaskingMode);2773 } 2774 2775 #endif // HAVE( MULTITASKING_MODE)2782 _page->setIsWindowResizingEnabled(self._isWindowResizingEnabled); 2783 } 2784 2785 #endif // HAVE(UIKIT_RESIZABLE_WINDOWS) 2776 2786 2777 2787 @end … … 3275 3285 CGFloat oldWebViewWidthInContentViewCoordinates = oldUnobscuredContentRect.width(); 3276 3286 _animatedResizeOriginalContentWidth = [&] { 3277 #if HAVE( MULTITASKING_MODE)3278 if (self._is InMultitaskingMode)3287 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 3288 if (self._isWindowResizingEnabled) 3279 3289 return contentSizeInContentViewCoordinates.width; 3280 3290 #endif -
trunk/Source/WebKit/UIProcess/API/ios/WKWebViewTestingIOS.mm
r294589 r295360 484 484 - (BOOL)_hasResizeAssertion 485 485 { 486 #if HAVE( MAC_CATALYST_LIVE_RESIZE)486 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 487 487 if (!_resizeAssertions.isEmpty()) 488 488 return YES; -
trunk/Source/WebKit/UIProcess/PageClient.h
r295346 r295360 555 555 #endif 556 556 557 virtual bool isInMultitaskingMode() const { return false; }557 virtual bool hasResizableWindows() const { return false; } 558 558 559 559 #if ENABLE(IMAGE_ANALYSIS) -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r295346 r295360 8524 8524 #endif 8525 8525 8526 #if HAVE( MULTITASKING_MODE)8527 parameters. isInMultitaskingMode = pageClient().isInMultitaskingMode();8526 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 8527 parameters.hasResizableWindows = pageClient().hasResizableWindows(); 8528 8528 #endif 8529 8529 … … 11417 11417 #endif 11418 11418 11419 #if HAVE( MULTITASKING_MODE)11420 11421 void WebPageProxy::setIs InMultitaskingMode(bool isInMultitaskingMode)11422 { 11423 send(Messages::WebPage::SetIs InMultitaskingMode(isInMultitaskingMode));11419 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 11420 11421 void WebPageProxy::setIsWindowResizingEnabled(bool hasResizableWindows) 11422 { 11423 send(Messages::WebPage::SetIsWindowResizingEnabled(hasResizableWindows)); 11424 11424 } 11425 11425 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r295346 r295360 2111 2111 #endif 2112 2112 2113 #if HAVE( MULTITASKING_MODE)2114 void setIs InMultitaskingMode(bool);2113 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 2114 void setIsWindowResizingEnabled(bool); 2115 2115 #endif 2116 2116 -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.h
r295346 r295360 311 311 void cancelElementFullscreenVideoExtraction() final; 312 312 313 bool isInMultitaskingMode() const final;313 bool hasResizableWindows() const final; 314 314 315 315 #if ENABLE(VIDEO_PRESENTATION_MODE) -
trunk/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
r295346 r295360 1084 1084 } 1085 1085 1086 bool PageClientImpl:: isInMultitaskingMode() const1087 { 1088 #if HAVE( MULTITASKING_MODE)1089 return [m_webView _is InMultitaskingMode];1086 bool PageClientImpl::hasResizableWindows() const 1087 { 1088 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 1089 return [m_webView _isWindowResizingEnabled]; 1090 1090 #else 1091 1091 return false; -
trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
r295337 r295360 1398 1398 1399 1399 #if !PLATFORM(MACCATALYST) 1400 if (!pageClient(). isInMultitaskingMode() && webViewSizeIsNarrow(viewSize()))1400 if (!pageClient().hasResizableWindows() && webViewSizeIsNarrow(viewSize())) 1401 1401 return false; 1402 1402 #endif -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r295346 r295360 542 542 , m_requiresUserActionForEditingControlsManager(parameters.requiresUserActionForEditingControlsManager) 543 543 #endif 544 #if HAVE( MULTITASKING_MODE)545 , m_is InMultitaskingMode(parameters.isInMultitaskingMode)544 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 545 , m_isWindowResizingEnabled(parameters.hasResizableWindows) 546 546 #endif 547 547 #if ENABLE(META_VIEWPORT) … … 6703 6703 bool viewportChanged = false; 6704 6704 6705 m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths( usesMultitaskingModeViewportBehaviors());6705 m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths(shouldEnableViewportBehaviorsForResizableWindows()); 6706 6706 6707 6707 LOG_WITH_STREAM(VisibleRects, stream << "WebPage " << m_identifier.toUInt64() << " didCommitLoad setting content size to " << coreFrame->view()->contentsSize()); … … 8116 8116 #endif 8117 8117 8118 #if HAVE( MULTITASKING_MODE)8119 8120 void WebPage::setIs InMultitaskingMode(bool value)8121 { 8122 if (m_is InMultitaskingMode== value)8123 return; 8124 8125 m_is InMultitaskingMode= value;8126 m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths( usesMultitaskingModeViewportBehaviors());8127 } 8128 8129 #endif // HAVE( MULTITASKING_MODE)8118 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 8119 8120 void WebPage::setIsWindowResizingEnabled(bool value) 8121 { 8122 if (m_isWindowResizingEnabled == value) 8123 return; 8124 8125 m_isWindowResizingEnabled = value; 8126 m_viewportConfiguration.setPrefersHorizontalScrollingBelowDesktopViewportWidths(shouldEnableViewportBehaviorsForResizableWindows()); 8127 } 8128 8129 #endif // HAVE(UIKIT_RESIZABLE_WINDOWS) 8130 8130 8131 8131 bool WebPage::handlesPageScaleGesture() -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r295346 r295360 1548 1548 #endif 1549 1549 1550 #if HAVE( MULTITASKING_MODE)1551 void setIs InMultitaskingMode(bool);1550 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 1551 void setIsWindowResizingEnabled(bool); 1552 1552 #endif 1553 1553 … … 1802 1802 1803 1803 #if ENABLE(META_VIEWPORT) 1804 bool usesMultitaskingModeViewportBehaviors() const;1804 bool shouldEnableViewportBehaviorsForResizableWindows() const; 1805 1805 #endif 1806 1806 … … 2275 2275 OptionSet<WebCore::ActivityState::Flag> m_lastActivityStateChanges; 2276 2276 2277 #if HAVE( MULTITASKING_MODE)2278 bool m_is InMultitaskingMode{ false };2277 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 2278 bool m_isWindowResizingEnabled { false }; 2279 2279 #endif 2280 2280 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.messages.in
r295346 r295360 688 688 #endif 689 689 690 #if HAVE( MULTITASKING_MODE)691 SetIs InMultitaskingMode(bool isInMultitaskingMode)690 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 691 SetIsWindowResizingEnabled(bool hasResizableWindows) 692 692 #endif 693 693 } -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r295351 r295360 3656 3656 float relativeHorizontalPositionInNodeAtCenter = 0; 3657 3657 float relativeVerticalPositionInNodeAtCenter = 0; 3658 if (! usesMultitaskingModeViewportBehaviors()) {3658 if (!shouldEnableViewportBehaviorsForResizableWindows()) { 3659 3659 visibleHorizontalFraction = frameView.unobscuredContentSize().width() / oldContentSize.width(); 3660 3660 IntPoint unobscuredContentRectCenter = frameView.unobscuredContentRect().center(); … … 3696 3696 IntSize newContentSize = frameView.contentsSize(); 3697 3697 3698 bool scaleToFitContent = (! usesMultitaskingModeViewportBehaviors() || !wasAtInitialScale) && m_userHasChangedPageScaleFactor;3698 bool scaleToFitContent = (!shouldEnableViewportBehaviorsForResizableWindows() || !wasAtInitialScale) && m_userHasChangedPageScaleFactor; 3699 3699 double scale = scaleAfterViewportWidthChange(targetScale, scaleToFitContent, m_viewportConfiguration, targetUnobscuredRectInScrollViewCoordinates.width(), newContentSize, oldContentSize, visibleHorizontalFraction); 3700 3700 FloatRect newUnobscuredContentRect = targetUnobscuredRect; … … 3712 3712 double newUnobscuredRectX; 3713 3713 double newUnobscuredRectY; 3714 if ( usesMultitaskingModeViewportBehaviors()) {3714 if (shouldEnableViewportBehaviorsForResizableWindows()) { 3715 3715 newUnobscuredRectX = oldUnobscuredContentRect.x(); 3716 3716 newUnobscuredRectY = oldUnobscuredContentRect.y(); … … 3993 3993 } 3994 3994 3995 bool WebPage:: usesMultitaskingModeViewportBehaviors() const3996 { 3997 #if HAVE( MULTITASKING_MODE)3998 return shouldIgnoreMetaViewport() && m_is InMultitaskingMode;3995 bool WebPage::shouldEnableViewportBehaviorsForResizableWindows() const 3996 { 3997 #if HAVE(UIKIT_RESIZABLE_WINDOWS) 3998 return shouldIgnoreMetaViewport() && m_isWindowResizingEnabled; 3999 3999 #else 4000 4000 return false;
Note:
See TracChangeset
for help on using the changeset viewer.