Replace iOS-only WebKitSystemInterface calls with SPI
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 20:29:38 +0000 (20:29 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 20:29:38 +0000 (20:29 +0000)
commit6e519733af6b2af627127457a0aa2dd9af324ac3
tree4c365c4f482fe93f11dfbfd0f0f0b004204fa4bb
parentbe8dff30693dc86f05951f0cff5b9c9d2c4c10d2
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: https://svn.webkit.org/repository/webkit/trunk@191904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
47 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/config.h
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLObjectElement.cpp
Source/WebCore/html/HTMLVideoElement.cpp
Source/WebCore/page/NavigatorBase.cpp
Source/WebCore/page/Settings.h
Source/WebCore/page/ViewportConfiguration.cpp
Source/WebCore/page/cocoa/SettingsCocoa.mm [moved from Source/WebCore/page/mac/SettingsMac.mm with 93% similarity]
Source/WebCore/page/ios/UserAgentIOS.mm
Source/WebCore/platform/PlatformScreen.h
Source/WebCore/platform/ios/Device.cpp [new file with mode: 0644]
Source/WebCore/platform/ios/Device.h [new file with mode: 0644]
Source/WebCore/platform/ios/PlatformScreenIOS.mm
Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h [deleted file]
Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/ios/wak/WAKWindow.mm
Source/WebCore/platform/ios/wak/WKGraphics.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/spi/cocoa/DynamicLinkerSPI.h
Source/WebCore/platform/spi/ios/MobileGestaltSPI.h
Source/WebCore/platform/spi/ios/UIKitSPI.h [moved from Source/WebCore/platform/spi/ios/UIColorSPI.h with 87% similarity]
Source/WebCore/rendering/RenderThemeIOS.mm
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/Misc/WebUIKitSupport.mm
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/ios/AccessibilityIOS.h [new file with mode: 0644]
Source/WebKit2/Platform/ios/AccessibilityIOS.mm [new file with mode: 0644]
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/Shared/WebPreferencesStore.cpp
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
Source/WebKit2/UIProcess/ios/WKContentView.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm