Replace iOS-only WebKitSystemInterface calls with SPI
https://bugs.webkit.org/show_bug.cgi?id=150763

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.xcodeproj/project.pbxproj:
* config.h: Removed WEBCORE_NAVIGATOR_PLATFORM and WEBCORE_NAVIGATOR_VENDOR.
* css/MediaQueryEvaluator.cpp:
(WebCore::isRunningOnIPhoneOrIPod): Used deviceClass() instead of iosDeviceClass().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Used supportsPictureInPicture() instead of wkIsOptimizedFullscreenSupported().
* html/HTMLObjectElement.cpp:
(WebCore::shouldNotPerformURLAdjustment): Used dyld_get_program_sdk_version() instead of iosExecutableWasLinkedOnOrAfterVersion().
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::webkitSupportsPresentationMode): Used supportsPictureInPicture() instead of wkIsOptimizedFullscreenSupported().
* page/NavigatorBase.cpp:
* page/Settings.h:
* page/ViewportConfiguration.cpp:
(WebCore::ViewportConfiguration::textDocumentParameters): Used screenSize() instead of wkGetScreenSize().
* page/ios/UserAgentIOS.mm:
(WebCore::isClassic): Added to return -[UIApplication _isClassic].
(WebCore::osNameForUserAgent): Upstreamed the implementation of WKGetOSNameForUserAgent() from WebKitSystemInterface.
(WebCore::deviceName): Ditto for wkGetDeviceName().
(WebCore::standardUserAgentWithApplicationName): Called deviceName() and osNameForUserAgent().
* page/mac/SettingsCocoa.mm: Renamed from Source/WebCore/page/mac/SettingsMac.mm.
(WebCore::Settings::defaultMinimumZoomFontSize): Upstreamed the implementation of WKGetMinimumZoomFontSize() from WebKitSystemInterface.
* platform/PlatformScreen.h:
* platform/ios/Device.cpp: Added functions that answer queries about the iOS device from MobileGestalt.
(WebCore::deviceClass):
(WebCore::deviceName):
(WebCore::deviceHasIPadCapability):
* platform/ios/Device.h:
* platform/ios/PlatformScreenIOS.mm:
(WebCore::screenPPIFactor): Used MGGetSInt32Answer() and MGGetFloat32Answer() instead of mobileGestaltFloatValue().
(WebCore::screenSize): Upstreamed the implementation of WKGetScreenSize() from WebKitSystemInterface.
(WebCore::availableScreenSize): Ditto for WKGetAvailableScreenSize().
(WebCore::screenScaleFactor): Ditto for WKGetScreenScaleFactor() and WKGetScaleFactorForScreen().
(WebCore::mobileGestaltFloatValue): Deleted.
* platform/ios/WebCoreSystemInterfaceIOS.h: Removed.
(iosExecutableWasLinkedOnOrAfterVersion): Deleted.
(iosDeviceClass): Deleted.
* platform/ios/WebCoreSystemInterfaceIOS.mm:
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture): Used supportsPictureInPicture() instead of wkIsOptimizedFullscreenSupported().
(WebCore::supportsPictureInPicture): Upstreamed the implementation of WKIsOptimizedFullscreenSupported() from WebKitSystemInterface.
* platform/ios/wak/WAKWindow.mm:
(-[WAKWindow initWithLayer:]): Used screenScaleFactor() instead of WKGetScreenScaleFactor().
(-[WAKWindow initWithFrame:]): Ditto.
* platform/ios/wak/WKGraphics.mm:
(WKGraphicsCreateImageFromBundleWithName): Ditto.
(WKDrawPatternBitmap): Ditto.
* platform/mac/WebCoreSystemInterface.h:
* platform/spi/cocoa/DynamicLinkerSPI.h: Defined additional DYLD_IOS_VERSION macros.
* platform/spi/ios/MobileGestaltSPI.h: Defined additional MobileGestalt queries, enum MGDeviceClass, MGGetSInt32Answer, and MGGetFloat32Answer.
* platform/spi/ios/UIKitSPI.h: Copied from Source/WebCore/platform/spi/ios/UIColorSPI.h, and added SPI declarations for UIApplication and UIScreen.
* rendering/RenderThemeIOS.mm: Included UIKitSPI.h instead of UIColorSPI.h, and removed unnecessary forward declarations for the iOS public SDK build.

Source/WebKit/ios:

* Misc/WebUIKitSupport.mm:
(linkedOnOrAfterIOS5): Used dyld_get_program_sdk_version() instead of iosExecutableWasLinkedOnOrAfterVersion().
(WebKitGetMinimumZoomFontSize): Used Settings::defaultMinimumZoomFontSize() instead of WKGetMinimumZoomFontSize().
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::screenSize): Used screenSize() instead of WKGetScreenSize().

Source/WebKit/mac:

* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Used deviceClass() and Settings::defaultMinimumZoomFontSize() instead of WKGetDeviceClass() and WKGetMinimumZoomFontSize().
* WebView/WebView.mm:
(shouldAllowPictureInPictureMediaPlayback): Used dyld_get_program_sdk_version() instead of iosExecutableWasLinkedOnOrAfterVersion().
(-[WebView _updateScreenScaleFromWindow]): Used screenScaleFactor() instead of WKGetScreenScaleFactor().

Source/WebKit2:

* Platform/ios/AccessibilityIOS.h: Added.
* Platform/ios/AccessibilityIOS.mm: Added.
(WebKit::newAccessibilityRemoteToken): Upstreamed the implementation of WKAXRemoteToken() from WebKitSystemInterface.
* Shared/WebPreferencesDefinitions.h: Used Settings::defaultMinimumZoomFontSize() instead of WKGetMinimumZoomFontSize().
* Shared/WebPreferencesStore.cpp:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowPictureInPictureMediaPlayback): Used dyld_get_program_sdk_version() instead of iosExecutableWasLinkedOnOrAfterVersion().
(-[WKWebView _takeViewSnapshot]): Used screenScaleFactor() instead of WKGetScreenScaleFactor().
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]): Used deviceClass() instead of WKGetDeviceClass().
* UIProcess/ios/WKContentView.mm:
(-[WKContentView _commonInitializationWithProcessPool:configuration:]): Used screenScaleFactor() instead of WKGetScaleFactorForScreen().
(-[WKContentView _updateForScreen:]): Ditto.
(storeAccessibilityRemoteConnectionInformation): Upstreamed the implementation of WKAXStoreRemoteConnectionInformation() from WebKitSystemInterface.
(-[WKContentView _accessibilityRegisterUIProcessTokens]): Used newAccessibilityRemoteToken() and storeAccessibilityRemoteConnectionInformation() instead of WKAXRemoteToken() and WKAXStoreRemoteConnectionInformation().
* UIProcess/ios/WKContentViewInteraction.mm:
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::screenSize): Used screenSize() instead of WKGetScreenSize().
(WebKit::WebPageProxy::availableScreenSize): Used availableScreenSize() instead of WKGetAvailableScreenSize().
(WebKit::WebPageProxy::textAutosizingWidth): Used screenSize() instead of WKGetScreenSize().
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface): Deleted.
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::platformInitializeAccessibility): Used newAccessibilityRemoteToken() instead of WKAXRemoteToken().

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@191904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
47 files changed