Replace iOS-only WebKitSystemInterface calls with SPI
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 19:09:09 +0000 (19:09 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Nov 2015 19:09:09 +0000 (19:09 +0000)
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:

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@191902 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

index 28450fa..619cbbf 100644 (file)
@@ -1,3 +1,63 @@
+2015-10-31  Andy Estes  <aestes@apple.com>
+
+        Replace iOS-only WebKitSystemInterface calls with SPI
+        https://bugs.webkit.org/show_bug.cgi?id=150763
+
+        Reviewed by Darin Adler.
+
+        * 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:
+
 2015-11-02  Frederic Wang  <fred.wang@free.fr>
 
         [Win] Add support for the USE_TYPO_METRICS flag
index ef793e1..1cecb5d 100644 (file)
                31DEA4551B39F4D900F77178 /* WebSystemBackdropLayer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31DEA4531B39F4D900F77178 /* WebSystemBackdropLayer.mm */; };
                31DEA4561B39F4D900F77178 /* WebSystemBackdropLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DEA4541B39F4D900F77178 /* WebSystemBackdropLayer.h */; };
                31DF63571AF187DD0078FD91 /* NSColorSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DF63561AF187DD0078FD91 /* NSColorSPI.h */; };
-               31DF63591AF194F00078FD91 /* UIColorSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 31DF63581AF194F00078FD91 /* UIColorSPI.h */; };
                31EAF97E121435A400E7C1BF /* DeviceMotionClientIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */; };
                31EAF97F121435A400E7C1BF /* DeviceMotionClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */; };
                31EC1E2814FF60EE00C94662 /* JSNotificationPermissionCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31EC1E2614FF60EE00C94662 /* JSNotificationPermissionCallback.cpp */; };
                44A28AAF12DFB8BF00AE923B /* MathMLNames.h in Headers */ = {isa = PBXBuildFile; fileRef = 44A28AAE12DFB8BF00AE923B /* MathMLNames.h */; };
                44C363F00FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
                44C363F10FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */; };
-               44C3CFE81556BE5D00013609 /* WebCoreSystemInterfaceIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C3CFE71556BE5D00013609 /* WebCoreSystemInterfaceIOS.h */; settings = {ATTRIBUTES = (Private, ); }; };
                44C991820F3D1E0D00586670 /* ScrollbarThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */; };
                44C991860F3D1EBE00586670 /* ScrollbarThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */; };
                44C9919F0F3D210E00586670 /* ThemeIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 44C9919D0F3D210E00586670 /* ThemeIOS.h */; };
                A14978711ABAF3A500CEF7E4 /* PlatformContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A14978701ABAF3A500CEF7E4 /* PlatformContentFilter.h */; };
                A17C81220F2A5CF7005DAAEB /* HTMLElementFactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */; };
                A17C81230F2A5CF7005DAAEB /* HTMLElementFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */; };
+               A182D5B71BE722670087A7CC /* SettingsCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = A182D5B61BE722620087A7CC /* SettingsCocoa.mm */; };
                A18890AE1AA13F250026C301 /* ParentalControlsContentFilter.mm in Sources */ = {isa = PBXBuildFile; fileRef = A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */; };
                A18890AF1AA13F250026C301 /* ParentalControlsContentFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */; };
                A19AEA211AAA808600B52B25 /* JSMockContentFilterSettings.h in Headers */ = {isa = PBXBuildFile; fileRef = A19AEA1E1AAA806E00B52B25 /* JSMockContentFilterSettings.h */; };
                A1E1154613015C4E0054AC8C /* PointLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154513015C4E0054AC8C /* PointLightSource.cpp */; };
                A1E1154813015C5D0054AC8C /* SpotLightSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */; };
                A1E5B31F1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */; };
+               A1ED778C1BE3294000DC1791 /* Device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1ED778A1BE3293F00DC1791 /* Device.cpp */; };
+               A1ED778D1BE3294000DC1791 /* Device.h in Headers */ = {isa = PBXBuildFile; fileRef = A1ED778B1BE3294000DC1791 /* Device.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A1ED778F1BE4291800DC1791 /* UIKitSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1ED778E1BE4291800DC1791 /* UIKitSPI.h */; };
                A2B9217316C5CC420041DCD9 /* IntRectExtent.h in Headers */ = {isa = PBXBuildFile; fileRef = A2B9217216C5CC420041DCD9 /* IntRectExtent.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A31C4E4D16E02AA6002F7957 /* OESTextureHalfFloat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A31C4E4C16E02AA6002F7957 /* OESTextureHalfFloat.cpp */; };
                A31C4E4F16E02AB4002F7957 /* OESTextureHalfFloat.h in Headers */ = {isa = PBXBuildFile; fileRef = A31C4E4E16E02AB4002F7957 /* OESTextureHalfFloat.h */; };
                CE12523D1A1676CD00864480 /* QuartzCoreSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12523C1A1676CD00864480 /* QuartzCoreSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE1252411A16B1B600864480 /* MediaPlayerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252401A16B1B600864480 /* MediaPlayerSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE1252431A16C01A00864480 /* CoreUISPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252421A16C01A00864480 /* CoreUISPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               CE1252451A16C22500864480 /* DynamicLinkerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252441A16C22500864480 /* DynamicLinkerSPI.h */; };
+               CE1252451A16C22500864480 /* DynamicLinkerSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252441A16C22500864480 /* DynamicLinkerSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE1252471A16C2C200864480 /* NSPointerFunctionsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252461A16C2C200864480 /* NSPointerFunctionsSPI.h */; };
                CE1252491A16C3BC00864480 /* MobileGestaltSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */; settings = {ATTRIBUTES = (Private, ); }; };
                CE12524D1A1A77DE00864480 /* IOPMLibSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = CE12524C1A1A77DE00864480 /* IOPMLibSPI.h */; };
                E1C266DB18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHash.h */; };
                E1C266DE18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C266DC18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp */; };
                E1C266DF18319F31003F8B33 /* CryptoKeyDataRSAComponents.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C266DD18319F31003F8B33 /* CryptoKeyDataRSAComponents.h */; };
-               E1C2F24A1533A2120083F974 /* SettingsMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1C2F2481533A2120083F974 /* SettingsMac.mm */; };
                E1C362EF0EAF2AA9007410BC /* JSWorkerLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C362ED0EAF2AA9007410BC /* JSWorkerLocation.h */; };
                E1C362F00EAF2AA9007410BC /* JSWorkerLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1C362EE0EAF2AA9007410BC /* JSWorkerLocation.cpp */; };
                E1C36C030EB076D6007410BC /* JSDOMGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = E1C36C020EB076D6007410BC /* JSDOMGlobalObject.h */; settings = {ATTRIBUTES = (Private, ); }; };
                31DEA4531B39F4D900F77178 /* WebSystemBackdropLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSystemBackdropLayer.mm; sourceTree = "<group>"; };
                31DEA4541B39F4D900F77178 /* WebSystemBackdropLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSystemBackdropLayer.h; sourceTree = "<group>"; };
                31DF63561AF187DD0078FD91 /* NSColorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSColorSPI.h; sourceTree = "<group>"; };
-               31DF63581AF194F00078FD91 /* UIColorSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIColorSPI.h; sourceTree = "<group>"; };
                31E8D8BA160BC94B004CE8F5 /* RenderSnapshottedPlugIn.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderSnapshottedPlugIn.cpp; sourceTree = "<group>"; };
                31E8D8BB160BC94C004CE8F5 /* RenderSnapshottedPlugIn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderSnapshottedPlugIn.h; sourceTree = "<group>"; };
                31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeviceMotionClientIOS.h; sourceTree = "<group>"; };
                44A28AAE12DFB8BF00AE923B /* MathMLNames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MathMLNames.h; sourceTree = "<group>"; };
                44C363EE0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RuntimeApplicationChecksIOS.h; sourceTree = "<group>"; };
                44C363EF0FAA7BB30097F8CC /* RuntimeApplicationChecksIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RuntimeApplicationChecksIOS.mm; sourceTree = "<group>"; };
-               44C3CFE71556BE5D00013609 /* WebCoreSystemInterfaceIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreSystemInterfaceIOS.h; sourceTree = "<group>"; };
                44C991810F3D1E0D00586670 /* ScrollbarThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ScrollbarThemeIOS.mm; sourceTree = "<group>"; };
                44C991850F3D1EBE00586670 /* ScrollbarThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrollbarThemeIOS.h; sourceTree = "<group>"; };
                44C9919D0F3D210E00586670 /* ThemeIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThemeIOS.h; sourceTree = "<group>"; };
                A14978701ABAF3A500CEF7E4 /* PlatformContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformContentFilter.h; sourceTree = "<group>"; };
                A17C81200F2A5CF7005DAAEB /* HTMLElementFactory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HTMLElementFactory.cpp; sourceTree = "<group>"; };
                A17C81210F2A5CF7005DAAEB /* HTMLElementFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HTMLElementFactory.h; sourceTree = "<group>"; };
+               A182D5B61BE722620087A7CC /* SettingsCocoa.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsCocoa.mm; sourceTree = "<group>"; };
                A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ParentalControlsContentFilter.mm; sourceTree = "<group>"; };
                A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ParentalControlsContentFilter.h; sourceTree = "<group>"; };
                A19AEA1C1AAA7C4900B52B25 /* MockContentFilterSettings.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = MockContentFilterSettings.idl; sourceTree = "<group>"; };
                A1E1154513015C4E0054AC8C /* PointLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PointLightSource.cpp; sourceTree = "<group>"; };
                A1E1154713015C5D0054AC8C /* SpotLightSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpotLightSource.cpp; sourceTree = "<group>"; };
                A1E5B31D1AAD1DA4006EBEFB /* JSMockContentFilterSettingsCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSMockContentFilterSettingsCustom.cpp; sourceTree = "<group>"; };
+               A1ED778A1BE3293F00DC1791 /* Device.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Device.cpp; sourceTree = "<group>"; };
+               A1ED778B1BE3294000DC1791 /* Device.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Device.h; sourceTree = "<group>"; };
+               A1ED778E1BE4291800DC1791 /* UIKitSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIKitSPI.h; sourceTree = "<group>"; };
                A208E222A56A0C7575F2A72E /* RenderMathMLMenclose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMathMLMenclose.h; sourceTree = "<group>"; };
                A2B9217216C5CC420041DCD9 /* IntRectExtent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntRectExtent.h; sourceTree = "<group>"; };
                A31C4E4C16E02AA6002F7957 /* OESTextureHalfFloat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OESTextureHalfFloat.cpp; sourceTree = "<group>"; };
                E1C266DA18319935003F8B33 /* CryptoAlgorithmRsaKeyParamsWithHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoAlgorithmRsaKeyParamsWithHash.h; sourceTree = "<group>"; };
                E1C266DC18319F31003F8B33 /* CryptoKeyDataRSAComponents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoKeyDataRSAComponents.cpp; sourceTree = "<group>"; };
                E1C266DD18319F31003F8B33 /* CryptoKeyDataRSAComponents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyDataRSAComponents.h; sourceTree = "<group>"; };
-               E1C2F2481533A2120083F974 /* SettingsMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SettingsMac.mm; sourceTree = "<group>"; };
                E1C362ED0EAF2AA9007410BC /* JSWorkerLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSWorkerLocation.h; sourceTree = "<group>"; };
                E1C362EE0EAF2AA9007410BC /* JSWorkerLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSWorkerLocation.cpp; sourceTree = "<group>"; };
                E1C36C020EB076D6007410BC /* JSDOMGlobalObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSDOMGlobalObject.h; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                ADFE2B541BD5F41200DAB457 /* ResourceUsageOverlayCocoa.mm */,
+                               A182D5B61BE722620087A7CC /* SettingsCocoa.mm */,
                                26255F0118878E110006E1FD /* UserAgent.h */,
                                5D5975B61963637B00D00878 /* UserAgent.mm */,
                        );
                                834DD4F31BE08989002C9C3E /* PageMac.mm */,
                                2D93AEE119DF5641002A86C3 /* ServicesOverlayController.h */,
                                2D93AEE219DF5641002A86C3 /* ServicesOverlayController.mm */,
-                               E1C2F2481533A2120083F974 /* SettingsMac.mm */,
                                2D4F96F31A1ECC240098BF88 /* TextIndicatorWindow.h */,
                                2D4F96F41A1ECC240098BF88 /* TextIndicatorWindow.mm */,
                                26255F0218878E110006E1FD /* UserAgentMac.mm */,
                                CE1252481A16C3BC00864480 /* MobileGestaltSPI.h */,
                                6FAD4A561A9D0FAE009F7D3C /* OpenGLESSPI.h */,
                                CE1252381A166FA000864480 /* QuickLookSPI.h */,
-                               31DF63581AF194F00078FD91 /* UIColorSPI.h */,
+                               A1ED778E1BE4291800DC1791 /* UIKitSPI.h */,
                        );
                        path = ios;
                        sourceTree = "<group>";
                        children = (
                                A148328B187F506800DA63A6 /* wak */,
                                2655414B1489AA2B000DFC5D /* CursorIOS.cpp */,
+                               A1ED778A1BE3293F00DC1791 /* Device.cpp */,
+                               A1ED778B1BE3294000DC1791 /* Device.h */,
                                31EAF97C121435A400E7C1BF /* DeviceMotionClientIOS.h */,
                                31EAF97D121435A400E7C1BF /* DeviceMotionClientIOS.mm */,
                                31403799124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h */,
                                1F72BF09187FD4270009BCB3 /* TileControllerMemoryHandlerIOS.h */,
                                31403797124BEA7F00AF40E4 /* WebCoreMotionManager.h */,
                                31403798124BEA7F00AF40E4 /* WebCoreMotionManager.mm */,
-                               44C3CFE71556BE5D00013609 /* WebCoreSystemInterfaceIOS.h */,
                                E45390380EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm */,
                                FE0D84E810484348001A179E /* WebEvent.h */,
                                FE0D84EA1048436E001A179E /* WebEvent.mm */,
                                85526CD20AB0B7D9000302EA /* DOMTreeWalker.h in Headers */,
                                850B41C30AD9E7E700A6ED4F /* DOMTreeWalkerInternal.h in Headers */,
                                85C7F4910AAF79DC004014DD /* DOMUIEvent.h in Headers */,
+                               A1ED778F1BE4291800DC1791 /* UIKitSPI.h in Headers */,
                                85989DD00ACC8BBD00A0BC51 /* DOMUIEventInternal.h in Headers */,
                                FED13D2A0CEA91DF00D89466 /* DOMUIKitExtensions.h in Headers */,
                                2E37DFDB12DBAFB800A6B233 /* DOMURL.h in Headers */,
                                C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */,
                                B2C3DA490D006C1D00EF6F26 /* TextEncodingRegistry.h in Headers */,
                                933A14300B7D188600A53FFD /* TextEvent.h in Headers */,
+                               A1ED778D1BE3294000DC1791 /* Device.h in Headers */,
                                A77B41A012E675A90054343D /* TextEventInputType.h in Headers */,
                                F55B3DD81251F12D003EF269 /* TextFieldInputType.h in Headers */,
                                B2C3DA450D006C1D00EF6F26 /* TextFlags.h in Headers */,
                                C375D7FE16639519006184AB /* TypeAhead.h in Headers */,
                                E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */,
                                93309E1A099E64920056E581 /* TypingCommand.h in Headers */,
-                               31DF63591AF194F00078FD91 /* UIColorSPI.h in Headers */,
                                85031B4E0A44EFC700F992E0 /* UIEvent.h in Headers */,
                                85031B4F0A44EFC700F992E0 /* UIEventWithKeyState.h in Headers */,
                                AA4739D21757AFEC00E76767 /* UIRequestEvent.h in Headers */,
                                E180810F16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.h in Headers */,
                                E152551516FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.h in Headers */,
                                93EB169709F880C00091F8FF /* WebCoreSystemInterface.h in Headers */,
-                               44C3CFE81556BE5D00013609 /* WebCoreSystemInterfaceIOS.h in Headers */,
                                A14832C7187F66C800DA63A6 /* WebCoreThread.h in Headers */,
                                A14832C9187F676B00DA63A6 /* WebCoreThreadInternal.h in Headers */,
                                A14832CA187F678000DA63A6 /* WebCoreThreadMessage.h in Headers */,
                                409EBDB216B7EE7400CBA3FC /* CSSFontFaceLoadEvent.cpp in Sources */,
                                A80E6CE70A1989CA007FB8C5 /* CSSFontFaceRule.cpp in Sources */,
                                BC64B4D70CB4298A005F2B62 /* CSSFontFaceSource.cpp in Sources */,
+                               A1ED778C1BE3294000DC1791 /* Device.cpp in Sources */,
                                BC64B4D90CB4298A005F2B62 /* CSSFontFaceSrcValue.cpp in Sources */,
                                4A6E9FC313C17D1D0046A7F8 /* CSSFontFeatureValue.cpp in Sources */,
                                BC64B4DB0CB4298A005F2B62 /* CSSFontSelector.cpp in Sources */,
                                93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */,
                                B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
                                14C9A5EA0B3D105F005A0232 /* Settings.cpp in Sources */,
-                               E1C2F24A1533A2120083F974 /* SettingsMac.mm in Sources */,
                                0F3DD44F12F5EA1B000D9190 /* ShadowBlur.cpp in Sources */,
                                BC5EB8C30E82031B00B25965 /* ShadowData.cpp in Sources */,
                                A6D169621346B49B000EB770 /* ShadowRoot.cpp in Sources */,
                                1A37636B1A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp in Sources */,
                                8102C5881325BB1100DDE67A /* StringCallback.cpp in Sources */,
                                B23540F20D00782E002382FA /* StringTruncator.cpp in Sources */,
+                               A182D5B71BE722670087A7CC /* SettingsCocoa.mm in Sources */,
                                BC5EB6A20E81DC4F00B25965 /* StyleBackgroundData.cpp in Sources */,
                                BC5EB67D0E81D42000B25965 /* StyleBoxData.cpp in Sources */,
                                8386A97019F61E4F00E1EC4A /* StyleBuilder.cpp in Sources */,
index 889857d..e31f88f 100644 (file)
@@ -116,11 +116,6 @@ typedef float CGFloat;
 #endif
 #endif /* USE(CG) */
 
-#if PLATFORM(IOS)
-#define WEBCORE_NAVIGATOR_PLATFORM wkGetPlatformNameForNavigator();
-#define WEBCORE_NAVIGATOR_VENDOR wkGetVendorNameForNavigator();
-#endif
-
 // FIXME: Move this to JavaScriptCore/wtf/Platform.h, which is where we define USE_AVFOUNDATION on the Mac.
 // https://bugs.webkit.org/show_bug.cgi?id=67334
 #if PLATFORM(WIN) && USE(CG) && HAVE(AVCF)
index d341c21..d607f6a 100644 (file)
@@ -57,7 +57,7 @@
 #endif
 
 #if PLATFORM(IOS)
-#include "WebCoreSystemInterface.h"
+#include "Device.h"
 #endif
 
 namespace WebCore {
@@ -631,8 +631,8 @@ static bool view_modeMediaFeatureEval(CSSValue* value, const CSSToLengthConversi
 static inline bool isRunningOnIPhoneOrIPod()
 {
 #if PLATFORM(IOS)
-    static wkDeviceClass deviceClass = iosDeviceClass();
-    return deviceClass == wkDeviceClassiPhone || deviceClass == wkDeviceClassiPod;
+    static bool runningOnIPhoneOrIPod = deviceClass() == MGDeviceClassiPhone || deviceClass() == MGDeviceClassiPod;
+    return runningOnIPhoneOrIPod;
 #else
     return false;
 #endif
index 3d8c2ad..0e26eba 100644 (file)
 
 #if PLATFORM(IOS)
 #include "RuntimeApplicationChecksIOS.h"
+#include "WebVideoFullscreenInterfaceAVKit.h"
 #endif
 
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
@@ -6434,7 +6435,7 @@ bool HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction(PlatformMedia
     if (m_videoFullscreenMode & VideoFullscreenModePictureInPicture)
         return true;
 #if PLATFORM(IOS)
-    if (m_videoFullscreenMode == VideoFullscreenModeStandard && wkIsOptimizedFullscreenSupported() && isPlaying())
+    if (m_videoFullscreenMode == VideoFullscreenModeStandard && supportsPictureInPicture() && isPlaying())
         return true;
 #endif
     return false;
index c24167c..dd3ca34 100644 (file)
@@ -55,8 +55,8 @@
 #include <wtf/Ref.h>
 
 #if PLATFORM(IOS)
+#include "DynamicLinkerSPI.h"
 #include "RuntimeApplicationChecksIOS.h"
-#include "WebCoreSystemInterface.h"
 #endif
 
 namespace WebCore {
@@ -159,7 +159,7 @@ static void mapDataParamToSrc(Vector<String>* paramNames, Vector<String>* paramV
 #if PLATFORM(IOS)
 static bool shouldNotPerformURLAdjustment()
 {
-    static bool shouldNotPerformURLAdjustment = applicationIsNASAHD() && !iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_5_0);
+    static bool shouldNotPerformURLAdjustment = applicationIsNASAHD() && dyld_get_program_sdk_version() < DYLD_IOS_VERSION_5_0;
     return shouldNotPerformURLAdjustment;
 }
 #endif
index bd30675..e6812db 100644 (file)
 #include "Settings.h"
 #include <wtf/NeverDestroyed.h>
 
+#if ENABLE(VIDEO_PRESENTATION_MODE)
+#include "WebVideoFullscreenInterfaceAVKit.h"
+#endif
+
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -369,7 +373,7 @@ bool HTMLVideoElement::webkitSupportsPresentationMode(const String& mode) const
         return mediaSession().fullscreenPermitted(*this) && supportsFullscreen();
 
     if (mode == presentationModePictureInPicture())
-        return wkIsOptimizedFullscreenSupported() && mediaSession().allowsPictureInPicture(*this) && supportsFullscreen();
+        return supportsPictureInPicture() && mediaSession().allowsPictureInPicture(*this) && supportsFullscreen();
 
     if (mode == presentationModeInline())
         return !mediaSession().requiresFullscreenForVideoPlayback(*this);
index ed99cff..0f5e2be 100644 (file)
 #endif
 
 #if PLATFORM(IOS)
-#include "WebCoreSystemInterface.h"
+#include "Device.h"
 #endif
 
 #ifndef WEBCORE_NAVIGATOR_PLATFORM
 #if PLATFORM(IOS)
-#define WEBCORE_NAVIGATOR_PLATFORM ""
+#define WEBCORE_NAVIGATOR_PLATFORM deviceName()
 #elif OS(MAC_OS_X) && (CPU(PPC) || CPU(PPC64))
 #define WEBCORE_NAVIGATOR_PLATFORM "MacPPC"
 #elif OS(MAC_OS_X) && (CPU(X86) || CPU(X86_64))
@@ -69,7 +69,6 @@
 #define WEBCORE_NAVIGATOR_VENDOR_SUB ""
 #endif // ifndef WEBCORE_NAVIGATOR_VENDOR_SUB
 
-
 namespace WebCore {
 
 NavigatorBase::~NavigatorBase()
index 936eae1..3749251 100644 (file)
@@ -282,6 +282,10 @@ public:
 
     WEBCORE_EXPORT void setForcePendingWebGLPolicy(bool);
     bool isForcePendingWebGLPolicy() const { return m_forcePendingWebGLPolicy; }
+    
+#if PLATFORM(IOS)
+    WEBCORE_EXPORT static float defaultMinimumZoomFontSize();
+#endif
 
 private:
     explicit Settings(Page*);
index 924790d..5a868f4 100644 (file)
@@ -32,7 +32,7 @@
 #include <wtf/text/CString.h>
 
 #if PLATFORM(IOS)
-#include "WebCoreSystemInterface.h"
+#include "PlatformScreen.h"
 #endif
 
 namespace WebCore {
@@ -213,7 +213,7 @@ ViewportConfiguration::Parameters ViewportConfiguration::textDocumentParameters(
     Parameters parameters;
 
 #if PLATFORM(IOS)
-    parameters.width = static_cast<int>(wkGetScreenSize().width);
+    parameters.width = static_cast<int>(screenSize().width());
 #else
     // FIXME: this needs to be unified with ViewportArguments on all ports.
     parameters.width = 320;
similarity index 93%
rename from Source/WebCore/page/mac/SettingsMac.mm
rename to Source/WebCore/page/cocoa/SettingsCocoa.mm
index ae06132..6dd5dc0 100644 (file)
 #include "config.h"
 #include "Settings.h"
 
+#if PLATFORM(IOS)
+#include "Device.h"
+#include "SoftLinking.h"
+#include "UIKitSPI.h"
+#endif
+
+#if PLATFORM(IOS)
+SOFT_LINK_FRAMEWORK(UIKit)
+SOFT_LINK_CLASS(UIKit, UIApplication)
+#endif
+
 namespace WebCore {
 
 static inline const char* sansSerifTraditionalHanFontFamily()
@@ -47,6 +58,7 @@ static inline const char* sansSerifSimplifiedHanFontFamily()
 }
 
 #if PLATFORM(MAC)
+
 void Settings::initializeDefaultFontFamilies()
 {
     setStandardFontFamily("Songti TC", USCRIPT_TRADITIONAL_HAN);
@@ -107,6 +119,14 @@ void Settings::initializeDefaultFontFamilies()
     setSerifFontFamily("Times", USCRIPT_COMMON);
     setSansSerifFontFamily("Helvetica", USCRIPT_COMMON);
 }
+    
+float Settings::defaultMinimumZoomFontSize()
+{
+    if (deviceHasIPadCapability() && ![[getUIApplicationClass() sharedApplication] _isClassic])
+        return 0;
+    return 15;
+}
+
 #endif
 
 } // namespace WebCore
index 68fbdf2..76d3442 100644 (file)
 #import "config.h"
 #import "UserAgent.h"
 
+#import "Device.h"
+#import "MobileGestaltSPI.h"
+#import "SoftLinking.h"
 #import "SystemVersion.h"
+#import "UIKitSPI.h"
 #import "WebCoreSystemInterface.h"
+#import <wtf/RetainPtr.h>
+
+SOFT_LINK_FRAMEWORK(UIKit);
+SOFT_LINK_CLASS(UIKit, UIApplication);
 
 namespace WebCore {
 
-String standardUserAgentWithApplicationName(const String& applicationName, const String& fullWebKitVersionString)
+static inline bool isClassic()
+{
+    return [[getUIApplicationClass() sharedApplication] _isClassic];
+}
+
+static inline NSString *osNameForUserAgent()
 {
-    if (CFStringRef overrideUserAgent = wkGetUserAgent())
-        return overrideUserAgent;
+    if (deviceHasIPadCapability() && !isClassic())
+        return @"OS";
+    return @"iPhone OS";
+}
 
+static inline NSString *deviceNameForUserAgent()
+{
+    if (isClassic())
+        return @"iPhone";
+    
+    auto name = retainPtr((NSString *)deviceName());
+#if PLATFORM(IOS_SIMULATOR)
+    NSUInteger location = [name rangeOfString:@" Simulator" options:NSBackwardsSearch].location;
+    if (location != NSNotFound && location > 0)
+        return [name substringToIndex:location];
+#endif
+    return name.autorelease();
+}
+
+String standardUserAgentWithApplicationName(const String& applicationName, const String& fullWebKitVersionString)
+{
     // Check to see if there is a user agent override for all WebKit clients.
     CFPropertyListRef override = CFPreferencesCopyAppValue(CFSTR("UserAgent"), CFSTR("com.apple.WebFoundation"));
     if (override) {
@@ -44,13 +75,12 @@ String standardUserAgentWithApplicationName(const String& applicationName, const
         CFRelease(override);
     }
 
+    // FIXME: We should implement this with String and/or StringBuilder instead.
     NSString *webKitVersion = userAgentBundleVersionFromFullVersionString(fullWebKitVersionString);
-    CFStringRef deviceName = wkGetDeviceName();
-    CFStringRef osNameForUserAgent = wkGetOSNameForUserAgent();
     NSString *osMarketingVersionString = systemMarketingVersionForUserAgentString();
     if (applicationName.isEmpty())
-        return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko)", deviceName, osNameForUserAgent, osMarketingVersionString, webKitVersion];
-    return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko) %@", deviceName, osNameForUserAgent, osMarketingVersionString, webKitVersion, static_cast<NSString *>(applicationName)];
+        return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko)", deviceNameForUserAgent(), osNameForUserAgent(), osMarketingVersionString, webKitVersion];
+    return [NSString stringWithFormat:@"Mozilla/5.0 (%@; CPU %@ %@ like Mac OS X) AppleWebKit/%@ (KHTML, like Gecko) %@", deviceNameForUserAgent(), osNameForUserAgent(), osMarketingVersionString, webKitVersion, static_cast<NSString *>(applicationName)];
 }
 
 } // namespace WebCore.
index e4cae10..f1f5dd8 100644 (file)
@@ -40,6 +40,10 @@ typedef struct _NSPoint NSPoint;
 #endif
 #endif
 
+#if PLATFORM(IOS)
+OBJC_CLASS UIScreen;
+#endif
+
 typedef uint32_t PlatformDisplayID;
 
 typedef WTF::Vector<char> ColorProfile;
@@ -47,6 +51,7 @@ typedef WTF::Vector<char> ColorProfile;
 namespace WebCore {
 
     class FloatRect;
+    class FloatSize;
     class Widget;
 
     int screenDepth(Widget*);
@@ -69,6 +74,9 @@ namespace WebCore {
 
 #if PLATFORM(IOS)
     float screenPPIFactor();
+    WEBCORE_EXPORT FloatSize screenSize();
+    WEBCORE_EXPORT FloatSize availableScreenSize();
+    WEBCORE_EXPORT float screenScaleFactor(UIScreen * = nullptr);
 #endif
 
 } // namespace WebCore
diff --git a/Source/WebCore/platform/ios/Device.cpp b/Source/WebCore/platform/ios/Device.cpp
new file mode 100644 (file)
index 0000000..a96b710
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2015 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 "Device.h"
+
+#if PLATFORM(IOS)
+
+#include <mutex>
+#include <wtf/NeverDestroyed.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+MGDeviceClass deviceClass()
+{
+    static MGDeviceClass deviceClass;
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        int deviceClassNumber = MGGetSInt32Answer(kMGQDeviceClassNumber, MGDeviceClassInvalid);
+        switch (deviceClassNumber) {
+        case MGDeviceClassInvalid:
+        case MGDeviceClassiPhone:
+        case MGDeviceClassiPod:
+        case MGDeviceClassiPad:
+        case MGDeviceClassAppleTV:
+        case MGDeviceClassWatch:
+            deviceClass = static_cast<MGDeviceClass>(deviceClassNumber);
+            return;
+        }
+        ASSERT_NOT_REACHED();
+    });
+    return deviceClass;
+}
+
+const String& deviceName()
+{
+    static LazyNeverDestroyed<String> deviceName;
+    static std::once_flag onceFlag;
+    std::call_once(onceFlag, [] {
+        auto cfDeviceName = adoptCF(static_cast<CFStringRef>(MGCopyAnswer(kMGQDeviceName, nullptr)));
+        ASSERT(!cfDeviceName || CFGetTypeID(cfDeviceName.get()) == CFStringGetTypeID());
+        deviceName.construct(cfDeviceName.get());
+    });
+    return deviceName;
+}
+
+bool deviceHasIPadCapability()
+{
+    static bool deviceHasIPadCapability = MGGetBoolAnswer(kMGQiPadCapability);
+    return deviceHasIPadCapability;
+}
+
+} // namespace WebCore
+
+#endif // PLATFORM(IOS)
diff --git a/Source/WebCore/platform/ios/Device.h b/Source/WebCore/platform/ios/Device.h
new file mode 100644 (file)
index 0000000..e08cbd1
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#ifndef Device_h
+#define Device_h
+
+#if PLATFORM(IOS)
+
+#include "MobileGestaltSPI.h"
+
+namespace WTF {
+class String;
+}
+
+namespace WebCore {
+
+WEBCORE_EXPORT MGDeviceClass deviceClass();
+const WTF::String& deviceName();
+
+// FIXME: Isn't this the same as deviceClass() == MGDeviceClassiPad?
+bool deviceHasIPadCapability();
+
+}
+
+#endif // PLATFORM(IOS)
+
+#endif // Device_h
index a208fe9..65817eb 100644 (file)
 #import "config.h"
 #import "PlatformScreen.h"
 
+#import "Device.h"
 #import "FloatRect.h"
+#import "FloatSize.h"
 #import "FrameView.h"
 #import "HostWindow.h"
 #import "IntRect.h"
 #import "MobileGestaltSPI.h"
 #import "SoftLinking.h"
+#import "UIKitSPI.h"
 #import "WAKWindow.h"
 #import "WebCoreSystemInterface.h"
 #import "Widget.h"
 
 SOFT_LINK_FRAMEWORK(UIKit)
-SOFT_LINK(UIKit, UIAccessibilityIsGrayscaleEnabled, bool, (void), ())
-SOFT_LINK(UIKit, UIAccessibilityIsInvertColorsEnabled, bool, (void), ())
+SOFT_LINK_CLASS(UIKit, UIApplication)
+SOFT_LINK_CLASS(UIKit, UIScreen)
+SOFT_LINK(UIKit, UIAccessibilityIsGrayscaleEnabled, BOOL, (void), ())
+SOFT_LINK(UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
 
 namespace WebCore {
 
@@ -98,25 +103,14 @@ FloatRect screenAvailableRect(Widget* widget)
     return enclosingIntRect(FloatRect(FloatPoint(), widget->root()->hostWindow()->availableScreenSize()));
 }
 
-static float mobileGestaltFloatValue(CFStringRef question)
-{
-    float result = 0;
-    if (CFTypeRef value = MGCopyAnswer(question, 0)) {
-        if (CFGetTypeID(value) == CFNumberGetTypeID())
-            CFNumberGetValue(static_cast<CFNumberRef>(value), kCFNumberFloatType, &result);
-        CFRelease(value);
-    }
-    return result;
-}
-
 float screenPPIFactor()
 {
     static float ppiFactor;
 
     static dispatch_once_t onceToken;
     dispatch_once(&onceToken, ^{
-        float pitch = mobileGestaltFloatValue(kMGQMainScreenPitch);
-        float scale = mobileGestaltFloatValue(kMGQMainScreenScale);
+        int pitch = MGGetSInt32Answer(kMGQMainScreenPitch, 0);
+        float scale = MGGetFloat32Answer(kMGQMainScreenScale, 0);
 
         static const float originalIPhonePPI = 163;
         float mainScreenPPI = (pitch && scale) ? pitch / scale : originalIPhonePPI;
@@ -126,4 +120,33 @@ float screenPPIFactor()
     return ppiFactor;
 }
 
+FloatSize screenSize()
+{
+    if (deviceHasIPadCapability() && [[getUIApplicationClass() sharedApplication] _isClassic])
+        return { 320, 480 };
+    return FloatSize([[getUIScreenClass() mainScreen] _referenceBounds].size);
+}
+
+FloatSize availableScreenSize()
+{
+    if (deviceHasIPadCapability() && [[getUIApplicationClass() sharedApplication] _isClassic])
+        return { 320, 480 };
+    return FloatSize([getUIScreenClass() mainScreen].bounds.size);
+}
+
+float screenScaleFactor(UIScreen *screen)
+{
+    if (!screen)
+        screen = [getUIScreenClass() mainScreen];
+
+    CGFloat scale = screen.scale;
+
+    // We can remove this clamping once <rdar://problem/16395475> is fixed.
+    const CGFloat maximumClassicScreenScaleFactor = 2;
+    if ([[getUIApplicationClass() sharedApplication] _isClassic])
+        return std::min(scale, maximumClassicScreenScaleFactor);
+
+    return scale;
+}
+
 } // namespace WebCore
diff --git a/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h b/Source/WebCore/platform/ios/WebCoreSystemInterfaceIOS.h
deleted file mode 100644 (file)
index 98f011a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2012 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. ``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
- * 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. 
- */
-
-#ifndef WebCoreSystemInterfaceIOS_h
-#define WebCoreSystemInterfaceIOS_h
-
-#include <Availability.h>
-
-typedef enum {
-    wkIOSSystemVersion_3_0 = __IPHONE_3_0,
-    wkIOSSystemVersion_4_2 = __IPHONE_4_2,
-    wkIOSSystemVersion_5_0 = __IPHONE_5_0,
-    wkIOSSystemVersion_6_0 = __IPHONE_6_0,
-    wkIOSSystemVersion_9_0 = __IPHONE_9_0,
-} wkIOSSystemVersion;
-
-bool iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion);
-
-extern bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
-
-extern bool (*wkIsGB18030ComplianceRequired)(void);
-
-inline bool iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion version)
-{
-    return wkExecutableWasLinkedOnOrAfterIOSVersion(version);
-}
-
-typedef enum {
-    wkDeviceClassInvalid = -1,
-    wkDeviceClassiPad,
-    wkDeviceClassiPhone,
-    wkDeviceClassiPod,
-} wkDeviceClass;
-extern int (*wkGetDeviceClass)(void);
-inline wkDeviceClass iosDeviceClass(void)
-{
-    int deviceClass = wkGetDeviceClass();
-    switch (deviceClass) {
-    case wkDeviceClassInvalid:
-    case wkDeviceClassiPad:
-    case wkDeviceClassiPhone:
-    case wkDeviceClassiPod:
-        return (wkDeviceClass)deviceClass;
-    }
-    assert(false);
-    return wkDeviceClassInvalid;
-}
-
-extern CFStringRef (*wkGetUserAgent)(void);
-extern CFStringRef (*wkGetDeviceName)(void);
-extern CFStringRef (*wkGetOSNameForUserAgent)(void);
-extern CFStringRef (*wkGetPlatformNameForNavigator)(void);
-extern CFStringRef (*wkGetVendorNameForNavigator)(void);
-
-extern bool (*wkIsOptimizedFullscreenSupported)(void);
-
-#endif // WebCoreSystemInterfaceIOS_h
index c6e4c16..4e30366 100644 (file)
@@ -46,13 +46,7 @@ WEBCORE_EXPORT void (*wkSetCONNECTProxyForStream)(CFReadStreamRef, CFStringRef p
 WEBCORE_EXPORT void (*wkSetCONNECTProxyAuthorizationForStream)(CFReadStreamRef, CFStringRef proxyAuthorizationString);
 WEBCORE_EXPORT void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
 WEBCORE_EXPORT CFHTTPMessageRef (*wkCopyCONNECTProxyResponse)(CFReadStreamRef, CFURLRef responseURL, CFStringRef proxyHost, CFNumberRef proxyPort);
-WEBCORE_EXPORT bool (*wkExecutableWasLinkedOnOrAfterIOSVersion)(int);
-WEBCORE_EXPORT int (*wkGetDeviceClass)(void);
-WEBCORE_EXPORT CGSize (*wkGetScreenSize)(void);
-WEBCORE_EXPORT CGSize (*wkGetAvailableScreenSize)(void);
 WEBCORE_EXPORT void (*wkSetLayerContentsScale)(CALayer *);
-WEBCORE_EXPORT float (*wkGetScreenScaleFactor)(void);
-WEBCORE_EXPORT bool (*wkIsGB18030ComplianceRequired)(void);
 WEBCORE_EXPORT void (*wkCFURLRequestAllowAllPostCaching)(CFURLRequestRef);
 WEBCORE_EXPORT CFArrayRef (*wkCopyNSURLResponseCertificateChain)(NSURLResponse*);
 WEBCORE_EXPORT CFStringEncoding (*wkGetWebDefaultCFStringEncoding)(void);
@@ -104,14 +98,6 @@ WEBCORE_EXPORT bool (*wkIsPublicSuffix)(NSString *host);
 WEBCORE_EXPORT CFStringRef (*wkCachePartitionKey)(void);
 #endif
 
-WEBCORE_EXPORT CFStringRef (*wkGetUserAgent)(void);
-WEBCORE_EXPORT CFStringRef (*wkGetDeviceName)(void);
-WEBCORE_EXPORT CFStringRef (*wkGetOSNameForUserAgent)(void);
-WEBCORE_EXPORT CFStringRef (*wkGetPlatformNameForNavigator)(void);
-WEBCORE_EXPORT CFStringRef (*wkGetVendorNameForNavigator)(void);
-
-WEBCORE_EXPORT bool (*wkIsOptimizedFullscreenSupported)(void);
-
 WEBCORE_EXPORT int (*wkExernalDeviceTypeForPlayer)(AVPlayer *);
 WEBCORE_EXPORT NSString *(*wkExernalDeviceDisplayNameForPlayer)(AVPlayer *);
 
index 826af13..cded666 100644 (file)
@@ -26,7 +26,9 @@
 
 #import "config.h"
 
-#if PLATFORM(IOS) && HAVE(AVKIT)
+#if PLATFORM(IOS)
+
+#if HAVE(AVKIT)
 
 #import "WebVideoFullscreenInterfaceAVKit.h"
 
@@ -57,6 +59,7 @@ SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspect, NSString *)
 SOFT_LINK_CONSTANT(AVFoundation, AVLayerVideoGravityResizeAspectFill, NSString *)
 
 SOFT_LINK_FRAMEWORK(AVKit)
+SOFT_LINK_CLASS(AVKit, AVPictureInPictureController)
 SOFT_LINK_CLASS(AVKit, AVPlayerController)
 SOFT_LINK_CLASS(AVKit, AVPlayerViewController)
 SOFT_LINK_CLASS(AVKit, AVValueTiming)
@@ -1302,7 +1305,7 @@ void WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline(bool visible, co
 
 bool WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture() const
 {
-    return [m_playerController isPlaying] && m_mode == HTMLMediaElementEnums::VideoFullscreenModeStandard && wkIsOptimizedFullscreenSupported();
+    return [m_playerController isPlaying] && m_mode == HTMLMediaElementEnums::VideoFullscreenModeStandard && supportsPictureInPicture();
 }
 
 void WebVideoFullscreenInterfaceAVKit::fullscreenMayReturnToInline(std::function<void(bool)> callback)
@@ -1438,4 +1441,15 @@ void WebVideoFullscreenInterfaceAVKit::clearMode(HTMLMediaElementEnums::VideoFul
         m_videoFullscreenModel->fullscreenModeChanged(m_mode);
 }
 
+#endif // HAVE(AVKIT)
+
+bool WebCore::supportsPictureInPicture()
+{
+#if PLATFORM(IOS) && HAVE(AVKIT)
+    return [getAVPictureInPictureControllerClass() isPictureInPictureSupported];
+#else
+    return false;
 #endif
+}
+
+#endif // PLATFORM(IOS)
index 9d83c5d..989cd77 100644 (file)
@@ -29,6 +29,7 @@
 #if PLATFORM(IOS)
 
 #import "LegacyTileCache.h"
+#import "PlatformScreen.h"
 #import "WAKViewInternal.h"
 #import "WebCoreSystemInterface.h"
 #import "WebCoreThreadRun.h"
@@ -67,7 +68,7 @@ static id<OrientationProvider> gOrientationProvider;
     _hostLayer = [layer retain];
 
     _frame = [_hostLayer frame];
-    _screenScale = wkGetScreenScaleFactor();
+    _screenScale = screenScaleFactor();
     
     _tileCache = new LegacyTileCache(self);
 
@@ -86,7 +87,7 @@ static id<OrientationProvider> gOrientationProvider;
         return nil;
 
     _frame = frame;
-    _screenScale = wkGetScreenScaleFactor();
+    _screenScale = screenScaleFactor();
 
     _exposedScrollViewRect = CGRectNull;
 
index 99c4161..2de43df 100644 (file)
@@ -30,7 +30,7 @@
 
 #import "CoreGraphicsSPI.h"
 #import "FontCascade.h"
-#import "WebCoreSystemInterface.h"
+#import "PlatformScreen.h"
 #import "WebCoreThread.h"
 #import <ImageIO/ImageIO.h>
 #import <wtf/StdLibExtras.h>
@@ -113,9 +113,9 @@ CGImageRef WKGraphicsCreateImageFromBundleWithName(const char *image_file)
 
     CGImageRef image = nullptr;
     NSData *imageData = nullptr;
-    for (unsigned scaleFactor = wkGetScreenScaleFactor(); scaleFactor > 0; --scaleFactor) {
+    for (unsigned scaleFactor = screenScaleFactor(); scaleFactor > 0; --scaleFactor) {
         imageData = [NSData dataWithContentsOfFile:imageResourcePath(image_file, scaleFactor)];
-        ASSERT(scaleFactor != wkGetScreenScaleFactor() || imageData);
+        ASSERT(scaleFactor != screenScaleFactor() || imageData);
         if (imageData)
             break;
     }
@@ -131,7 +131,7 @@ CGImageRef WKGraphicsCreateImageFromBundleWithName(const char *image_file)
 static void WKDrawPatternBitmap(void *info, CGContextRef c) 
 {
     CGImageRef image = (CGImageRef)info;
-    CGFloat scale = wkGetScreenScaleFactor();
+    CGFloat scale = screenScaleFactor();
     CGContextDrawImage(c, CGRectMake(0, 0, CGImageGetWidth(image) / scale, CGImageGetHeight(image) / scale), image);    
 }
 
@@ -150,7 +150,7 @@ CGPatternRef WKCreatePatternFromCGImage(CGImageRef imageRef)
     // retain image since it's freed by our callback
     CGImageRetain(imageRef);
 
-    CGFloat scale = wkGetScreenScaleFactor();
+    CGFloat scale = screenScaleFactor();
     return CGPatternCreate((void*)imageRef, CGRectMake(0, 0, CGImageGetWidth(imageRef) / scale, CGImageGetHeight(imageRef) / scale), CGAffineTransformIdentity, CGImageGetWidth(imageRef) / scale, CGImageGetHeight(imageRef) / scale, kCGPatternTilingConstantSpacing, 1 /*isColored*/, &WKPatternBitmapCallbacks);
 }
 
index 046dd6b..60b4890 100644 (file)
 
 #include <objc/objc.h>
 
-#if PLATFORM(IOS)
-#include "WebCoreSystemInterfaceIOS.h"
-#endif
-
 typedef const struct __CFString * CFStringRef;
 typedef const struct __CFNumber * CFNumberRef;
 typedef const struct __CFDictionary * CFDictionaryRef;
@@ -237,10 +233,7 @@ extern AXUIElementRef (*wkCreateAXUIElementRef)(id element);
 #endif // !PLATFORM(IOS)
 
 #if PLATFORM(IOS)
-extern CGSize (*wkGetScreenSize)(void);
-extern CGSize (*wkGetAvailableScreenSize)(void);
 extern void (*wkSetLayerContentsScale)(CALayer *);
-extern float (*wkGetScreenScaleFactor)(void);
 #endif
 
 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
index 460da91..de626b1 100644 (file)
 #else
 
 #define DYLD_IOS_VERSION_3_0 0x00030000
-#define DYLD_IOS_VERSION_6_0 0x00060000;
-#define DYLD_IOS_VERSION_7_0 0x00070000;
+#define DYLD_IOS_VERSION_4_2 0x00040200
+#define DYLD_IOS_VERSION_5_0 0x00050000
+#define DYLD_IOS_VERSION_6_0 0x00060000
+#define DYLD_IOS_VERSION_7_0 0x00070000
+#define DYLD_IOS_VERSION_9_0 0x00090000
 
 #endif
 
index 036a447..2d9ebdf 100644 (file)
 EXTERN_C const CFStringRef kMGQAppleInternalInstallCapability = CFSTR("apple-internal-install");
 EXTERN_C const CFStringRef kMGQMainScreenPitch = CFSTR("main-screen-pitch");
 EXTERN_C const CFStringRef kMGQMainScreenScale = CFSTR("main-screen-scale");
+EXTERN_C const CFStringRef kMGQiPadCapability = CFSTR("ipad");
+EXTERN_C const CFStringRef kMGQDeviceName = CFSTR("DeviceName");
+EXTERN_C const CFStringRef kMGQDeviceClassNumber = CFSTR("DeviceClassNumber");
+
+typedef enum {
+    MGDeviceClassInvalid = -1,
+    /* 0 is intentionally not in this enum */
+    MGDeviceClassiPhone  = 1,
+    MGDeviceClassiPod    = 2,
+    MGDeviceClassiPad    = 3,
+    MGDeviceClassAppleTV = 4,
+    /* 5 is intentionally not in this enum */
+    MGDeviceClassWatch   = 6,
+} MGDeviceClass;
 
 #endif
 
@@ -50,6 +64,14 @@ EXTERN_C CFTypeRef MGCopyAnswer(CFStringRef question, CFDictionaryRef options);
 EXTERN_C bool MGGetBoolAnswer(CFStringRef question);
 #endif
 
+#ifndef MGGetSInt32Answer
+EXTERN_C SInt32 MGGetSInt32Answer(CFStringRef question, SInt32 defaultValue);
+#endif
+
+#ifndef MGGetFloat32Answer
+EXTERN_C Float32 MGGetFloat32Answer(CFStringRef question, Float32 defaultValue);
+#endif
+
 #endif
 
 #endif // MobileGestaltSPI_h
similarity index 87%
rename from Source/WebCore/platform/spi/ios/UIColorSPI.h
rename to Source/WebCore/platform/spi/ios/UIKitSPI.h
index b9814a5..3cf20f9 100644 (file)
 
 #if USE(APPLE_INTERNAL_SDK)
 
+#import <UIKit/UIApplication_Private.h>
 #import <UIKit/UIInterface_Private.h>
+#import <UIKit/UIScreen_Private.h>
 
 #else
 
-#import <UIKit/UIColor.h>
+#import <UIKit/UIKit.h>
+
+@interface UIApplication ()
+
+- (BOOL)_isClassic;
+
+@end
 
 @interface UIColor ()
 
 
 @end
 
+@interface UIScreen ()
+
+@property (nonatomic, readonly) CGRect _referenceBounds;
+
+@end
+
 #endif
index 99679c8..5ecf81d 100644 (file)
@@ -56,7 +56,7 @@
 #import "RenderThemeIOS.h"
 #import "RenderView.h"
 #import "SoftLinking.h"
-#import "UIColorSPI.h"
+#import "UIKitSPI.h"
 #import "UserAgentScripts.h"
 #import "UserAgentStyleSheets.h"
 #import "WebCoreThreadRun.h"
index 4fa5bae..b28eef9 100644 (file)
@@ -1,3 +1,16 @@
+2015-10-31  Andy Estes  <aestes@apple.com>
+
+        Replace iOS-only WebKitSystemInterface calls with SPI
+        https://bugs.webkit.org/show_bug.cgi?id=150763
+
+        Reviewed by Darin Adler.
+
+        * 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().
+
 2015-10-14  Zhuo Li  <zachli@apple.com>
 
         Augment <input type=search>’s recent search history with the time each entry was added,
index 02c97a6..73939f3 100644 (file)
 #import "WebPlatformStrategies.h"
 #import "WebSystemInterface.h"
 #import "WebViewPrivate.h"
+#import <WebCore/DynamicLinkerSPI.h>
 #import <WebCore/PathUtilities.h>
 #import <WebCore/ResourceRequest.h>
+#import <WebCore/Settings.h>
 #import <WebCore/TextBreakIterator.h>
 #import <WebCore/WebCoreSystemInterface.h>
 #import <WebCore/WebCoreThreadSystemInterface.h>
@@ -46,7 +48,7 @@ using namespace WebCore;
 
 static inline bool linkedOnOrAfterIOS5()
 {
-    static bool s_linkedOnOrAfterIOS5 = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_5_0);
+    static bool s_linkedOnOrAfterIOS5 = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_5_0;
     return s_linkedOnOrAfterIOS5;
 }
 
@@ -83,7 +85,7 @@ void WebKitSetIsClassic(BOOL flag)
 
 float WebKitGetMinimumZoomFontSize(void)
 {
-    return WKGetMinimumZoomFontSize();
+    return Settings::defaultMinimumZoomFontSize();
 }
 
 int WebKitGetLastLineBreakInBuffer(UChar *characters, int position, int length)
index b9cf139..4e40ab5 100644 (file)
@@ -54,6 +54,7 @@
 #import <WebCore/HTMLNames.h>
 #import <WebCore/IntRect.h>
 #import <WebCore/Node.h>
+#import <WebCore/PlatformScreen.h>
 #import <WebCore/RenderBox.h>
 #import <WebCore/RenderObject.h>
 #import <WebCore/RuntimeApplicationChecksIOS.h>
 #import <WebCore/WAKWindow.h>
 #import <WebCore/WebCoreThreadMessage.h>
 
-#if PLATFORM(IOS)
-#include "WebKitSystemInterface.h"
-#endif
-
 using namespace WebCore;
 
 void WebChromeClientIOS::setWindowRect(const WebCore::FloatRect& r)
@@ -174,7 +171,7 @@ static inline NSDictionary* dictionaryForViewportArguments(const WebCore::Viewpo
 
 FloatSize WebChromeClientIOS::screenSize() const
 {
-    return FloatSize(WKGetScreenSize());
+    return FloatSize(screenSize());
 }
 
 FloatSize WebChromeClientIOS::availableScreenSize() const
index 030ae30..8a4584e 100644 (file)
@@ -1,3 +1,18 @@
+2015-10-31  Andy Estes  <aestes@apple.com>
+
+        Replace iOS-only WebKitSystemInterface calls with SPI
+        https://bugs.webkit.org/show_bug.cgi?id=150763
+
+        Reviewed by Darin Adler.
+
+        * 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().
+
 2015-11-02  Youenn Fablet  <youenn.fablet@crf.canon.fr>
 
         Rename JSDOMWrapper.impl to JSDOMWrapper.wrapped
index 8c205b4..14c1bc6 100644 (file)
@@ -111,16 +111,6 @@ void InitWebCoreSystemInterface(void)
     INIT(QTClearMediaDownloadCache);
 #endif
 
-#if PLATFORM(IOS)
-    INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
-    INIT(GetDeviceClass);
-    INIT(GetScreenSize);
-    INIT(GetAvailableScreenSize);
-    INIT(GetScreenScaleFactor);
-    INIT(IsGB18030ComplianceRequired);
-    INIT(IsOptimizedFullscreenSupported);
-#endif
-
 #if !PLATFORM(IOS)
     INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
     INIT(CopyDefaultSearchProviderDisplayName);
@@ -170,14 +160,6 @@ void InitWebCoreSystemInterface(void)
 
     INIT(CFURLRequestAllowAllPostCaching);
 
-#if PLATFORM(IOS)
-    INIT(GetUserAgent);
-    INIT(GetDeviceName);
-    INIT(GetOSNameForUserAgent);
-    INIT(GetPlatformNameForNavigator);
-    INIT(GetVendorNameForNavigator);
-#endif
-
 #if !PLATFORM(IOS)
     INIT(NSElasticDeltaForTimeDelta);
     INIT(NSElasticDeltaForReboundDelta);
index e02a918..ec717bc 100644 (file)
@@ -59,6 +59,7 @@ using namespace WebCore;
 
 #if PLATFORM(IOS)
 #import <AudioToolbox/AudioSession.h>
+#import <WebCore/Device.h>
 #import <WebCore/GraphicsContext.h>
 #import <WebCore/ImageSource.h>
 #import <WebCore/WebCoreThreadMessage.h>
@@ -396,7 +397,7 @@ public:
     WTF::initializeMainThreadToProcessMainThread();
     RunLoop::initializeMainRunLoop();
 #else
-    bool allowsInlineMediaPlayback = WKGetDeviceClass() == WKDeviceClassiPad;
+    bool allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
     bool requiresPlaysInlineAttribute = !allowsInlineMediaPlayback;
 #endif
     InitWebCoreSystemInterface();
@@ -576,7 +577,7 @@ public:
         @"",                              WebKitNetworkInterfaceNamePreferenceKey,
 #endif
 #if ENABLE(IOS_TEXT_AUTOSIZING)
-        [NSNumber numberWithFloat:WKGetMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
+        [NSNumber numberWithFloat:Settings::defaultMinimumZoomFontSize()], WebKitMinimumZoomFontSizePreferenceKey,
 #endif
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheTotalQuota,
         [NSNumber numberWithLongLong:ApplicationCacheStorage::noQuota()], WebKitApplicationCacheDefaultOriginQuota,
index 91d8bc4..1a4f752 100644 (file)
 #import "WebStorageManagerPrivate.h"
 #import "WebUIKitSupport.h"
 #import "WebVisiblePosition.h"
+#import <WebCore/DynamicLinkerSPI.h>
 #import <WebCore/EventNames.h>
 #import <WebCore/FontCache.h>
 #import <WebCore/GraphicsLayer.h>
 #import <WebCore/LegacyTileCache.h>
 #import <WebCore/MobileGestaltSPI.h>
 #import <WebCore/NetworkStateNotifier.h>
+#import <WebCore/PlatformScreen.h>
 #import <WebCore/RuntimeApplicationChecksIOS.h>
 #import <WebCore/SQLiteDatabaseTracker.h>
 #import <WebCore/SmartReplace.h>
@@ -850,7 +852,7 @@ static bool shouldAllowDisplayAndRunningOfInsecureContent()
 static bool shouldAllowPictureInPictureMediaPlayback()
 {
 #if PLATFORM(IOS)
-    static bool shouldAllowPictureInPictureMediaPlayback = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_9_0);
+    static bool shouldAllowPictureInPictureMediaPlayback = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_9_0;
     return shouldAllowPictureInPictureMediaPlayback;
 #else
     return false;
@@ -5398,7 +5400,7 @@ static NSString * const backingPropertyOldScaleFactorKey = @"NSBackingPropertyOl
     if (WAKWindow *window = [self window])
         scaleFactor = [window screenScale];
     else
-        scaleFactor = WKGetScreenScaleFactor();
+        scaleFactor = screenScaleFactor();
 
     _private->page->setDeviceScaleFactor(scaleFactor);
 }
index 26489c7..aa333a1 100644 (file)
@@ -1,3 +1,36 @@
+2015-10-31  Andy Estes  <aestes@apple.com>
+
+        Replace iOS-only WebKitSystemInterface calls with SPI
+        https://bugs.webkit.org/show_bug.cgi?id=150763
+
+        Reviewed by Darin Adler.
+
+        * 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().
+
 2015-11-02  Yongjun Zhang  <yongjun_zhang@apple.com>
 
         Add objC delegate callback for webProcessDidBecomeResponsive and webProcessDidBecomeUnresponsive.
diff --git a/Source/WebKit2/Platform/ios/AccessibilityIOS.h b/Source/WebKit2/Platform/ios/AccessibilityIOS.h
new file mode 100644 (file)
index 0000000..25afbb4
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#import <wtf/RetainPtr.h>
+
+OBJC_CLASS NSData;
+OBJC_CLASS NSUUID;
+
+namespace WebKit {
+
+NSData *newAccessibilityRemoteToken(NSUUID *);
+
+} // namespace WebKit
diff --git a/Source/WebKit2/Platform/ios/AccessibilityIOS.mm b/Source/WebKit2/Platform/ios/AccessibilityIOS.mm
new file mode 100644 (file)
index 0000000..4004ab9
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2015 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.
+ */
+
+#import "config.h"
+#import "AccessibilityIOS.h"
+
+#if PLATFORM(IOS)
+
+namespace WebKit {
+
+NSData *newAccessibilityRemoteToken(NSUUID *uuid)
+{
+    if (!uuid)
+        return nil;
+    return [NSKeyedArchiver archivedDataWithRootObject:@{ @"ax-pid" : @(getpid()), @"ax-uuid" : [uuid UUIDString], @"ax-register" : @YES }];
+}
+
+} // namespace WebKit
+
+#endif // PLATFORM(IOS)
index 1c08ad2..7c893bc 100644 (file)
@@ -55,7 +55,7 @@
 #define DEFAULT_TEXT_AREAS_ARE_RESIZABLE false
 #define DEFAULT_JAVASCRIPT_CAN_OPEN_WINDOWS_AUTOMATICALLY false
 #define DEFAULT_SHOULD_RESPECT_IMAGE_ORIENTATION true
-#define DEFAULT_MINIMUM_FONT_ZOOM_SIZE WKGetMinimumZoomFontSize()
+#define DEFAULT_MINIMUM_FONT_ZOOM_SIZE WebCore::Settings::defaultMinimumZoomFontSize()
 #define DEFAULT_PASSWORD_ECHO_ENABLED true
 #define DEFAULT_ALLOWS_INLINE_MEDIA_PLAYBACK false
 #define DEFAULT_INLINE_MEDIA_PLAYBACK_REQUIRES_PLAYS_INLINE_ATTRIBUTE true
index b1d4e3e..cc24dd8 100644 (file)
 #include <WebCore/TextEncodingRegistry.h>
 #include <wtf/NeverDestroyed.h>
 
-#if PLATFORM(IOS)
-#import <WebKitSystemInterfaceIOS.h>
-#endif
-
 using namespace WebCore;
 
 namespace WebKit {
index 5c9f6c4..18de9bc 100644 (file)
 #import "WebVideoFullscreenManagerProxy.h"
 #import <UIKit/UIApplication.h>
 #import <WebCore/CoreGraphicsSPI.h>
+#import <WebCore/DynamicLinkerSPI.h>
 #import <WebCore/FrameLoaderTypes.h>
 #import <WebCore/InspectorOverlay.h>
 #import <WebCore/QuartzCoreSPI.h>
@@ -280,7 +281,7 @@ static int32_t deviceOrientation()
 
 static bool shouldAllowPictureInPictureMediaPlayback()
 {
-    static bool shouldAllowPictureInPictureMediaPlayback = iosExecutableWasLinkedOnOrAfterVersion(wkIOSSystemVersion_9_0);
+    static bool shouldAllowPictureInPictureMediaPlayback = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_9_0;
     return shouldAllowPictureInPictureMediaPlayback;
 }
 
@@ -1136,7 +1137,7 @@ static inline bool areEssentiallyEqualAsFloat(float a, float b)
 
 - (PassRefPtr<WebKit::ViewSnapshot>)_takeViewSnapshot
 {
-    float deviceScale = WKGetScreenScaleFactor();
+    float deviceScale = WebCore::screenScaleFactor();
     WebCore::FloatSize snapshotSize(self.bounds.size);
     snapshotSize.scale(deviceScale, deviceScale);
 
index f657e24..3372d09 100644 (file)
@@ -40,7 +40,7 @@
 
 #if PLATFORM(IOS)
 #import "UIKitSPI.h"
-#import "WebKitSystemInterfaceIOS.h"
+#import <WebCore/Device.h>
 #endif
 
 template<typename T> class LazyInitialized {
@@ -109,7 +109,7 @@ private:
 #if PLATFORM(IOS)
     _requiresUserActionForMediaPlayback = YES;
     _allowsPictureInPictureMediaPlayback = YES;
-    _allowsInlineMediaPlayback = WKGetDeviceClass() == WKDeviceClassiPad;
+    _allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
     _inlineMediaPlaybackRequiresPlaysInlineAttribute = !_allowsInlineMediaPlayback;
     _mediaDataLoadsAutomatically = NO;
 #endif
index bd34d45..dd0bf04 100644 (file)
@@ -29,6 +29,7 @@
 #if PLATFORM(IOS)
 
 #import "APIPageConfiguration.h"
+#import "AccessibilityIOS.h"
 #import "ApplicationStateTracker.h"
 #import "PageClientImplIOS.h"
 #import "RemoteLayerTreeDrawingAreaProxy.h"
@@ -44,7 +45,6 @@
 #import "WKWebViewInternal.h"
 #import "WebFrameProxy.h"
 #import "WebKit2Initialize.h"
-#import "WebKitSystemInterfaceIOS.h"
 #import "WebPageGroup.h"
 #import "WebProcessPool.h"
 #import "WebSystemInterface.h"
@@ -53,6 +53,7 @@
 #import <WebCore/FrameView.h>
 #import <WebCore/InspectorOverlay.h>
 #import <WebCore/NotImplemented.h>
+#import <WebCore/PlatformScreen.h>
 #import <WebCore/QuartzCoreSPI.h>
 #import <wtf/CurrentTime.h>
 #import <wtf/RetainPtr.h>
@@ -188,7 +189,7 @@ private:
 
     _page = processPool.createWebPage(*_pageClient, WTF::move(configuration));
     _page->initializeWebPage();
-    _page->setIntrinsicDeviceScaleFactor(WKGetScaleFactorForScreen([UIScreen mainScreen]));
+    _page->setIntrinsicDeviceScaleFactor(screenScaleFactor([UIScreen mainScreen]));
     _page->setUseFixedLayout(true);
     _page->setDelegatesScrolling(true);
 
@@ -419,7 +420,7 @@ private:
 - (void)_updateForScreen:(UIScreen *)screen
 {
     ASSERT(screen);
-    _page->setIntrinsicDeviceScaleFactor(WKGetScaleFactorForScreen(screen));
+    _page->setIntrinsicDeviceScaleFactor(screenScaleFactor(screen));
     [self _accessibilityRegisterUIProcessTokens];
 }
 
@@ -429,15 +430,23 @@ private:
     [self _accessibilityRegisterUIProcessTokens];
 }
 
+static void storeAccessibilityRemoteConnectionInformation(id element, pid_t pid, mach_port_t sendPort, NSUUID *uuid)
+{
+    // The accessibility bundle needs to know the uuid, pid and mach_port that this object will refer to.
+    objc_setAssociatedObject(element, (void*)[@"ax-uuid" hash], uuid, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+    objc_setAssociatedObject(element, (void*)[@"ax-pid" hash], @(pid), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+    objc_setAssociatedObject(element, (void*)[@"ax-machport" hash], @(sendPort), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
+}
+
 - (void)_accessibilityRegisterUIProcessTokens
 {
-    RetainPtr<CFUUIDRef> uuid = adoptCF(CFUUIDCreate(kCFAllocatorDefault));
-    NSData *remoteElementToken = WKAXRemoteToken(uuid.get());
+    auto uuid = [NSUUID UUID];
+    NSData *remoteElementToken = newAccessibilityRemoteToken(uuid);
 
     // Store information about the WebProcess that can later be retrieved by the iOS Accessibility runtime.
     if (_page->process().state() == WebProcessProxy::State::Running) {
         IPC::Connection* connection = _page->process().connection();
-        WKAXStoreRemoteConnectionInformation(self, _page->process().processIdentifier(), connection->identifier().port, uuid.get());
+        storeAccessibilityRemoteConnectionInformation(self, _page->process().processIdentifier(), connection->identifier().port, uuid);
 
         IPC::DataReference elementToken = IPC::DataReference(reinterpret_cast<const uint8_t*>([remoteElementToken bytes]), [remoteElementToken length]);
         _page->registerUIProcessAccessibilityTokens(elementToken, elementToken);
index a9eb2c3..d81a726 100644 (file)
@@ -72,7 +72,6 @@
 #import <WebCore/WebCoreNSURLExtras.h>
 #import <WebCore/WebEvent.h>
 #import <WebKit/WebSelectionRect.h> // FIXME: WK2 should not include WebKit headers!
-#import <WebKitSystemInterfaceIOS.h>
 #import <wtf/RetainPtr.h>
 
 @interface UIEvent(UIEventInternal)
index 21d3c87..7667514 100644 (file)
 #import "UserData.h"
 #import "ViewUpdateDispatcherMessages.h"
 #import "WKBrowsingContextControllerInternal.h"
-#import "WebKitSystemInterfaceIOS.h"
 #import "WebPageMessages.h"
 #import "WebProcessProxy.h"
 #import "WebVideoFullscreenManagerProxy.h"
 #import <WebCore/FrameView.h>
 #import <WebCore/NotImplemented.h>
+#import <WebCore/PlatformScreen.h>
 #import <WebCore/SharedBuffer.h>
 #import <WebCore/UserAgent.h>
 
@@ -765,17 +765,17 @@ void WebPageProxy::blurAssistedNode()
 
 FloatSize WebPageProxy::screenSize()
 {
-    return FloatSize(WKGetScreenSize());
+    return WebCore::screenSize();
 }
 
 FloatSize WebPageProxy::availableScreenSize()
 {
-    return FloatSize(WKGetAvailableScreenSize());
+    return WebCore::availableScreenSize();
 }
     
 float WebPageProxy::textAutosizingWidth()
 {
-    return WKGetScreenSize().width;
+    return WebCore::screenSize().width();
 }
 
 void WebPageProxy::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t dynamicViewportSizeUpdateID)
index 0aaa6f6..5dec470 100644 (file)
                A118A9EF1907AD6F00F7C92B /* QuickLookDocumentData.h in Headers */ = {isa = PBXBuildFile; fileRef = A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */; };
                A118A9F21908B8EA00F7C92B /* _WKNSFileManagerExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = A118A9F01908B8EA00F7C92B /* _WKNSFileManagerExtras.mm */; };
                A118A9F31908B8EA00F7C92B /* _WKNSFileManagerExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = A118A9F11908B8EA00F7C92B /* _WKNSFileManagerExtras.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               A182D5B41BE6BD250087A7CC /* AccessibilityIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = A182D5B21BE6BD250087A7CC /* AccessibilityIOS.mm */; };
+               A182D5B51BE6BD250087A7CC /* AccessibilityIOS.h in Headers */ = {isa = PBXBuildFile; fileRef = A182D5B31BE6BD250087A7CC /* AccessibilityIOS.h */; };
                A1A4FE5A18DCE9FA00B5EA8A /* _WKDownload.h in Headers */ = {isa = PBXBuildFile; fileRef = A1A4FE5718DCE9FA00B5EA8A /* _WKDownload.h */; settings = {ATTRIBUTES = (Private, ); }; };
                A1A4FE5B18DCE9FA00B5EA8A /* _WKDownload.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1A4FE5818DCE9FA00B5EA8A /* _WKDownload.mm */; };
                A1A4FE5C18DCE9FA00B5EA8A /* _WKDownloadInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = A1A4FE5918DCE9FA00B5EA8A /* _WKDownloadInternal.h */; };
                A118A9ED1907AD6F00F7C92B /* QuickLookDocumentData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuickLookDocumentData.h; path = ios/QuickLookDocumentData.h; sourceTree = "<group>"; };
                A118A9F01908B8EA00F7C92B /* _WKNSFileManagerExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKNSFileManagerExtras.mm; sourceTree = "<group>"; };
                A118A9F11908B8EA00F7C92B /* _WKNSFileManagerExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKNSFileManagerExtras.h; sourceTree = "<group>"; };
+               A182D5B21BE6BD250087A7CC /* AccessibilityIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityIOS.mm; sourceTree = "<group>"; };
+               A182D5B31BE6BD250087A7CC /* AccessibilityIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityIOS.h; sourceTree = "<group>"; };
                A1A4FE5718DCE9FA00B5EA8A /* _WKDownload.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownload.h; sourceTree = "<group>"; };
                A1A4FE5818DCE9FA00B5EA8A /* _WKDownload.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = _WKDownload.mm; sourceTree = "<group>"; };
                A1A4FE5918DCE9FA00B5EA8A /* _WKDownloadInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKDownloadInternal.h; sourceTree = "<group>"; };
                        path = mac;
                        sourceTree = "<group>";
                };
+               A182D5B11BE6BCF40087A7CC /* ios */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A182D5B31BE6BD250087A7CC /* AccessibilityIOS.h */,
+                               A182D5B21BE6BD250087A7CC /* AccessibilityIOS.mm */,
+                       );
+                       path = ios;
+                       sourceTree = "<group>";
+               };
                A78CCDD5193AC9E3005ECC25 /* SandboxProfiles */ = {
                        isa = PBXGroup;
                        children = (
                                1AA2E51A12E4C05600BC4966 /* cg */,
                                3709504218A88CDE0087AE5D /* foundation */,
                                1AE00D6818327C1200087DD7 /* IPC */,
+                               A182D5B11BE6BCF40087A7CC /* ios */,
                                1A7E814E1152D2240003695B /* mac */,
                                CE1A0BCA1A48E6C60054EF74 /* spi */,
                                51B15A7D138439B200321AD8 /* unix */,
                                3760881F150413E900FC82C7 /* WebRenderObject.h in Headers */,
                                510AFFBA16542048001BA05E /* WebResourceLoader.h in Headers */,
                                51F060E01654317F00F3281B /* WebResourceLoaderMessages.h in Headers */,
+                               A182D5B51BE6BD250087A7CC /* AccessibilityIOS.h in Headers */,
                                7C361D731927FA360036A59D /* WebScriptMessageHandler.h in Headers */,
                                D3B9484911FF4B6500032B39 /* WebSearchPopupMenu.h in Headers */,
                                1A4832D71A9CDF96008B4DFE /* WebsiteData.h in Headers */,
                                1AC1336E18565D2B00F3EC05 /* APIPageHandle.cpp in Sources */,
                                7CE4D21F1A4914CA00C7F152 /* APIProcessPoolConfiguration.cpp in Sources */,
                                FED3C1DC1B447EAC00E0EB7F /* APISerializedScriptValueCocoa.mm in Sources */,
+                               A182D5B41BE6BD250087A7CC /* AccessibilityIOS.mm in Sources */,
                                75A8D2E2187DEC1E00C39C9E /* APISession.cpp in Sources */,
                                1AFDE6611954E9B100C48FFA /* APISessionState.cpp in Sources */,
                                BCE2315E122C30CA00D5C35A /* APIURLRequest.cpp in Sources */,
index dce2574..03f2882 100644 (file)
@@ -151,28 +151,11 @@ void InitWebCoreSystemInterface(void)
 
         INIT(CFURLRequestAllowAllPostCaching);
 
-#if PLATFORM(IOS)
-        INIT(GetUserAgent);
-        INIT(GetDeviceName);
-        INIT(GetOSNameForUserAgent);
-        INIT(GetPlatformNameForNavigator);
-        INIT(GetVendorNameForNavigator);
-#endif
-
 #if !PLATFORM(IOS)
         INIT(NSElasticDeltaForTimeDelta);
         INIT(NSElasticDeltaForReboundDelta);
         INIT(NSReboundDeltaForElasticDelta);
 #endif
-#if PLATFORM(IOS)
-        INIT(ExecutableWasLinkedOnOrAfterIOSVersion);
-        INIT(GetDeviceClass);
-        INIT(GetScreenSize);
-        INIT(GetAvailableScreenSize);
-        INIT(GetScreenScaleFactor);
-        INIT(IsGB18030ComplianceRequired);
-        INIT(IsOptimizedFullscreenSupported);
-#endif
 
 #if ENABLE(PUBLIC_SUFFIX_LIST)
         INIT(IsPublicSuffix);
index 5c98b62..be2e18a 100644 (file)
@@ -28,6 +28,7 @@
 
 #if PLATFORM(IOS)
 
+#import "AccessibilityIOS.h"
 #import "AssistedNodeInformation.h"
 #import "DataReference.h"
 #import "DrawingArea.h"
@@ -45,7 +46,6 @@
 #import "WebFrame.h"
 #import "WebImage.h"
 #import "WebKitSystemInterface.h"
-#import "WebKitSystemInterfaceIOS.h"
 #import "WebPageProxyMessages.h"
 #import "WebProcess.h"
 #import <CoreText/CTFont.h>
@@ -119,9 +119,7 @@ void WebPage::platformInitializeAccessibility()
     m_mockAccessibilityElement = adoptNS([[WKAccessibilityWebPageObject alloc] init]);
     [m_mockAccessibilityElement setWebPage:this];
     
-    RetainPtr<CFUUIDRef> uuid = adoptCF(CFUUIDCreate(kCFAllocatorDefault));
-    NSData *remoteToken = WKAXRemoteToken(uuid.get());
-    
+    NSData *remoteToken = newAccessibilityRemoteToken([NSUUID UUID]);
     IPC::DataReference dataToken = IPC::DataReference(reinterpret_cast<const uint8_t*>([remoteToken bytes]), [remoteToken length]);
     send(Messages::WebPageProxy::RegisterWebProcessAccessibilityToken(dataToken));
 }