Title: [253661] trunk/Source/WebKit
Revision
253661
Author
pvol...@apple.com
Date
2019-12-17 17:32:40 -0800 (Tue, 17 Dec 2019)

Log Message

[iOS] The WebContent process should not use API to get the user interface idiom
https://bugs.webkit.org/show_bug.cgi?id=205236

Reviewed by Brent Fulgham.

This should be done in the UI process, since using the API in the WebContent process will connect to daemons
we intend to block access to. Add a flag to the process creation parameters which indicates whether the user
interface idiom is iPad or not. This flag will be set on the UI process side, and on the WebContent process
side, this flag will be read and cached for later use.

No new tests, covered by existing tests.

* Platform/spi/ios/UIKitSPI.h:
(currentUserInterfaceIdiomIsPad): Deleted.
* Shared/UserInterfaceIdiom.h: Added.
* Shared/UserInterfaceIdiom.mm: Added.
(WebKit::userInterfaceIdiomIsPad):
(WebKit::currentUserInterfaceIdiomIsPad):
(WebKit::setCurrentUserInterfaceIdiomIsPad):
* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* Shared/ios/WebPreferencesDefaultValuesIOS.mm:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* UIProcess/ios/SmartMagnificationController.mm:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
(-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
(-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
(-[WKContentView _zoomToRevealFocusedElement]):
(-[WKContentView requiresAccessoryView]):
(-[WKContentView _updateAccessory]):
(shouldShowKeyboardForElement):
(-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
* UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
* UIProcess/ios/WebPageProxyIOS.mm:
* UIProcess/ios/forms/WKFormColorControl.mm:
(-[WKFormColorControl initWithView:]):
* UIProcess/ios/forms/WKFormColorPicker.mm:
* UIProcess/ios/forms/WKFormInputControl.mm:
* UIProcess/ios/forms/WKFormSelectControl.mm:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (253660 => 253661)


--- trunk/Source/WebKit/ChangeLog	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/ChangeLog	2019-12-18 01:32:40 UTC (rev 253661)
@@ -1,3 +1,52 @@
+2019-12-17  Per Arne Vollan  <pvol...@apple.com>
+
+        [iOS] The WebContent process should not use API to get the user interface idiom
+        https://bugs.webkit.org/show_bug.cgi?id=205236
+
+        Reviewed by Brent Fulgham.
+
+        This should be done in the UI process, since using the API in the WebContent process will connect to daemons
+        we intend to block access to. Add a flag to the process creation parameters which indicates whether the user
+        interface idiom is iPad or not. This flag will be set on the UI process side, and on the WebContent process
+        side, this flag will be read and cached for later use.
+
+        No new tests, covered by existing tests.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        (currentUserInterfaceIdiomIsPad): Deleted.
+        * Shared/UserInterfaceIdiom.h: Added.
+        * Shared/UserInterfaceIdiom.mm: Added.
+        (WebKit::userInterfaceIdiomIsPad):
+        (WebKit::currentUserInterfaceIdiomIsPad):
+        (WebKit::setCurrentUserInterfaceIdiomIsPad):
+        * Shared/WebProcessCreationParameters.cpp:
+        (WebKit::WebProcessCreationParameters::encode const):
+        (WebKit::WebProcessCreationParameters::decode):
+        * Shared/WebProcessCreationParameters.h:
+        * Shared/ios/WebPreferencesDefaultValuesIOS.mm:
+        * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
+        (WebKit::WebProcessPool::platformInitializeWebProcess):
+        * UIProcess/ios/SmartMagnificationController.mm:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
+        (-[WKContentView endEditingAndUpdateFocusAppearanceWithReason:]):
+        (-[WKContentView _shouldShowAutomaticKeyboardUIIgnoringInputMode]):
+        (-[WKContentView _zoomToRevealFocusedElement]):
+        (-[WKContentView requiresAccessoryView]):
+        (-[WKContentView _updateAccessory]):
+        (shouldShowKeyboardForElement):
+        (-[WKContentView _shouldUseLegacySelectPopoverDismissalBehavior]):
+        * UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm:
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        * UIProcess/ios/forms/WKFormColorControl.mm:
+        (-[WKFormColorControl initWithView:]):
+        * UIProcess/ios/forms/WKFormColorPicker.mm:
+        * UIProcess/ios/forms/WKFormInputControl.mm:
+        * UIProcess/ios/forms/WKFormSelectControl.mm:
+        * WebKit.xcodeproj/project.pbxproj:
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::platformInitializeWebProcess):
+
 2019-12-17  Eric Carlson  <eric.carl...@apple.com>
 
         Add remote media player methods for prepareToPlay, preload, private browsing mode, preserves pitch, and failed to load

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


--- trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h	2019-12-18 01:32:40 UTC (rev 253661)
@@ -1255,18 +1255,6 @@
 @property (nonatomic, setter=_setBacklightLevel:) float _backlightLevel;
 @end
 
-static inline bool currentUserInterfaceIdiomIsPad()
-{
-    // This inline function exists to thwart unreachable code
-    // detection on platforms where UICurrentUserInterfaceIdiomIsPad
-    // is defined directly to false.
-#if USE(APPLE_INTERNAL_SDK)
-    return UICurrentUserInterfaceIdiomIsPad();
-#else
-    return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
-#endif
-}
-
 WTF_EXTERN_C_BEGIN
 
 BOOL UIKeyboardEnabledInputModesAllowOneToManyShortcuts(void);

Added: trunk/Source/WebKit/Shared/UserInterfaceIdiom.h (0 => 253661)


--- trunk/Source/WebKit/Shared/UserInterfaceIdiom.h	                        (rev 0)
+++ trunk/Source/WebKit/Shared/UserInterfaceIdiom.h	2019-12-18 01:32:40 UTC (rev 253661)
@@ -0,0 +1,37 @@
+/*
+* Copyright (C) 2019 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#pragma once
+
+#if PLATFORM(IOS_FAMILY)
+
+namespace WebKit {
+
+bool currentUserInterfaceIdiomIsPad();
+void setCurrentUserInterfaceIdiomIsPad(bool);
+
+}
+
+#endif

Added: trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm (0 => 253661)


--- trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm	                        (rev 0)
+++ trunk/Source/WebKit/Shared/UserInterfaceIdiom.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -0,0 +1,76 @@
+/*
+* Copyright (C) 2019 Apple Inc. All rights reserved.
+*
+* Redistribution and use in source and binary forms, with or without
+* modification, are permitted provided that the following conditions
+* are met:
+* 1. Redistributions of source code must retain the above copyright
+*    notice, this list of conditions and the following disclaimer.
+* 2. Redistributions in binary form must reproduce the above copyright
+*    notice, this list of conditions and the following disclaimer in the
+*    documentation and/or other materials provided with the distribution.
+*
+* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+* THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#include "config.h"
+#include "UserInterfaceIdiom.h"
+
+#if PLATFORM(IOS_FAMILY)
+
+#if USE(APPLE_INTERNAL_SDK)
+#import <UIKit/UIDevice_Private.h>
+#else
+#import <UIKit/UIDevice.h>
+#endif
+
+namespace WebKit {
+
+enum class UserInterfaceIdiomState : uint8_t {
+    IsPad,
+    IsNotPad,
+    Unknown,
+};
+
+static UserInterfaceIdiomState userInterfaceIdiomIsPadState = UserInterfaceIdiomState::Unknown;
+
+#if PLATFORM(IOS_FAMILY)
+static inline bool userInterfaceIdiomIsPad()
+{
+    // This inline function exists to thwart unreachable code
+    // detection on platforms where UICurrentUserInterfaceIdiomIsPad
+    // is defined directly to false.
+#if USE(APPLE_INTERNAL_SDK)
+    return UICurrentUserInterfaceIdiomIsPad();
+#else
+    return [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad;
+#endif
+}
+#endif
+
+bool currentUserInterfaceIdiomIsPad()
+{
+    if (userInterfaceIdiomIsPadState == UserInterfaceIdiomState::Unknown)
+        setCurrentUserInterfaceIdiomIsPad(userInterfaceIdiomIsPad());
+
+    return userInterfaceIdiomIsPadState == UserInterfaceIdiomState::IsPad;
+}
+
+void setCurrentUserInterfaceIdiomIsPad(bool isPad)
+{
+    userInterfaceIdiomIsPadState = isPad ? UserInterfaceIdiomState::IsPad : UserInterfaceIdiomState::IsNotPad;
+}
+
+}
+
+#endif

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp (253660 => 253661)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.cpp	2019-12-18 01:32:40 UTC (rev 253661)
@@ -174,6 +174,10 @@
 #if PLATFORM(IOS)
     encoder << cssValueToSystemColorMap;
 #endif
+
+#if PLATFORM(IOS_FAMILY)
+    encoder << currentUserInterfaceIdiomIsPad;
+#endif
 }
 
 bool WebProcessCreationParameters::decode(IPC::Decoder& decoder, WebProcessCreationParameters& parameters)
@@ -448,6 +452,11 @@
     parameters.cssValueToSystemColorMap = WTFMove(*cssValueToSystemColorMap);
 #endif
 
+#if PLATFORM(IOS_FAMILY)
+    if (!decoder.decode(parameters.currentUserInterfaceIdiomIsPad))
+        return false;
+#endif
+
     return true;
 }
 

Modified: trunk/Source/WebKit/Shared/WebProcessCreationParameters.h (253660 => 253661)


--- trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/Shared/WebProcessCreationParameters.h	2019-12-18 01:32:40 UTC (rev 253661)
@@ -216,6 +216,10 @@
 #if PLATFORM(IOS)
     HashMap<WebCore::CSSValueKey, WebCore::Color> cssValueToSystemColorMap;
 #endif
+
+#if PLATFORM(IOS_FAMILY)
+    bool currentUserInterfaceIdiomIsPad { false };
+#endif
 };
 
 } // namespace WebKit

Modified: trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm (253660 => 253661)


--- trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/Shared/ios/WebPreferencesDefaultValuesIOS.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -28,7 +28,7 @@
 
 #if PLATFORM(IOS_FAMILY)
 
-#import "UIKitSPI.h"
+#import "UserInterfaceIdiom.h"
 
 namespace WebKit {
 

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebProcessPoolCocoa.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -35,6 +35,7 @@
 #import "PluginProcessManager.h"
 #import "SandboxUtilities.h"
 #import "TextChecker.h"
+#import "UserInterfaceIdiom.h"
 #import "VersionChecks.h"
 #import "WKBrowsingContextControllerInternal.h"
 #import "WebBackForwardCache.h"
@@ -341,6 +342,10 @@
 #if PLATFORM(IOS)
     parameters.cssValueToSystemColorMap = RenderThemeIOS::getOrCreateCSSValueToSystemColorMap();
 #endif
+    
+#if PLATFORM(IOS_FAMILY)
+    parameters.currentUserInterfaceIdiomIsPad = currentUserInterfaceIdiomIsPad();
+#endif
 }
 
 void WebProcessPool::platformInitializeNetworkProcess(NetworkProcessCreationParameters& parameters)

Modified: trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/SmartMagnificationController.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -29,6 +29,7 @@
 #if PLATFORM(IOS_FAMILY)
 
 #import "SmartMagnificationControllerMessages.h"
+#import "UserInterfaceIdiom.h"
 #import "ViewGestureGeometryCollectorMessages.h"
 #import "WKContentView.h"
 #import "WKScrollView.h"
@@ -37,12 +38,6 @@
 #import "WebPageProxy.h"
 #import "WebProcessProxy.h"
 
-ALLOW_DEPRECATED_DECLARATIONS_BEGIN
-
-#import "UIKitSPI.h"
-
-ALLOW_DEPRECATED_DECLARATIONS_END
-
 static const float smartMagnificationPanScrollThresholdZoomedOut = 60;
 static const float smartMagnificationPanScrollThresholdIPhone = 100;
 static const float smartMagnificationPanScrollThresholdIPad = 150;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -42,7 +42,7 @@
 #import "SmartMagnificationController.h"
 #import "TextChecker.h"
 #import "TextInputSPI.h"
-#import "UIKitSPI.h"
+#import "UserInterfaceIdiom.h"
 #import "VersionChecks.h"
 #import "WKActionSheetAssistant.h"
 #import "WKContextMenuElementInfoInternal.h"
@@ -376,7 +376,7 @@
         [[_contentView formAccessoryView] showAutoFillButtonWithTitle:title];
     else
         [[_contentView formAccessoryView] hideAutoFillButton];
-    if (currentUserInterfaceIdiomIsPad())
+    if (WebKit::currentUserInterfaceIdiomIsPad())
         [_contentView reloadInputViews];
 }
 
@@ -1358,7 +1358,7 @@
     if (!_webView._retainingActiveFocusedState) {
         // We need to complete the editing operation before we blur the element.
         [self _endEditing];
-        if ((reason == EndEditingReasonAccessoryDone && !currentUserInterfaceIdiomIsPad()) || _keyboardDidRequestDismissal || self._shouldUseLegacySelectPopoverDismissalBehavior) {
+        if ((reason == EndEditingReasonAccessoryDone && !WebKit::currentUserInterfaceIdiomIsPad()) || _keyboardDidRequestDismissal || self._shouldUseLegacySelectPopoverDismissalBehavior) {
             _page->blurFocusedElement();
             // Don't wait for WebPageProxy::blurFocusedElement() to round-trip back to us to hide the keyboard
             // because we know that the user explicitly requested us to do so.
@@ -1886,7 +1886,7 @@
     case WebKit::InputType::Month:
     case WebKit::InputType::DateTimeLocal:
     case WebKit::InputType::Time:
-        return !currentUserInterfaceIdiomIsPad();
+        return !WebKit::currentUserInterfaceIdiomIsPad();
     default:
         return !_focusedElementInformation.isReadOnly;
     }
@@ -1930,7 +1930,7 @@
         fontSize:_focusedElementInformation.nodeFontSize
         minimumScale:_focusedElementInformation.minimumScaleFactor
         maximumScale:_focusedElementInformation.maximumScaleFactorIgnoringAlwaysScalable
-        allowScaling:_focusedElementInformation.allowsUserScalingIgnoringAlwaysScalable && !currentUserInterfaceIdiomIsPad()
+        allowScaling:_focusedElementInformation.allowsUserScalingIgnoringAlwaysScalable && !WebKit::currentUserInterfaceIdiomIsPad()
         forceScroll:[self requiresAccessoryView]];
 }
 
@@ -2926,7 +2926,7 @@
 #if ENABLE(INPUT_TYPE_COLOR)
     case WebKit::InputType::Color:
 #endif
-        return !currentUserInterfaceIdiomIsPad();
+        return !WebKit::currentUserInterfaceIdiomIsPad();
     }
 }
 
@@ -4354,7 +4354,7 @@
     [accessoryView setNextEnabled:_focusedElementInformation.hasNextNode];
     [accessoryView setPreviousEnabled:_focusedElementInformation.hasPreviousNode];
 
-    if (currentUserInterfaceIdiomIsPad()) {
+    if (WebKit::currentUserInterfaceIdiomIsPad()) {
         [accessoryView setClearVisible:NO];
         return;
     }
@@ -5504,7 +5504,7 @@
     if (mayContainSelectableText(information.elementType))
         return true;
 
-    return !currentUserInterfaceIdiomIsPad();
+    return !WebKit::currentUserInterfaceIdiomIsPad();
 }
 
 static WebCore::FloatRect rectToRevealWhenZoomingToFocusedElement(const WebKit::FocusedElementInformation& elementInfo, const WebKit::EditorState& editorState)
@@ -6723,7 +6723,7 @@
 
 - (BOOL)_shouldUseLegacySelectPopoverDismissalBehavior
 {
-    if (!currentUserInterfaceIdiomIsPad())
+    if (!WebKit::currentUserInterfaceIdiomIsPad())
         return NO;
 
     if (_focusedElementInformation.elementType != WebKit::InputType::Select)

Modified: trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/WebDataListSuggestionsDropdownIOS.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -28,6 +28,7 @@
 
 #if ENABLE(DATALIST_ELEMENT) && PLATFORM(IOS_FAMILY)
 
+#import "UserInterfaceIdiom.h"
 #import "WKContentView.h"
 #import "WKContentViewInteraction.h"
 #import "WKFormPeripheral.h"

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -48,8 +48,8 @@
 #import "RemoteLayerTreeTransaction.h"
 #import "RemoteScrollingCoordinatorProxy.h"
 #import "ShareableResource.h"
-#import "UIKitSPI.h"
 #import "UserData.h"
+#import "UserInterfaceIdiom.h"
 #import "VersionChecks.h"
 #import "VideoFullscreenManagerProxy.h"
 #import "ViewUpdateDispatcherMessages.h"

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorControl.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorControl.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorControl.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -29,6 +29,7 @@
 #if ENABLE(INPUT_TYPE_COLOR) && PLATFORM(IOS_FAMILY)
 
 #import "UIKitSPI.h"
+#import "UserInterfaceIdiom.h"
 #import "WKContentView.h"
 #import "WKFormColorPicker.h"
 #import "WKFormPopover.h"
@@ -98,7 +99,7 @@
 - (instancetype)initWithView:(WKContentView *)view
 {
     RetainPtr<NSObject <WKFormControl>> control;
-    if (currentUserInterfaceIdiomIsPad())
+    if (WebKit::currentUserInterfaceIdiomIsPad())
         control = adoptNS([[WKColorPopover alloc] initWithView:view]);
     else
         control = adoptNS([[WKColorPicker alloc] initWithView:view]);

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormColorPicker.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -29,7 +29,7 @@
 #if ENABLE(INPUT_TYPE_COLOR) && PLATFORM(IOS_FAMILY)
 
 #import "FocusedElementInformation.h"
-#import "UIKitSPI.h"
+#import "UserInterfaceIdiom.h"
 #import "WKContentViewInteraction.h"
 #import "WKFormPopover.h"
 #import "WebPageProxy.h"

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormInputControl.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -28,7 +28,7 @@
 
 #if PLATFORM(IOS_FAMILY)
 
-#import "UIKitSPI.h"
+#import "UserInterfaceIdiom.h"
 #import "WKContentView.h"
 #import "WKContentViewInteraction.h"
 #import "WKFormPopover.h"

Modified: trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm (253660 => 253661)


--- trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/UIProcess/ios/forms/WKFormSelectControl.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -28,7 +28,7 @@
 
 #if PLATFORM(IOS_FAMILY)
 
-#import "UIKitSPI.h"
+#import "UserInterfaceIdiom.h"
 #import "WKContentView.h"
 #import "WKContentViewInteraction.h"
 #import "WKFormPopover.h"

Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (253660 => 253661)


--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj	2019-12-18 01:32:40 UTC (rev 253661)
@@ -1726,6 +1726,7 @@
 		E3866B092399A2D500F88FE9 /* WebDeviceOrientationUpdateProviderProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3866B042399979C00F88FE9 /* WebDeviceOrientationUpdateProviderProxyMessageReceiver.cpp */; };
 		E3866B0A2399A2D900F88FE9 /* WebDeviceOrientationUpdateProviderMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = E3866B072399979D00F88FE9 /* WebDeviceOrientationUpdateProviderMessages.h */; };
 		E3866B0B2399A2DD00F88FE9 /* WebDeviceOrientationUpdateProviderMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E3866B062399979C00F88FE9 /* WebDeviceOrientationUpdateProviderMessageReceiver.cpp */; };
+		E38A1FC023A551BF00D2374F /* UserInterfaceIdiom.mm in Sources */ = {isa = PBXBuildFile; fileRef = E38A1FBF23A551BF00D2374F /* UserInterfaceIdiom.mm */; };
 		E39628DD23960CC600658ECD /* WebDeviceOrientationUpdateProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = E39628DB23960CC500658ECD /* WebDeviceOrientationUpdateProvider.h */; };
 		E39628DE23960CC600658ECD /* WebDeviceOrientationUpdateProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E39628DC23960CC600658ECD /* WebDeviceOrientationUpdateProvider.cpp */; };
 		E413F59D1AC1ADC400345360 /* NetworkCacheEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = E413F59B1AC1ADB600345360 /* NetworkCacheEntry.h */; };
@@ -4897,6 +4898,8 @@
 		E3866B052399979C00F88FE9 /* WebDeviceOrientationUpdateProviderProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebDeviceOrientationUpdateProviderProxyMessages.h; path = DerivedSources/WebKit2/WebDeviceOrientationUpdateProviderProxyMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
 		E3866B062399979C00F88FE9 /* WebDeviceOrientationUpdateProviderMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebDeviceOrientationUpdateProviderMessageReceiver.cpp; path = DerivedSources/WebKit2/WebDeviceOrientationUpdateProviderMessageReceiver.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
 		E3866B072399979D00F88FE9 /* WebDeviceOrientationUpdateProviderMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebDeviceOrientationUpdateProviderMessages.h; path = DerivedSources/WebKit2/WebDeviceOrientationUpdateProviderMessages.h; sourceTree = BUILT_PRODUCTS_DIR; };
+		E38A1FBE23A5511400D2374F /* UserInterfaceIdiom.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserInterfaceIdiom.h; sourceTree = "<group>"; };
+		E38A1FBF23A551BF00D2374F /* UserInterfaceIdiom.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = UserInterfaceIdiom.mm; sourceTree = "<group>"; };
 		E39628DB23960CC500658ECD /* WebDeviceOrientationUpdateProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebDeviceOrientationUpdateProvider.h; sourceTree = "<group>"; };
 		E39628DC23960CC600658ECD /* WebDeviceOrientationUpdateProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebDeviceOrientationUpdateProvider.cpp; sourceTree = "<group>"; };
 		E39628E423971F3400658ECD /* WebDeviceOrientationUpdateProvider.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebDeviceOrientationUpdateProvider.messages.in; sourceTree = "<group>"; };
@@ -6397,6 +6400,8 @@
 				1C9EBA5B2087E74E00054429 /* NativeWebMouseEventIOS.mm */,
 				2DA944981884E4F000ED86DB /* NativeWebTouchEventIOS.mm */,
 				4459984122833E6000E61373 /* SyntheticEditingCommandType.h */,
+				E38A1FBE23A5511400D2374F /* UserInterfaceIdiom.h */,
+				E38A1FBF23A551BF00D2374F /* UserInterfaceIdiom.mm */,
 				F40D1B68220BDC0F00B49A01 /* WebAutocorrectionContext.h */,
 				F42D633F22A0EFD300D2FB3A /* WebAutocorrectionData.h */,
 				F42D634022A0EFD300D2FB3A /* WebAutocorrectionData.mm */,
@@ -12005,6 +12010,7 @@
 				2D8508D8212E33ED000EF46C /* UnifiedSource98.cpp in Sources */,
 				2D8508C5212E33ED000EF46C /* UnifiedSource99.cpp in Sources */,
 				2D8508D2212E33ED000EF46C /* UnifiedSource100.cpp in Sources */,
+				E38A1FC023A551BF00D2374F /* UserInterfaceIdiom.mm in Sources */,
 				CD491B0D1E732E4D00009066 /* UserMediaCaptureManagerMessageReceiver.cpp in Sources */,
 				CD491B171E73525500009066 /* UserMediaCaptureManagerProxyMessageReceiver.cpp in Sources */,
 				3F418EF91887BD97002795FD /* VideoFullscreenManagerMessageReceiver.cpp in Sources */,

Modified: trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm (253660 => 253661)


--- trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2019-12-18 00:47:20 UTC (rev 253660)
+++ trunk/Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm	2019-12-18 01:32:40 UTC (rev 253661)
@@ -91,6 +91,7 @@
 #if PLATFORM(IOS_FAMILY)
 #import "AccessibilitySupportSPI.h"
 #import "AssertionServicesSPI.h"
+#import "UserInterfaceIdiom.h"
 #import "WKAccessibilityWebPageObjectIOS.h"
 #import <UIKit/UIAccessibility.h>
 #import <pal/spi/ios/GraphicsServicesSPI.h>
@@ -187,6 +188,10 @@
 
     setEnhancedAccessibility(parameters.accessibilityEnhancedUserInterfaceEnabled);
 
+#if PLATFORM(IOS_FAMILY)
+    setCurrentUserInterfaceIdiomIsPad(parameters.currentUserInterfaceIdiomIsPad);
+#endif
+
 #if USE(APPKIT)
     [[NSUserDefaults standardUserDefaults] registerDefaults:@{ @"NSApplicationCrashOnExceptions" : @YES }];
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to