Diff
Modified: trunk/Source/WebKit/ChangeLog (279862 => 279863)
--- trunk/Source/WebKit/ChangeLog 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/ChangeLog 2021-07-13 02:05:38 UTC (rev 279863)
@@ -1,3 +1,68 @@
+2021-07-12 Tim Horton <timothy_hor...@apple.com>
+
+ Make WebKit's UserInterfaceIdiom operate in terms of the exceptions, not the rule
+ https://bugs.webkit.org/show_bug.cgi?id=227885
+ <rdar://problem/79987158>
+
+ Reviewed by Wenson Hsieh.
+
+ No new tests, no change in behavior.
+
+ In general, we consider the macOS/iPad behavior the "normal" WebKit behavior,
+ and exceptions to that for iPhone or Watch are just that: exceptions.
+
+ To bring the code in line with this understanding, make places that
+ we make decisions based on UIUserInterfaceIdiom take macOS/iPad behavior
+ as the default, and make iPhone/Watch the special cases.
+
+ * Shared/UserInterfaceIdiom.h:
+ * Shared/UserInterfaceIdiom.mm:
+ (WebKit::currentUserInterfaceIdiomIsPhoneOrWatch):
+ (WebKit::setCurrentUserInterfaceIdiomIsPhoneOrWatch):
+ Also, lump iPod Touch in with iPhone when checking based on device class.
+
+ (WebKit::updateCurrentUserInterfaceIdiom):
+ (WebKit::currentUserInterfaceIdiomIsPadOrMac): Deleted.
+ (WebKit::setCurrentUserInterfaceIdiomIsPadOrMac): Deleted.
+ * Shared/WebProcessCreationParameters.cpp:
+ (WebKit::WebProcessCreationParameters::encode const):
+ (WebKit::WebProcessCreationParameters::decode):
+ * Shared/WebProcessCreationParameters.h:
+ * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
+ (WebKit::defaultTextAutosizingUsesIdempotentMode):
+ * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+ (-[WKWebViewConfiguration init]):
+ * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+ (WebKit::WebProcessPool::platformInitializeWebProcess):
+ (WebKit::WebProcessPool::registerNotificationObservers):
+ * UIProcess/ios/SmartMagnificationController.mm:
+ (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
+ (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
+ (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
+ (-[WKContentView _zoomToRevealFocusedElement]):
+ (-[WKContentView _elementTypeRequiresAccessoryView:]):
+ (-[WKContentView _updateAccessory]):
+ (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
+ * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
+ (WebKit::WebDataListSuggestionsDropdownIOS::show):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::desktopClassBrowsingSupported):
+ * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
+ (-[WKAirPlayRoutePicker show:fromRect:]):
+ * UIProcess/ios/forms/WKFileUploadPanel.mm:
+ (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
+ (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
+ * UIProcess/ios/forms/WKFormSelectControl.mm:
+ (-[WKFormSelectControl initWithView:]):
+ * UIProcess/ios/forms/WKFormSelectPicker.mm:
+ (-[WKSelectMultiplePicker configurePresentation]):
+ * WebProcess/WebProcess.messages.in:
+ * WebProcess/cocoa/WebProcessCocoa.mm:
+ (WebKit::WebProcess::platformInitializeWebProcess):
+ (WebKit::WebProcess::userInterfaceIdiomDidChange):
+
2021-07-12 Wenson Hsieh <wenson_hs...@apple.com>
[Cocoa] Turn on `USE(OS_STATE)` when building with a non-Apple-internal SDK
Modified: trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h (279862 => 279863)
--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h 2021-07-13 02:05:38 UTC (rev 279863)
@@ -227,6 +227,8 @@
@property (nonatomic, readonly, retain) NSString *buildVersion;
@end
+static const UIUserInterfaceIdiom UIUserInterfaceIdiomWatch = (UIUserInterfaceIdiom)4;
+
typedef enum {
kUIKeyboardInputRepeat = 1 << 0,
kUIKeyboardInputPopupVariant = 1 << 1,
Modified: trunk/Source/WebKit/Shared/UserInterfaceIdiom.h (279862 => 279863)
--- trunk/Source/WebKit/Shared/UserInterfaceIdiom.h 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/Shared/UserInterfaceIdiom.h 2021-07-13 02:05:38 UTC (rev 279863)
@@ -29,8 +29,8 @@
namespace WebKit {
-bool currentUserInterfaceIdiomIsPadOrMac();
-void setCurrentUserInterfaceIdiomIsPadOrMac(bool);
+bool currentUserInterfaceIdiomIsPhoneOrWatch();
+void setCurrentUserInterfaceIdiomIsPhoneOrWatch(bool);
bool updateCurrentUserInterfaceIdiom();
}
Modified: trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm (279862 => 279863)
--- trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -34,32 +34,32 @@
namespace WebKit {
enum class UserInterfaceIdiomState : uint8_t {
- IsPadOrMac,
- IsNotPadOrMac,
+ IsPhoneOrWatch,
+ IsNotPhoneOrWatch,
Unknown,
};
-static UserInterfaceIdiomState userInterfaceIdiomIsPadState = UserInterfaceIdiomState::Unknown;
+static UserInterfaceIdiomState userInterfaceIdiomState = UserInterfaceIdiomState::Unknown;
-bool currentUserInterfaceIdiomIsPadOrMac()
+bool currentUserInterfaceIdiomIsPhoneOrWatch()
{
// FIXME: We should get rid of this function and have callers make explicit decisions for all of iPhone/iPad/macOS.
- if (userInterfaceIdiomIsPadState == UserInterfaceIdiomState::Unknown)
+ if (userInterfaceIdiomState == UserInterfaceIdiomState::Unknown)
updateCurrentUserInterfaceIdiom();
- return userInterfaceIdiomIsPadState == UserInterfaceIdiomState::IsPadOrMac;
+ return userInterfaceIdiomState == UserInterfaceIdiomState::IsPhoneOrWatch;
}
-void setCurrentUserInterfaceIdiomIsPadOrMac(bool isPadOrMac)
+void setCurrentUserInterfaceIdiomIsPhoneOrWatch(bool isPhoneOrWatch)
{
- userInterfaceIdiomIsPadState = isPadOrMac ? UserInterfaceIdiomState::IsPadOrMac : UserInterfaceIdiomState::IsNotPadOrMac;
+ userInterfaceIdiomState = isPhoneOrWatch ? UserInterfaceIdiomState::IsPhoneOrWatch : UserInterfaceIdiomState::IsNotPhoneOrWatch;
}
bool updateCurrentUserInterfaceIdiom()
{
- bool wasPadOrMac = userInterfaceIdiomIsPadState == UserInterfaceIdiomState::IsPadOrMac;
- bool isPadOrMac = false;
+ bool wasPhoneOrWatch = userInterfaceIdiomState == UserInterfaceIdiomState::IsPhoneOrWatch;
+ bool isPhoneOrWatch = false;
// If we are in a daemon, we cannot use UIDevice. Fall back to checking the hardware itself.
// Since daemons don't ever run in an iPhone-app-on-iPad jail, this will be accurate in the daemon case,
@@ -66,16 +66,16 @@
// but is not sufficient in the application case.
if (![UIApplication sharedApplication]) {
auto deviceClass = WebCore::deviceClass();
- isPadOrMac = deviceClass == MGDeviceClassiPad || deviceClass == MGDeviceClassMac;
+ isPhoneOrWatch = deviceClass == MGDeviceClassiPhone || deviceClass == MGDeviceClassiPod || deviceClass == MGDeviceClassWatch;
} else {
auto idiom = [[UIDevice currentDevice] userInterfaceIdiom];
- isPadOrMac = idiom == UIUserInterfaceIdiomPad || idiom == UIUserInterfaceIdiomMac;
+ isPhoneOrWatch = idiom == UIUserInterfaceIdiomPhone || idiom == UIUserInterfaceIdiomWatch;
}
- if (wasPadOrMac == isPadOrMac)
+ if (wasPhoneOrWatch == isPhoneOrWatch)
return false;
- setCurrentUserInterfaceIdiomIsPadOrMac(isPadOrMac);
+ setCurrentUserInterfaceIdiomIsPhoneOrWatch(isPhoneOrWatch);
return true;
}
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (279862 => 279863)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp 2021-07-13 02:05:38 UTC (rev 279863)
@@ -181,7 +181,7 @@
#endif
#if PLATFORM(IOS_FAMILY)
- encoder << currentUserInterfaceIdiomIsPad;
+ encoder << currentUserInterfaceIdiomIsPhoneOrWatch;
encoder << supportsPictureInPicture;
encoder << cssValueToSystemColorMap;
encoder << focusRingColor;
@@ -507,7 +507,7 @@
#endif
#if PLATFORM(IOS_FAMILY)
- if (!decoder.decode(parameters.currentUserInterfaceIdiomIsPad))
+ if (!decoder.decode(parameters.currentUserInterfaceIdiomIsPhoneOrWatch))
return false;
if (!decoder.decode(parameters.supportsPictureInPicture))
Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (279862 => 279863)
--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h 2021-07-13 02:05:38 UTC (rev 279863)
@@ -222,7 +222,7 @@
#endif
#if PLATFORM(IOS_FAMILY)
- bool currentUserInterfaceIdiomIsPad { false };
+ bool currentUserInterfaceIdiomIsPhoneOrWatch { false };
bool supportsPictureInPicture { false };
WebCore::RenderThemeIOS::CSSValueToSystemColorMap cssValueToSystemColorMap;
WebCore::Color focusRingColor;
Modified: trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm (279862 => 279863)
--- trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -38,7 +38,7 @@
bool defaultTextAutosizingUsesIdempotentMode()
{
- return currentUserInterfaceIdiomIsPadOrMac();
+ return !currentUserInterfaceIdiomIsPhoneOrWatch();
}
#endif
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKWebViewConfiguration.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -198,7 +198,7 @@
_allowsPictureInPictureMediaPlayback = YES;
#endif
- _allowsInlineMediaPlayback = WebKit::currentUserInterfaceIdiomIsPadOrMac();
+ _allowsInlineMediaPlayback = !WebKit::currentUserInterfaceIdiomIsPhoneOrWatch();
_inlineMediaPlaybackRequiresPlaysInlineAttribute = !_allowsInlineMediaPlayback;
_allowsInlineMediaPlaybackAfterFullscreen = !_allowsInlineMediaPlayback;
_mediaDataLoadsAutomatically = _allowsInlineMediaPlayback;
Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -437,7 +437,7 @@
}
#if PLATFORM(IOS_FAMILY)
- parameters.currentUserInterfaceIdiomIsPad = currentUserInterfaceIdiomIsPadOrMac();
+ parameters.currentUserInterfaceIdiomIsPhoneOrWatch = currentUserInterfaceIdiomIsPhoneOrWatch();
parameters.supportsPictureInPicture = supportsPictureInPicture();
parameters.cssValueToSystemColorMap = RenderThemeIOS::cssValueToSystemColorMap();
parameters.focusRingColor = RenderThemeIOS::systemFocusRingColor();
@@ -736,8 +736,8 @@
if (![UIApplication sharedApplication]) {
m_applicationLaunchObserver = [[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:[NSOperationQueue currentQueue] usingBlock:^(NSNotification *notification) {
if (WebKit::updateCurrentUserInterfaceIdiom()) {
- auto isPadOrMac = WebKit::currentUserInterfaceIdiomIsPadOrMac();
- sendToAllProcesses(Messages::WebProcess::UserInterfaceIdiomDidChange(isPadOrMac));
+ auto isPhoneOrWatch = WebKit::currentUserInterfaceIdiomIsPhoneOrWatch();
+ sendToAllProcesses(Messages::WebProcess::UserInterfaceIdiomDidChange(isPhoneOrWatch));
}
}];
}
Modified: trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -119,10 +119,10 @@
float minimumScrollDistance;
if ([m_contentView bounds].size.width <= m_webPageProxy.unobscuredContentRect().width())
minimumScrollDistance = smartMagnificationPanScrollThresholdZoomedOut;
- else if (currentUserInterfaceIdiomIsPadOrMac())
+ else if (currentUserInterfaceIdiomIsPhoneOrWatch())
+ minimumScrollDistance = smartMagnificationPanScrollThresholdIPhone;
+ else
minimumScrollDistance = smartMagnificationPanScrollThresholdIPad;
- else
- minimumScrollDistance = smartMagnificationPanScrollThresholdIPhone;
// For replaced elements like images, we want to fit the whole element
// in the view, so scale it down enough to make both dimensions fit if possible.
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -475,7 +475,7 @@
[[_contentView formAccessoryView] showAutoFillButtonWithTitle:title];
else
[[_contentView formAccessoryView] hideAutoFillButton];
- if (WebKit::currentUserInterfaceIdiomIsPadOrMac())
+ if (!WebKit::currentUserInterfaceIdiomIsPhoneOrWatch())
[_contentView reloadInputViews];
}
@@ -1550,7 +1550,7 @@
if (_focusRequiresStrongPasswordAssistance)
return true;
- if (!WebKit::currentUserInterfaceIdiomIsPadOrMac())
+ if (WebKit::currentUserInterfaceIdiomIsPhoneOrWatch())
return true;
}
@@ -2241,7 +2241,7 @@
if (self._shouldUseContextMenusForFormControls)
return NO;
#endif
- return !WebKit::currentUserInterfaceIdiomIsPadOrMac();
+ return WebKit::currentUserInterfaceIdiomIsPhoneOrWatch();
}
default:
return YES;
@@ -2302,7 +2302,7 @@
fontSize:_focusedElementInformation.nodeFontSize
minimumScale:_focusedElementInformation.minimumScaleFactor
maximumScale:_focusedElementInformation.maximumScaleFactorIgnoringAlwaysScalable
- allowScaling:_focusedElementInformation.allowsUserScalingIgnoringAlwaysScalable && !WebKit::currentUserInterfaceIdiomIsPadOrMac()
+ allowScaling:_focusedElementInformation.allowsUserScalingIgnoringAlwaysScalable && WebKit::currentUserInterfaceIdiomIsPhoneOrWatch()
forceScroll:[self requiresAccessoryView]];
}
@@ -3319,7 +3319,7 @@
if (self._shouldUseContextMenusForFormControls)
return NO;
#endif
- return !WebKit::currentUserInterfaceIdiomIsPadOrMac();
+ return WebKit::currentUserInterfaceIdiomIsPhoneOrWatch();
}
case WebKit::InputType::Text:
case WebKit::InputType::Password:
@@ -3332,7 +3332,7 @@
case WebKit::InputType::ContentEditable:
case WebKit::InputType::TextArea:
case WebKit::InputType::Week:
- return !WebKit::currentUserInterfaceIdiomIsPadOrMac();
+ return WebKit::currentUserInterfaceIdiomIsPhoneOrWatch();
}
}
@@ -4910,7 +4910,7 @@
[accessoryView setNextEnabled:_focusedElementInformation.hasNextNode];
[accessoryView setPreviousEnabled:_focusedElementInformation.hasPreviousNode];
- if (WebKit::currentUserInterfaceIdiomIsPadOrMac()) {
+ if (!WebKit::currentUserInterfaceIdiomIsPhoneOrWatch()) {
[accessoryView setClearVisible:NO];
return;
}
@@ -7778,7 +7778,7 @@
- (BOOL)_shouldUseLegacySelectPopoverDismissalBehavior
{
- if (!WebKit::currentUserInterfaceIdiomIsPadOrMac())
+ if (WebKit::currentUserInterfaceIdiomIsPhoneOrWatch())
return NO;
if (_focusedElementInformation.elementType != WebKit::InputType::Select)
Modified: trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -116,10 +116,10 @@
}
#endif
- if (currentUserInterfaceIdiomIsPadOrMac())
+ if (currentUserInterfaceIdiomIsPhoneOrWatch())
+ m_suggestionsControl = adoptNS([[WKDataListSuggestionsPicker alloc] initWithInformation:WTFMove(information) inView:m_contentView]);
+ else
m_suggestionsControl = adoptNS([[WKDataListSuggestionsPopover alloc] initWithInformation:WTFMove(information) inView:m_contentView]);
- else
- m_suggestionsControl = adoptNS([[WKDataListSuggestionsPicker alloc] initWithInformation:WTFMove(information) inView:m_contentView]);
[m_suggestionsControl showSuggestionsDropdown:*this activationType:type];
}
Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -1267,7 +1267,7 @@
static bool supportsDesktopClassBrowsing = false;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
- supportsDesktopClassBrowsing = currentUserInterfaceIdiomIsPadOrMac();
+ supportsDesktopClassBrowsing = !currentUserInterfaceIdiomIsPhoneOrWatch();
});
return supportsDesktopClassBrowsing;
}
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKAirPlayRoutePicker.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -152,10 +152,10 @@
[_routingController setDiscoveryMode:MPRouteDiscoveryModeDetailed];
MPAVItemType itemType = hasVideo ? MPAVItemTypeVideo : MPAVItemTypeAudio;
- if (WebKit::currentUserInterfaceIdiomIsPadOrMac())
+ if (WebKit::currentUserInterfaceIdiomIsPhoneOrWatch())
+ [self showAirPlayPickerIPhone:itemType];
+ else
[self showAirPlayPickerIPad:itemType fromRect:elementRect];
- else
- [self showAirPlayPickerIPhone:itemType];
}
@end
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFileUploadPanel.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -584,7 +584,7 @@
// Use a popover on the iPad if the source type is not the camera.
// The camera will use a fullscreen, modal view controller.
- BOOL usePopover = currentUserInterfaceIdiomIsPadOrMac() && sourceType != UIImagePickerControllerSourceTypeCamera;
+ BOOL usePopover = !currentUserInterfaceIdiomIsPhoneOrWatch() && sourceType != UIImagePickerControllerSourceTypeCamera;
if (usePopover)
[self _presentPopoverWithContentViewController:_imagePicker.get() animated:YES];
else
@@ -595,10 +595,10 @@
- (void)_presentMenuOptionForCurrentInterfaceIdiom:(UIViewController *)viewController
{
- if (currentUserInterfaceIdiomIsPadOrMac())
+ if (currentUserInterfaceIdiomIsPhoneOrWatch())
+ [self _presentFullscreenViewController:viewController animated:YES];
+ else
[self _presentPopoverWithContentViewController:viewController animated:YES];
- else
- [self _presentFullscreenViewController:viewController animated:YES];
}
- (void)_presentPopoverWithContentViewController:(UIViewController *)contentViewController animated:(BOOL)animated
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -85,7 +85,7 @@
}
#endif
- if (currentUserInterfaceIdiomIsPadOrMac())
+ if (!currentUserInterfaceIdiomIsPhoneOrWatch())
control = adoptNS([[WKSelectPopover alloc] initWithView:view hasGroups:hasGroups]);
else if (view.focusedElementInformation.isMultiSelect || hasGroups)
control = adoptNS([[WKMultipleSelectPicker alloc] initWithView:view]);
Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm (279862 => 279863)
--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectPicker.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -1176,16 +1176,7 @@
- (void)configurePresentation
{
- if (WebKit::currentUserInterfaceIdiomIsPadOrMac()) {
- [_navigationController setModalPresentationStyle:UIModalPresentationPopover];
- [_navigationController setNavigationBarHidden:YES];
- [_tableViewController setPreferredContentSize:CGSizeMake(selectPopoverLength, selectPopoverLength)];
-
- UIPopoverPresentationController *presentationController = [_navigationController popoverPresentationController];
- presentationController.delegate = self;
- presentationController.sourceView = _view;
- presentationController.sourceRect = CGRectIntegral(_view.focusedElementInformation.interactionRect);
- } else {
+ if (WebKit::currentUserInterfaceIdiomIsPhoneOrWatch()) {
[[_navigationController navigationBar] setBarTintColor:UIColor.systemGroupedBackgroundColor];
UIPresentationController *presentationController = [_navigationController presentationController];
@@ -1198,6 +1189,15 @@
sheetPresentationController._widthFollowsPreferredContentSizeWhenBottomAttached = YES;
sheetPresentationController._wantsBottomAttachedInCompactHeight = YES;
}
+ } else {
+ [_navigationController setModalPresentationStyle:UIModalPresentationPopover];
+ [_navigationController setNavigationBarHidden:YES];
+ [_tableViewController setPreferredContentSize:CGSizeMake(selectPopoverLength, selectPopoverLength)];
+
+ UIPopoverPresentationController *presentationController = [_navigationController popoverPresentationController];
+ presentationController.delegate = self;
+ presentationController.sourceView = _view;
+ presentationController.sourceRect = CGRectIntegral(_view.focusedElementInformation.interactionRect);
}
}
Modified: trunk/Source/WebKit/WebProcess/WebProcess.messages.in (279862 => 279863)
--- trunk/Source/WebKit/WebProcess/WebProcess.messages.in 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/WebProcess/WebProcess.messages.in 2021-07-13 02:05:38 UTC (rev 279863)
@@ -118,7 +118,7 @@
#endif
#if PLATFORM(IOS_FAMILY)
- UserInterfaceIdiomDidChange(bool isPadOrMac)
+ UserInterfaceIdiomDidChange(bool isPhoneOrWatch)
#endif
#if PLATFORM(IOS_FAMILY) && !PLATFORM(MACCATALYST)
Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (279862 => 279863)
--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-07-13 01:57:24 UTC (rev 279862)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm 2021-07-13 02:05:38 UTC (rev 279863)
@@ -312,7 +312,7 @@
setEnhancedAccessibility(parameters.accessibilityEnhancedUserInterfaceEnabled);
#if PLATFORM(IOS_FAMILY)
- setCurrentUserInterfaceIdiomIsPadOrMac(parameters.currentUserInterfaceIdiomIsPad);
+ setCurrentUserInterfaceIdiomIsPhoneOrWatch(parameters.currentUserInterfaceIdiomIsPhoneOrWatch);
setLocalizedDeviceModel(parameters.localizedDeviceModel);
RenderThemeIOS::setContentSizeCategory(parameters.contentSizeCategory);
#if ENABLE(VIDEO_PRESENTATION_MODE)
@@ -1015,9 +1015,9 @@
UIAccessibilityPostNotification(kAXPidStatusChangedNotification, @{ @"pid" : @(getpid()), @"suspended" : @(suspended) });
}
-void WebProcess::userInterfaceIdiomDidChange(bool isPadOrMac)
+void WebProcess::userInterfaceIdiomDidChange(bool isPhoneOrWatch)
{
- WebKit::setCurrentUserInterfaceIdiomIsPadOrMac(isPadOrMac);
+ WebKit::setCurrentUserInterfaceIdiomIsPhoneOrWatch(isPhoneOrWatch);
}
bool WebProcess::shouldFreezeOnSuspension() const