[Mac] Upstream miscellaneous WebKitSystemInterface functions
authoraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2017 16:21:29 +0000 (16:21 +0000)
committeraestes@apple.com <aestes@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Sep 2017 16:21:29 +0000 (16:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177029

Reviewed by Alex Christensen.

Source/WebCore:

* Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
* platform/cocoa/LocalizedStringsCocoa.mm:
(WebCore::contextMenuItemTagSearchWeb):
* platform/cocoa/ScrollController.mm:
(WebCore::elasticDeltaForTimeDelta):
(WebCore::elasticDeltaForReboundDelta):
(WebCore::reboundDeltaForElasticDelta):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/mac/CursorMac.mm:
(WebCore::WKCoreCursor_coreCursorType):
(WebCore::createCoreCursorClass):
(WebCore::coreCursorClass):
(WebCore::cursor):
(WebCore::Cursor::ensurePlatformCursor const):
* platform/mac/WebCoreSystemInterface.h:
* platform/mac/WebCoreSystemInterface.mm:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::paintTextArea):

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
* pal/spi/cf/CFUtilitiesSPI.h:
* pal/spi/cocoa/LaunchServicesSPI.h: Renamed from Source/WebCore/PAL/pal/spi/ios/LaunchServicesSPI.h.
* pal/spi/mac/HIServicesSPI.h:
* pal/spi/mac/NSCellSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/spi/mac/NSMenuSPI.h:
* pal/spi/mac/NSScrollViewSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/spi/mac/NSScrollerImpSPI.h:
* pal/system/cf/DefaultSearchProvider.cpp: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
(PAL::defaultSearchProviderDisplayName):
* pal/system/cf/DefaultSearchProvider.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/system/mac/PopupMenu.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
* pal/system/mac/PopupMenu.mm: Added.
(PAL::popUpMenu):

Source/WebKit:

* NetworkProcess/mac/NetworkProcessMac.mm:
(WebKit::NetworkProcess::initializeProcessName):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::initializeProcessName):
* StorageProcess/mac/StorageProcessMac.mm:
(WebKit::StorageProcess::initializeProcessName):
* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::trackingAreaOptions):
(WebKit::WebViewImpl::mightBeginScrollWhileInactive):
* UIProcess/mac/WebPopupMenuProxyMac.mm:
(WebKit::WebPopupMenuProxyMac::showPopupMenu):
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::popUpContextMenu):
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::handleContextMenuEvent):
* WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):
(WebKit::WebProcess::updateActivePages):

Source/WebKitLegacy/mac:

* DefaultDelegates/WebDefaultContextMenuDelegate.mm:
(-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]):
* Plugins/Hosted/NetscapePluginHostProxy.mm:
(WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
* WebCoreSupport/PopupMenuMac.mm:
(PopupMenuMac::show):
* WebCoreSupport/WebSystemInterface.mm:
(InitWebCoreSystemInterface):
* WebView/WebHTMLView.mm:
(-[WebHTMLView setDataSource:]):
(-[WebHTMLView attachRootLayer:]):
* WebView/WebView.mm:
(-[WebView _needsAdobeFrameReloadingQuirk]):
(-[WebView _needsLinkElementTextCSSQuirk]):
(-[WebView _needsIsLoadingInAPISenseQuirk]):
(-[WebView _needsFrameLoadDelegateRetainQuirk]):
(-[WebView _preferencesChanged:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222150 268f45cc-cd09-0410-ab3c-d52691b4dbfc

43 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Configurations/WebCore.xcconfig
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj
Source/WebCore/PAL/pal/PlatformMac.cmake
Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h
Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h [moved from Source/WebCore/PAL/pal/spi/ios/LaunchServicesSPI.h with 78% similarity]
Source/WebCore/PAL/pal/spi/mac/HIServicesSPI.h
Source/WebCore/PAL/pal/spi/mac/NSCellSPI.h [new file with mode: 0644]
Source/WebCore/PAL/pal/spi/mac/NSMenuSPI.h
Source/WebCore/PAL/pal/spi/mac/NSScrollViewSPI.h [new file with mode: 0644]
Source/WebCore/PAL/pal/spi/mac/NSScrollerImpSPI.h
Source/WebCore/PAL/pal/system/mac/DefaultSearchProvider.cpp [new file with mode: 0644]
Source/WebCore/PAL/pal/system/mac/DefaultSearchProvider.h [new file with mode: 0644]
Source/WebCore/PAL/pal/system/mac/PopupMenu.h [new file with mode: 0644]
Source/WebCore/PAL/pal/system/mac/PopupMenu.mm [new file with mode: 0644]
Source/WebCore/platform/cocoa/LocalizedStringsCocoa.mm
Source/WebCore/platform/cocoa/ScrollController.mm
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/mac/CursorMac.mm
Source/WebCore/platform/mac/WebCoreSystemInterface.h
Source/WebCore/platform/mac/WebCoreSystemInterface.mm
Source/WebCore/rendering/RenderThemeMac.mm
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/mac/NetworkProcessMac.mm
Source/WebKit/PluginProcess/mac/PluginProcessMac.mm
Source/WebKit/StorageProcess/mac/StorageProcessMac.mm
Source/WebKit/UIProcess/Cocoa/NavigationState.mm
Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm
Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm
Source/WebKit/UIProcess/mac/WebPopupMenuProxyMac.mm
Source/WebKit/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
Source/WebKit/WebProcess/Plugins/PDF/PDFPlugin.mm
Source/WebKit/WebProcess/WebCoreSupport/mac/WebSystemInterface.mm
Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/DefaultDelegates/WebDefaultContextMenuDelegate.mm
Source/WebKitLegacy/mac/Plugins/Hosted/NetscapePluginHostProxy.mm
Source/WebKitLegacy/mac/WebCoreSupport/PopupMenuMac.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
Source/WebKitLegacy/mac/WebCoreSupport/WebSystemInterface.mm
Source/WebKitLegacy/mac/WebView/WebHTMLView.mm
Source/WebKitLegacy/mac/WebView/WebView.mm

index b0a417e1b661bfe02998e6b68cc582311aab89df..ae35a9eb8fdb28af47413ff7267c7c0ba06d4266 100644 (file)
@@ -1,3 +1,32 @@
+2017-09-18  Andy Estes  <aestes@apple.com>
+
+        [Mac] Upstream miscellaneous WebKitSystemInterface functions
+        https://bugs.webkit.org/show_bug.cgi?id=177029
+
+        Reviewed by Alex Christensen.
+
+        * Configurations/WebCore.xcconfig: Used -force_load of libPAL instead of -ObjC. This forces
+        the linker to load both Objective-C and C PAL symbols in WebCore. This change is needed for
+        PAL::popUpMenu(), which is used by WebKit and WebKitLegacy but not WebCore.
+        * platform/cocoa/LocalizedStringsCocoa.mm:
+        (WebCore::contextMenuItemTagSearchWeb):
+        * platform/cocoa/ScrollController.mm:
+        (WebCore::elasticDeltaForTimeDelta):
+        (WebCore::elasticDeltaForReboundDelta):
+        (WebCore::reboundDeltaForElasticDelta):
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
+        * platform/mac/CursorMac.mm:
+        (WebCore::WKCoreCursor_coreCursorType):
+        (WebCore::createCoreCursorClass):
+        (WebCore::coreCursorClass):
+        (WebCore::cursor):
+        (WebCore::Cursor::ensurePlatformCursor const):
+        * platform/mac/WebCoreSystemInterface.h:
+        * platform/mac/WebCoreSystemInterface.mm:
+        * rendering/RenderThemeMac.mm:
+        (WebCore::RenderThemeMac::paintTextArea):
+
 2017-09-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
 
         [Win][PAL] Move WebCoreHeaderDetection.h to PAL
index 76667bae740471d745a9512205eb1cf49d7a3235..b03dd4ce8a236b73e8898e7f9dbd38f5facc82c4 100644 (file)
@@ -77,7 +77,7 @@ LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_NO = $(WEBCORE_FRAMEWORKS_DIR)
 LIBWEBRTC_LIBRARY_DIR_USE_OVERRIDE_FRAMEWORKS_DIR_YES = $(WK_OVERRIDE_FRAMEWORKS_DIR);
 
 OTHER_LDFLAGS = $(inherited) $(WK_RELOCATABLE_FRAMEWORK_LDFLAGS) $(WK_UNDEFINED_SYMBOLS_LDFLAGS) $(OTHER_LDFLAGS_PLATFORM);
-OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework CoreAudio -framework Metal -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -ObjC;
+OTHER_LDFLAGS_BASE = -lsqlite3 -lobjc -lANGLE -framework CoreAudio -framework Metal -allowable_client WebCoreTestSupport -allowable_client WebKitLegacy -force_load $(BUILT_PRODUCTS_DIR)/libPAL.a;
 // FIXME: Reduce the number of allowable_client <rdar://problem/31823969>
 OTHER_LDFLAGS_BASE_ios = $(OTHER_LDFLAGS_BASE) -framework CFNetwork -framework CoreGraphics -framework CoreText -framework Foundation -framework ImageIO -framework MobileCoreServices -framework OpenGLES -lMobileGestalt $(WK_IOS_BINCOMPAT_LDFLAGS) -allowable_client WebKit -allowable_client iTunesU -allowable_client Casablanca -allowable_client Remote -allowable_client TVBooks -allowable_client DumpRenderTree -allowable_client WebKitTestRunner -allowable_client TestWebKitAPI;
 OTHER_LDFLAGS_PLATFORM[sdk=iphoneos*] = $(OTHER_LDFLAGS_BASE_ios) -framework IOSurface -framework GraphicsServices $(LIBWEBRTC_LDFLAGS);
index 62995fa615a72561ac930211c6d04da403005a11..ff2a2d590ff8242c6a55c24ea045507c63b87c02 100644 (file)
@@ -1,3 +1,26 @@
+2017-09-18  Andy Estes  <aestes@apple.com>
+
+        [Mac] Upstream miscellaneous WebKitSystemInterface functions
+        https://bugs.webkit.org/show_bug.cgi?id=177029
+
+        Reviewed by Alex Christensen.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/PlatformMac.cmake:
+        * pal/spi/cf/CFUtilitiesSPI.h:
+        * pal/spi/cocoa/LaunchServicesSPI.h: Renamed from Source/WebCore/PAL/pal/spi/ios/LaunchServicesSPI.h.
+        * pal/spi/mac/HIServicesSPI.h:
+        * pal/spi/mac/NSCellSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
+        * pal/spi/mac/NSMenuSPI.h:
+        * pal/spi/mac/NSScrollViewSPI.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
+        * pal/spi/mac/NSScrollerImpSPI.h:
+        * pal/system/cf/DefaultSearchProvider.cpp: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
+        (PAL::defaultSearchProviderDisplayName):
+        * pal/system/cf/DefaultSearchProvider.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
+        * pal/system/mac/PopupMenu.h: Copied from Source/WebCore/PAL/pal/spi/cf/CFUtilitiesSPI.h.
+        * pal/system/mac/PopupMenu.mm: Added.
+        (PAL::popUpMenu):
+
 2017-09-18  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
 
         [Win][PAL] Move WebCoreHeaderDetection.h to PAL
index cab14cd4a7fdb1b7ef4eb855dda9aead5ea8c49b..f33c8d196f0c6ff2fd5b90a811304e04c90d1a13 100644 (file)
                A10826FA1F576292004772AC /* WebPanel.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10826F81F576292004772AC /* WebPanel.mm */; };
                A10826FE1F58A433004772AC /* NSGraphicsSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A10826FD1F58A433004772AC /* NSGraphicsSPI.h */; };
                A1175B491F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */; };
+               A1175B4B1F6B2D7E00C4B9F0 /* NSCellSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */; };
+               A1175B4E1F6B337300C4B9F0 /* PopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */; };
+               A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */ = {isa = PBXBuildFile; fileRef = A1175B4D1F6B337300C4B9F0 /* PopupMenu.mm */; };
+               A1175B571F6B470500C4B9F0 /* DefaultSearchProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B551F6B470500C4B9F0 /* DefaultSearchProvider.h */; };
+               A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A1175B561F6B470500C4B9F0 /* DefaultSearchProvider.cpp */; };
+               A1175B5A1F6B4A8400C4B9F0 /* NSScrollViewSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */; };
                A1F55DCF1F5528EC00EDB75F /* MetadataSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */; };
                A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = A30D411E1F0DD0EA00B71954 /* KillRing.h */; };
                A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A30D411F1F0DD0EA00B71954 /* KillRing.cpp */; };
                A10826F81F576292004772AC /* WebPanel.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebPanel.mm; sourceTree = "<group>"; };
                A10826FD1F58A433004772AC /* NSGraphicsSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSGraphicsSPI.h; sourceTree = "<group>"; };
                A1175B481F6AFF8E00C4B9F0 /* SpeechSynthesisSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SpeechSynthesisSPI.h; sourceTree = "<group>"; };
+               A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSCellSPI.h; sourceTree = "<group>"; };
+               A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PopupMenu.h; sourceTree = "<group>"; };
+               A1175B4D1F6B337300C4B9F0 /* PopupMenu.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PopupMenu.mm; sourceTree = "<group>"; };
+               A1175B551F6B470500C4B9F0 /* DefaultSearchProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DefaultSearchProvider.h; sourceTree = "<group>"; };
+               A1175B561F6B470500C4B9F0 /* DefaultSearchProvider.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DefaultSearchProvider.cpp; sourceTree = "<group>"; };
+               A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSScrollViewSPI.h; sourceTree = "<group>"; };
                A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MetadataSPI.h; sourceTree = "<group>"; };
                A30D411E1F0DD0EA00B71954 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
                A30D411F1F0DD0EA00B71954 /* KillRing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KillRing.cpp; sourceTree = "<group>"; };
                                0C2DA1281F3BEB4900DBC317 /* IOReturnSPI.h */,
                                0C2DA1291F3BEB4900DBC317 /* IOSurfaceSPI.h */,
                                0C2DA12A1F3BEB4900DBC317 /* IOTypesSPI.h */,
+                               0C5AF9121F43A4C7002EAC02 /* LaunchServicesSPI.h */,
                                0C2DA12B1F3BEB4900DBC317 /* LinkPresentationSPI.h */,
                                0C2DA12C1F3BEB4900DBC317 /* MachVMSPI.h */,
                                0C2DA12D1F3BEB4900DBC317 /* NEFilterSourceSPI.h */,
                                0C5AF90F1F43A4C7002EAC02 /* CoreUISPI.h */,
                                0C5AF9101F43A4C7002EAC02 /* DataDetectorsUISPI.h */,
                                0C5AF9111F43A4C7002EAC02 /* GraphicsServicesSPI.h */,
-                               0C5AF9121F43A4C7002EAC02 /* LaunchServicesSPI.h */,
                                0C5AF9131F43A4C7002EAC02 /* MediaPlayerSPI.h */,
                                0C5AF9141F43A4C7002EAC02 /* MobileGestaltSPI.h */,
                                0C5AF9151F43A4C7002EAC02 /* OpenGLESSPI.h */,
                                A1F55DCE1F5528EC00EDB75F /* MetadataSPI.h */,
                                0C7785741F45130F00F4EBB6 /* NSAccessibilitySPI.h */,
                                0C7785751F45130F00F4EBB6 /* NSApplicationSPI.h */,
+                               A1175B4A1F6B2D7E00C4B9F0 /* NSCellSPI.h */,
                                0C7785761F45130F00F4EBB6 /* NSEventSPI.h */,
                                0C7785771F45130F00F4EBB6 /* NSFontSPI.h */,
                                A10826FD1F58A433004772AC /* NSGraphicsSPI.h */,
                                0C77857C1F45130F00F4EBB6 /* NSScrollerImpSPI.h */,
                                0C77857D1F45130F00F4EBB6 /* NSScrollingInputFilterSPI.h */,
                                0C77857E1F45130F00F4EBB6 /* NSScrollingMomentumCalculatorSPI.h */,
+                               A1175B591F6B4A8400C4B9F0 /* NSScrollViewSPI.h */,
                                0C77857F1F45130F00F4EBB6 /* NSSharingServicePickerSPI.h */,
                                0C7785801F45130F00F4EBB6 /* NSSharingServiceSPI.h */,
                                0C7785811F45130F00F4EBB6 /* NSSpellCheckerSPI.h */,
                A3788EA01F05B7E200679425 /* mac */ = {
                        isa = PBXGroup;
                        children = (
+                               A1175B561F6B470500C4B9F0 /* DefaultSearchProvider.cpp */,
+                               A1175B551F6B470500C4B9F0 /* DefaultSearchProvider.h */,
+                               A1175B4C1F6B337300C4B9F0 /* PopupMenu.h */,
+                               A1175B4D1F6B337300C4B9F0 /* PopupMenu.mm */,
                                A3788E9D1F05B78E00679425 /* SoundMac.mm */,
                                A3AB6E621F3D217F009C14B1 /* SystemSleepListenerMac.h */,
                                A3AB6E631F3D217F009C14B1 /* SystemSleepListenerMac.mm */,
                                0C2DA1411F3BEB4900DBC317 /* DataDetectorsCoreSPI.h in Headers */,
                                0C77858A1F45130F00F4EBB6 /* DataDetectorsSPI.h in Headers */,
                                0C5AF91A1F43A4C7002EAC02 /* DataDetectorsUISPI.h in Headers */,
+                               A1175B571F6B470500C4B9F0 /* DefaultSearchProvider.h in Headers */,
                                0C2D9E731EEF5AF600DBC317 /* ExportMacros.h in Headers */,
                                A10265871F56746100B4C844 /* FoundationSPI.h in Headers */,
                                0C5AF91B1F43A4C7002EAC02 /* GraphicsServicesSPI.h in Headers */,
                                0C2DA14A1F3BEB4900DBC317 /* NSAttributedStringSPI.h in Headers */,
                                0C2DA14B1F3BEB4900DBC317 /* NSButtonCellSPI.h in Headers */,
                                0C2DA14C1F3BEB4900DBC317 /* NSCalendarDateSPI.h in Headers */,
+                               A1175B4B1F6B2D7E00C4B9F0 /* NSCellSPI.h in Headers */,
                                0C2DA14D1F3BEB4900DBC317 /* NSColorSPI.h in Headers */,
                                0C77858F1F45130F00F4EBB6 /* NSEventSPI.h in Headers */,
                                0C2DA14E1F3BEB4900DBC317 /* NSExtensionSPI.h in Headers */,
                                0C7785951F45130F00F4EBB6 /* NSScrollerImpSPI.h in Headers */,
                                0C7785961F45130F00F4EBB6 /* NSScrollingInputFilterSPI.h in Headers */,
                                0C7785971F45130F00F4EBB6 /* NSScrollingMomentumCalculatorSPI.h in Headers */,
+                               A1175B5A1F6B4A8400C4B9F0 /* NSScrollViewSPI.h in Headers */,
                                0C7785981F45130F00F4EBB6 /* NSSharingServicePickerSPI.h in Headers */,
                                0C7785991F45130F00F4EBB6 /* NSSharingServiceSPI.h in Headers */,
                                0C77859A1F45130F00F4EBB6 /* NSSpellCheckerSPI.h in Headers */,
                                0C5AF91F1F43A4C7002EAC02 /* OpenGLESSPI.h in Headers */,
                                0C2DA1551F3BEB4900DBC317 /* PassKitSPI.h in Headers */,
                                0C77859E1F45130F00F4EBB6 /* PIPSPI.h in Headers */,
+                               A1175B4E1F6B337300C4B9F0 /* PopupMenu.h in Headers */,
                                0C2DA1561F3BEB4900DBC317 /* pthreadSPI.h in Headers */,
                                0C77859F1F45130F00F4EBB6 /* QTKitSPI.h in Headers */,
                                0C2DA1571F3BEB4900DBC317 /* QuartzCoreSPI.h in Headers */,
                        buildActionMask = 2147483647;
                        files = (
                                1C09D0561E31C46500725F18 /* CryptoDigestCommonCrypto.cpp in Sources */,
+                               A1175B581F6B470500C4B9F0 /* DefaultSearchProvider.cpp in Sources */,
                                A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */,
                                A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */,
+                               A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,
                                A3C66CDC1F462D6A009E6EE9 /* SessionID.cpp in Sources */,
                                A3AB6E521F3D1DC5009C14B1 /* SleepDisabler.cpp in Sources */,
                                A3AB6E601F3D1E39009C14B1 /* SleepDisablerCocoa.cpp in Sources */,
index d873d7229716edf334df4b5100db6ea35bc82f6b..9d57ff784fc1dd11493623d6536fc38bf7576b6b 100644 (file)
@@ -3,6 +3,8 @@ list(APPEND PAL_SOURCES
 
     system/cocoa/SleepDisablerCocoa.cpp
 
+    system/mac/DefaultSearchProvider.cpp
+    system/mac/PopupMenu.mm
     system/mac/SoundMac.mm
     system/mac/SystemSleepListenerMac.mm
     system/mac/WebPanel.mm
index fc8cd792762bf0a7620a12acf120fa309a378ffc..5a63a470c594f18b9d7367489ba44560d89793c0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #pragma once
 
-#include <CoreFoundation/CoreFoundation.h>
-
 #if USE(APPLE_INTERNAL_SDK)
+
 #import <CoreFoundation/CFPriv.h>
+
+#else
+
+#include <CoreFoundation/CoreFoundation.h>
+
+typedef CF_ENUM(CFIndex, CFSystemVersion) {
+    CFSystemVersionLion = 7,
+    CFSystemVersionMountainLion = 8,
+};
+
 #endif
 
 WTF_EXTERN_C_BEGIN
 
-CFDictionaryRef _CFCopySystemVersionDictionary(void);
-extern const CFStringRef _kCFSystemVersionProductVersionKey;
+extern const CFStringRef kCFWebServicesProviderDefaultDisplayNameKey;
+extern const CFStringRef kCFWebServicesTypeWebSearch;
 extern const CFStringRef _kCFSystemVersionBuildVersionKey;
+extern const CFStringRef _kCFSystemVersionProductVersionKey;
 
-WTF_EXTERN_C_END
+Boolean _CFAppVersionCheckLessThan(CFStringRef bundleID, int linkedOnAnOlderSystemThan, double versionNumberLessThan);
+Boolean _CFExecutableLinkedOnOrAfter(CFSystemVersion);
+CFDictionaryRef _CFCopySystemVersionDictionary();
+CFDictionaryRef _CFWebServicesCopyProviderInfo(CFStringRef serviceType, Boolean* outIsUserSelection);
 
+WTF_EXTERN_C_END
similarity index 78%
rename from Source/WebCore/PAL/pal/spi/ios/LaunchServicesSPI.h
rename to Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h
index e6a8b2e4fcbee1511e8c0c43b7abd57852281823..712bcfcf11fd97050da36dfb85a61f1fe16f8067 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #if USE(APPLE_INTERNAL_SDK)
 
+#if PLATFORM(MAC)
+#import <LaunchServices/LaunchServicesPriv.h>
+#elif PLATFORM(IOS)
 #import <MobileCoreServices/LSAppLinkPriv.h>
+#endif
 
 #endif
 
@@ -59,4 +63,26 @@ typedef void (^LSAppLinkOpenCompletionHandler)(BOOL success, NSError *error);
 @property (readonly, strong) LSApplicationProxy *targetApplicationProxy;
 @end
 
+#if PLATFORM(MAC)
+enum LSSessionID {
+    kLSDefaultSessionID = -2,
+};
 #endif
+
+#endif // !USE(APPLE_INTERNAL_SDK)
+
+#if PLATFORM(MAC)
+
+typedef const struct CF_BRIDGED_TYPE(id) __LSASN* LSASNRef;
+typedef enum LSSessionID LSSessionID;
+
+WTF_EXTERN_C_BEGIN
+
+extern const CFStringRef _kLSDisplayNameKey;
+
+LSASNRef _LSGetCurrentApplicationASN();
+OSStatus _LSSetApplicationInformationItem(LSSessionID, LSASNRef, CFStringRef keyToSetRef, CFTypeRef valueToSetRef, CFDictionaryRef* newInformationDictRef);
+
+WTF_EXTERN_C_END
+
+#endif // PLATFORM(MAC)
index a355b94fe63092ef5acd0b5c95e03dd46e953815..aad4349b9f5805afd57746659947b00a6832f4b6 100644 (file)
 
 #pragma once
 
+#include <pal/spi/cg/CoreGraphicsSPI.h>
+
 #if USE(APPLE_INTERNAL_SDK)
 
 #include <HIServices/AXTextMarker.h>
+#include <HIServices/CoreCursor.h>
 #include <HIServices/CoreDrag.h>
 
 #else
 
+typedef CF_ENUM(SInt32, CoreCursorType) {
+    kCoreCursorFirstCursor = 0,
+    kCoreCursorArrow = kCoreCursorFirstCursor,
+    kCoreCursorIBeam,
+    kCoreCursorMakeAlias,
+    kCoreCursorNotAllowed,
+    kCoreCursorBusyButClickable,
+    kCoreCursorCopy,
+    kCoreCursorScreenShotSelection = 7,
+    kCoreCursorScreenShotSelectionToClip,
+    kCoreCursorScreenShotWindow,
+    kCoreCursorScreenShotWindowToClip,
+    kCoreCursorClosedHand,
+    kCoreCursorOpenHand,
+    kCoreCursorPointingHand,
+    kCoreCursorCountingUpHand,
+    kCoreCursorCountingDownHand,
+    kCoreCursorCountingUpAndDownHand,
+    kCoreCursorResizeLeft,
+    kCoreCursorResizeRight,
+    kCoreCursorResizeLeftRight,
+    kCoreCursorCross,
+    kCoreCursorResizeUp,
+    kCoreCursorResizeDown,
+    kCoreCursorResizeUpDown,
+    kCoreCursorContextualMenu,
+    kCoreCursorPoof,
+    kCoreCursorIBeamVertical,
+    kCoreCursorWindowResizeEast,
+    kCoreCursorWindowResizeEastWest,
+    kCoreCursorWindowResizeNorthEast,
+    kCoreCursorWindowResizeNorthEastSouthWest,
+    kCoreCursorWindowResizeNorth,
+    kCoreCursorWindowResizeNorthSouth,
+    kCoreCursorWindowResizeNorthWest,
+    kCoreCursorWindowResizeNorthWestSouthEast,
+    kCoreCursorWindowResizeSouthEast,
+    kCoreCursorWindowResizeSouth,
+    kCoreCursorWindowResizeSouthWest,
+    kCoreCursorWindowResizeWest,
+    kCoreCursorWindowMove,
+    kCoreCursorHelp,
+    kCoreCursorCell,
+    kCoreCursorZoomIn,
+    kCoreCursorZoomOut,
+    kCoreCursorLastCursor = kCoreCursorZoomOut
+};
+
 enum {
     kCoreDragImageSpecVersionOne = 1,
 };
@@ -51,6 +102,7 @@ struct CoreDragImageSpec {
 
 #endif
 
+typedef UInt32 MSHCreateOptions;
 typedef const struct __AXTextMarker* AXTextMarkerRef;
 typedef const struct __AXTextMarkerRange* AXTextMarkerRangeRef;
 typedef struct CoreDragImageSpec CoreDragImageSpec;
@@ -63,6 +115,7 @@ AXTextMarkerRef AXTextMarkerCreate(CFAllocatorRef, const UInt8* bytes, CFIndex l
 AXTextMarkerRef AXTextMarkerRangeCopyStartMarker(AXTextMarkerRangeRef);
 AXTextMarkerRef AXTextMarkerRangeCopyEndMarker(AXTextMarkerRangeRef);
 CFIndex AXTextMarkerGetLength(AXTextMarkerRef);
+CFRunLoopSourceRef MSHCreateMIGServerSource(CFAllocatorRef, CFIndex order, mig_subsystem_t sub_system, MSHCreateOptions, mach_port_t, void* user_data);
 CFTypeID AXTextMarkerGetTypeID();
 CFTypeID AXTextMarkerRangeGetTypeID();
 CoreDragRef CoreDragGetCurrentDrag();
diff --git a/Source/WebCore/PAL/pal/spi/mac/NSCellSPI.h b/Source/WebCore/PAL/pal/spi/mac/NSCellSPI.h
new file mode 100644 (file)
index 0000000..fa33da3
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSCell_Private.h>
+
+#endif
+
+WTF_EXTERN_C_BEGIN
+
+void _NSDrawCarbonThemeListBox(NSRect, BOOL enabled, BOOL flipped, BOOL textured);
+
+WTF_EXTERN_C_END
index 1f5e7bc66a003219482204c4819941ed3b4fa5ff..50d509c5053a82ce709c627912409ddeb748f3ab 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -29,7 +29,9 @@
 
 #if USE(APPLE_INTERNAL_SDK)
 
+WTF_EXTERN_C_BEGIN
 #import <AppKit/NSMenu_Private.h>
+WTF_EXTERN_C_END
 
 #else
 
@@ -38,6 +40,17 @@ typedef NS_ENUM(NSInteger, NSMenuType) {
     NSMenuTypeContextMenu,
 };
 
+enum {
+    NSPopUpMenuTypeGeneric,
+    NSPopUpMenuTypePopUp,
+    NSPopUpMenuTypePullsDown,
+    NSPopUpMenuTypeMainMenu,
+    NSPopUpMenuTypeContext,
+    NSPopUpMenuDefaultToPopUpControlFont = 0x10,
+    NSPopUpMenuPositionRelativeToRightEdge = 0x20,
+    NSPopUpMenuIsPopupButton = 0x40,
+};
+
 @interface NSMenu ()
 + (NSMenuType)menuTypeForEvent:(NSEvent *)event;
 @end
@@ -56,4 +69,17 @@ typedef NS_ENUM(NSInteger, NSMenuType) {
 
 #endif
 
-#endif
+typedef NSUInteger NSPopUpMenuFlags;
+
+WTF_EXTERN_C_BEGIN
+
+extern NSString * const NSPopUpMenuPopupButtonBounds;
+extern NSString * const NSPopUpMenuPopupButtonLabelOffset;
+extern NSString * const NSPopUpMenuPopupButtonSize;
+extern NSString * const NSPopUpMenuPopupButtonWidget;
+
+void _NSPopUpCarbonMenu3(NSMenu *, NSWindow *, NSView *ownerView, NSPoint screenPoint, NSInteger checkedItem, NSFont *, CGFloat minWidth, NSString *runLoopMode, NSPopUpMenuFlags, NSDictionary *options);
+
+WTF_EXTERN_C_END
+
+#endif // PLATFORM(MAC)
diff --git a/Source/WebCore/PAL/pal/spi/mac/NSScrollViewSPI.h b/Source/WebCore/PAL/pal/spi/mac/NSScrollViewSPI.h
new file mode 100644 (file)
index 0000000..df5b497
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if USE(APPLE_INTERNAL_SDK)
+
+#import <AppKit/NSScrollView_Private.h>
+
+#endif
+
+WTF_EXTERN_C_BEGIN
+
+CGFloat _NSElasticDeltaForReboundDelta(CGFloat delta);
+CGFloat _NSElasticDeltaForTimeDelta(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
+CGFloat _NSReboundDeltaForElasticDelta(CGFloat delta);
+
+WTF_EXTERN_C_END
index 0492c1ab61956cb1961c9ea7b2771573781d5533..1870496e07c20f2eb9ab5afad71e9db1dad1a2f4 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -149,4 +149,10 @@ typedef NSUInteger NSOverlayScrollerState;
 
 #endif
 
+WTF_EXTERN_C_BEGIN
+
+NSScrollerStyle _NSRecommendedScrollerStyle();
+
+WTF_EXTERN_C_END
+
 #endif // USE(APPKIT)
diff --git a/Source/WebCore/PAL/pal/system/mac/DefaultSearchProvider.cpp b/Source/WebCore/PAL/pal/system/mac/DefaultSearchProvider.cpp
new file mode 100644 (file)
index 0000000..9516d6a
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2017 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 "DefaultSearchProvider.h"
+
+#if PLATFORM(MAC)
+
+#include "CFUtilitiesSPI.h"
+#include <CoreFoundation/CoreFoundation.h>
+
+namespace PAL {
+
+RetainPtr<CFStringRef> defaultSearchProviderDisplayName()
+{
+    auto providerInfo = adoptCF(_CFWebServicesCopyProviderInfo(kCFWebServicesTypeWebSearch, nullptr));
+    if (!providerInfo)
+        return CFSTR("Google");
+
+    CFTypeRef displayName = CFDictionaryGetValue(providerInfo.get(), kCFWebServicesProviderDefaultDisplayNameKey);
+    if (!displayName)
+        return CFSTR("Google");
+
+    ASSERT(CFGetTypeID(displayName) == CFStringGetTypeID());
+    return adoptCF(CFStringCreateCopy(kCFAllocatorDefault, (CFStringRef)displayName));
+}
+
+} // namespace PAL
+
+#endif // PLATFORM(MAC)
diff --git a/Source/WebCore/PAL/pal/system/mac/DefaultSearchProvider.h b/Source/WebCore/PAL/pal/system/mac/DefaultSearchProvider.h
new file mode 100644 (file)
index 0000000..fcfcfd8
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2017 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <wtf/RetainPtr.h>
+
+namespace PAL {
+
+PAL_EXPORT RetainPtr<CFStringRef> defaultSearchProviderDisplayName();
+
+}
diff --git a/Source/WebCore/PAL/pal/system/mac/PopupMenu.h b/Source/WebCore/PAL/pal/system/mac/PopupMenu.h
new file mode 100644 (file)
index 0000000..8475ab7
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+#if PLATFORM(MAC)
+
+#import <AppKit/AppKit.h>
+
+namespace PAL {
+
+PAL_EXPORT void popUpMenu(NSMenu *, NSPoint location, float width, NSView *, int selectedItem, NSFont *, NSControlSize, bool usesCustomAppearance);
+
+}
+
+#endif // PLATFORM(MAC)
diff --git a/Source/WebCore/PAL/pal/system/mac/PopupMenu.mm b/Source/WebCore/PAL/pal/system/mac/PopupMenu.mm
new file mode 100644 (file)
index 0000000..2233575
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2017 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 "PopupMenu.h"
+
+#if PLATFORM(MAC)
+
+#import "NSMenuSPI.h"
+#import <wtf/RetainPtr.h>
+
+@interface NSMenu (WebPrivate)
+- (id)_menuImpl;
+@end
+
+@interface NSObject (WebPrivate)
+- (void)popUpMenu:(NSMenu*)menu atLocation:(NSPoint)location width:(CGFloat)width forView:(NSView*)view withSelectedItem:(NSInteger)selectedItem withFont:(NSFont*)font withFlags:(NSPopUpMenuFlags)flags withOptions:(NSDictionary *)options;
+@end
+
+namespace PAL {
+
+void popUpMenu(NSMenu *menu, NSPoint location, float width, NSView *view, int selectedItem, NSFont *font, NSControlSize controlSize, bool usesCustomAppearance)
+{
+    NSRect adjustedPopupBounds = [view.window convertRectToScreen:[view convertRect:view.bounds toView:nil]];
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    if (controlSize != NSMiniControlSize) {
+#pragma clang diagnostic pop
+        adjustedPopupBounds.origin.x -= 3;
+        adjustedPopupBounds.origin.y -= 1;
+        adjustedPopupBounds.size.width += 6;
+    }
+
+    // These numbers were extracted from visual inspection as the menu animates shut.
+    NSSize labelOffset = NSMakeSize(11, 1);
+    if (menu.userInterfaceLayoutDirection == NSUserInterfaceLayoutDirectionRightToLeft)
+        labelOffset = NSMakeSize(24, 1);
+
+    auto options = adoptNS([@{
+        NSPopUpMenuPopupButtonBounds : [NSValue valueWithRect:adjustedPopupBounds],
+        NSPopUpMenuPopupButtonLabelOffset : [NSValue valueWithSize:labelOffset],
+        NSPopUpMenuPopupButtonSize : @(controlSize)
+    } mutableCopy]);
+
+    if (usesCustomAppearance)
+        [options setObject:@"" forKey:NSPopUpMenuPopupButtonWidget];
+
+    [[menu _menuImpl] popUpMenu:menu atLocation:location width:width forView:view withSelectedItem:selectedItem withFont:font withFlags:(usesCustomAppearance ? 0 : NSPopUpMenuIsPopupButton) withOptions:options.get()];
+}
+
+} // namespace PAL
+
+#endif // PLATFORM(MAC)
index 129b6e2d50d5216db5a468766c14fd82ea53bc77..12dd8a78ef4211d51b57fe0e81be40fe30ca2f8c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011, 2012 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "LocalizedStrings.h"
+#import "config.h"
+#import "LocalizedStrings.h"
 
-#include "NotImplemented.h"
-#include "WebCoreSystemInterface.h"
-#include <wtf/Assertions.h>
-#include <wtf/MainThread.h>
-#include <wtf/RetainPtr.h>
-#include <wtf/text/WTFString.h>
+#import "NotImplemented.h"
+#import "WebCoreSystemInterface.h"
+#import <pal/system/mac/DefaultSearchProvider.h>
+#import <wtf/Assertions.h>
+#import <wtf/MainThread.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/text/WTFString.h>
 
 namespace WebCore {
 
@@ -66,7 +67,7 @@ String contextMenuItemTagSearchInSpotlight()
 
 String contextMenuItemTagSearchWeb()
 {
-    auto searchProviderName = adoptCF(wkCopyDefaultSearchProviderDisplayName());
+    auto searchProviderName = PAL::defaultSearchProviderDisplayName();
     return formatLocalizedString(WEB_UI_STRING("Search with %@", "Search with search provider context menu item with provider name inserted"), searchProviderName.get());
 }
 
index ee3e537fb8c2b6870e61dfd2397607ec7f1f4b1a..d379e2474d166654a4c129cccb0f1ede3e6325e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011, 2014-2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2011-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "config.h"
-#include "ScrollController.h"
+#import "config.h"
+#import "ScrollController.h"
 
-#include "LayoutSize.h"
-#include "PlatformWheelEvent.h"
-#include "WebCoreSystemInterface.h"
-#include "WheelEventTestTrigger.h"
-#include <sys/sysctl.h>
-#include <sys/time.h>
-#include <wtf/CurrentTime.h>
+#import "LayoutSize.h"
+#import "PlatformWheelEvent.h"
+#import "WebCoreSystemInterface.h"
+#import "WheelEventTestTrigger.h"
+#import <sys/sysctl.h>
+#import <sys/time.h>
+#import <wtf/CurrentTime.h>
 
 #if ENABLE(CSS_SCROLL_SNAP)
-#include "ScrollSnapAnimatorState.h"
-#include "ScrollableArea.h"
+#import "ScrollSnapAnimatorState.h"
+#import "ScrollableArea.h"
+#endif
+
+#if PLATFORM(MAC)
+#import <pal/spi/mac/NSScrollViewSPI.h>
 #endif
 
 #if ENABLE(RUBBER_BANDING) || ENABLE(CSS_SCROLL_SNAP)
@@ -52,17 +56,17 @@ static const float rubberbandMinimumRequiredDeltaBeforeStretch = 10;
 #if PLATFORM(MAC)
 static float elasticDeltaForTimeDelta(float initialPosition, float initialVelocity, float elapsedTime)
 {
-    return wkNSElasticDeltaForTimeDelta(initialPosition, initialVelocity, elapsedTime);
+    return _NSElasticDeltaForTimeDelta(initialPosition, initialVelocity, elapsedTime);
 }
 
 static float elasticDeltaForReboundDelta(float delta)
 {
-    return wkNSElasticDeltaForReboundDelta(delta);
+    return _NSElasticDeltaForReboundDelta(delta);
 }
 
 static float reboundDeltaForElasticDelta(float delta)
 {
-    return wkNSReboundDeltaForElasticDelta(delta);
+    return _NSReboundDeltaForElasticDelta(delta);
 }
 
 static float scrollWheelMultiplier()
index f425797010dca23770b8fe4605bc49b0f4d608a0..c6946d6dfd3bce3a1f8624a394bc6869d7d2c3dd 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -24,7 +24,6 @@
  */
 
 #include "config.h"
-
 #include "GraphicsLayerCA.h"
 
 #if USE(CA)
@@ -47,6 +46,7 @@
 #include "TranslateTransformOperation.h"
 #include <QuartzCore/CATransform3D.h>
 #include <limits.h>
+#include <pal/spi/cf/CFUtilitiesSPI.h>
 #include <wtf/CurrentTime.h>
 #include <wtf/MathExtras.h>
 #include <wtf/NeverDestroyed.h>
@@ -2988,7 +2988,7 @@ bool GraphicsLayerCA::createTransformAnimationsFromKeyframes(const KeyframeValue
         // on or before Snow Leopard.
         // FIXME: This fix has not been added to QuartzCore on Windows yet (<rdar://problem/9112233>) so we expect the
         // reversed animation behavior
-        static bool executableWasLinkedOnOrBeforeSnowLeopard = wkExecutableWasLinkedOnOrBeforeSnowLeopard();
+        static bool executableWasLinkedOnOrBeforeSnowLeopard = !_CFExecutableLinkedOnOrAfter(CFSystemVersionLion);
         if (!executableWasLinkedOnOrBeforeSnowLeopard)
             reverseAnimationList = false;
 #endif
index aa345e88e48118c4687b9eefbfc73218dc47070c..2fe5a43298f6eaafe09c82a6b8f54add240b4991 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2006, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2004-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -27,6 +27,8 @@
 #import "Cursor.h"
 
 #import "WebCoreSystemInterface.h"
+#import <objc/runtime.h>
+#import <pal/spi/mac/HIServicesSPI.h>
 #import <wtf/BlockObjCExceptions.h>
 #import <wtf/StdLibExtras.h>
 
 @end
 
 namespace WebCore {
+    
+static NSCursor *busyButClickableNSCursor;
+static NSCursor *makeAliasNSCursor;
+static NSCursor *moveNSCursor;
+static NSCursor *resizeEastNSCursor;
+static NSCursor *resizeEastWestNSCursor;
+static NSCursor *resizeNorthNSCursor;
+static NSCursor *resizeNorthSouthNSCursor;
+static NSCursor *resizeNortheastNSCursor;
+static NSCursor *resizeNortheastSouthwestNSCursor;
+static NSCursor *resizeNorthwestNSCursor;
+static NSCursor *resizeNorthwestSoutheastNSCursor;
+static NSCursor *resizeSouthNSCursor;
+static NSCursor *resizeSoutheastNSCursor;
+static NSCursor *resizeSouthwestNSCursor;
+static NSCursor *resizeWestNSCursor;
+
+static NSCursor *cellNSCursor;
+static NSCursor *helpNSCursor;
+static NSCursor *zoomInNSCursor;
+static NSCursor *zoomOutNSCursor;
+
+static NSInteger WKCoreCursor_coreCursorType(id self, SEL)
+{
+    if (self == busyButClickableNSCursor)
+        return kCoreCursorBusyButClickable;
+    if (self == makeAliasNSCursor)
+        return kCoreCursorMakeAlias;
+    if (self == moveNSCursor)
+        return kCoreCursorWindowMove;
+    if (self == resizeEastNSCursor)
+        return kCoreCursorWindowResizeEast;
+    if (self == resizeEastWestNSCursor)
+        return kCoreCursorWindowResizeEastWest;
+    if (self == resizeNorthNSCursor)
+        return kCoreCursorWindowResizeNorth;
+    if (self == resizeNorthSouthNSCursor)
+        return kCoreCursorWindowResizeNorthSouth;
+    if (self == resizeNortheastNSCursor)
+        return kCoreCursorWindowResizeNorthEast;
+    if (self == resizeNortheastSouthwestNSCursor)
+        return kCoreCursorWindowResizeNorthEastSouthWest;
+    if (self == resizeNorthwestNSCursor)
+        return kCoreCursorWindowResizeNorthWest;
+    if (self == resizeNorthwestSoutheastNSCursor)
+        return kCoreCursorWindowResizeNorthWestSouthEast;
+    if (self == resizeSouthNSCursor)
+        return kCoreCursorWindowResizeSouth;
+    if (self == resizeSoutheastNSCursor)
+        return kCoreCursorWindowResizeSouthEast;
+    if (self == resizeSouthwestNSCursor)
+        return kCoreCursorWindowResizeSouthWest;
+    if (self == resizeWestNSCursor)
+        return kCoreCursorWindowResizeWest;
+    if (self == cellNSCursor)
+        return kCoreCursorCell;
+    if (self == helpNSCursor)
+        return kCoreCursorHelp;
+    if (self == zoomInNSCursor)
+        return kCoreCursorZoomIn;
+    if (self == zoomOutNSCursor)
+        return kCoreCursorZoomOut;
+    
+    return NSNotFound;
+}
+
+static Class createCoreCursorClass()
+{
+    Class coreCursorClass = objc_allocateClassPair([NSCursor class], "WKCoreCursor", 0);
+    SEL coreCursorType = NSSelectorFromString(@"_coreCursorType");
+    class_addMethod(coreCursorClass, coreCursorType, (IMP)WKCoreCursor_coreCursorType, method_getTypeEncoding(class_getInstanceMethod([NSCursor class], coreCursorType)));
+    objc_registerClassPair(coreCursorClass);
+    return coreCursorClass;
+}
+
+static Class coreCursorClass()
+{
+    Class coreCursorClass = objc_lookUpClass("WKCoreCursor");
+    if (!coreCursorClass)
+        coreCursorClass = createCoreCursorClass();
+    return coreCursorClass;
+}
+
+static NSCursor *cursor(const char *name)
+{
+    NSCursor **slot = 0;
+    
+    if (!strcmp(name, "BusyButClickable"))
+        slot = &busyButClickableNSCursor;
+    else if (!strcmp(name, "MakeAlias"))
+        slot = &makeAliasNSCursor;
+    else if (!strcmp(name, "Move"))
+        slot = &moveNSCursor;
+    else if (!strcmp(name, "ResizeEast"))
+        slot = &resizeEastNSCursor;
+    else if (!strcmp(name, "ResizeEastWest"))
+        slot = &resizeEastWestNSCursor;
+    else if (!strcmp(name, "ResizeNorth"))
+        slot = &resizeNorthNSCursor;
+    else if (!strcmp(name, "ResizeNorthSouth"))
+        slot = &resizeNorthSouthNSCursor;
+    else if (!strcmp(name, "ResizeNortheast"))
+        slot = &resizeNortheastNSCursor;
+    else if (!strcmp(name, "ResizeNortheastSouthwest"))
+        slot = &resizeNortheastSouthwestNSCursor;
+    else if (!strcmp(name, "ResizeNorthwest"))
+        slot = &resizeNorthwestNSCursor;
+    else if (!strcmp(name, "ResizeNorthwestSoutheast"))
+        slot = &resizeNorthwestSoutheastNSCursor;
+    else if (!strcmp(name, "ResizeSouth"))
+        slot = &resizeSouthNSCursor;
+    else if (!strcmp(name, "ResizeSoutheast"))
+        slot = &resizeSoutheastNSCursor;
+    else if (!strcmp(name, "ResizeSouthwest"))
+        slot = &resizeSouthwestNSCursor;
+    else if (!strcmp(name, "ResizeWest"))
+        slot = &resizeWestNSCursor;
+    else if (!strcmp(name, "Cell"))
+        slot = &cellNSCursor;
+    else if (!strcmp(name, "Help"))
+        slot = &helpNSCursor;
+    else if (!strcmp(name, "ZoomIn"))
+        slot = &zoomInNSCursor;
+    else if (!strcmp(name, "ZoomOut"))
+        slot = &zoomOutNSCursor;
+    
+    if (!slot)
+        return nil;
+    
+    if (!*slot)
+        *slot = [[coreCursorClass() alloc] init];
+    return *slot;
+}
 
 // Simple NSCursor calls shouldn't need protection,
 // but creating a cursor with a bad image might throw.
@@ -103,72 +238,72 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::Wait:
-        m_platformCursor = wkCursor("BusyButClickable");
+        m_platformCursor = cursor("BusyButClickable");
         break;
 
     case Cursor::Help:
-        m_platformCursor = wkCursor("Help");
+        m_platformCursor = cursor("Help");
         break;
 
     case Cursor::Move:
     case Cursor::MiddlePanning:
-        m_platformCursor = wkCursor("Move");
+        m_platformCursor = cursor("Move");
         break;
 
     case Cursor::EastResize:
     case Cursor::EastPanning:
-        m_platformCursor = wkCursor("ResizeEast");
+        m_platformCursor = cursor("ResizeEast");
         break;
 
     case Cursor::NorthResize:
     case Cursor::NorthPanning:
-        m_platformCursor = wkCursor("ResizeNorth");
+        m_platformCursor = cursor("ResizeNorth");
         break;
 
     case Cursor::NorthEastResize:
     case Cursor::NorthEastPanning:
-        m_platformCursor = wkCursor("ResizeNortheast");
+        m_platformCursor = cursor("ResizeNortheast");
         break;
 
     case Cursor::NorthWestResize:
     case Cursor::NorthWestPanning:
-        m_platformCursor = wkCursor("ResizeNorthwest");
+        m_platformCursor = cursor("ResizeNorthwest");
         break;
 
     case Cursor::SouthResize:
     case Cursor::SouthPanning:
-        m_platformCursor = wkCursor("ResizeSouth");
+        m_platformCursor = cursor("ResizeSouth");
         break;
 
     case Cursor::SouthEastResize:
     case Cursor::SouthEastPanning:
-        m_platformCursor = wkCursor("ResizeSoutheast");
+        m_platformCursor = cursor("ResizeSoutheast");
         break;
 
     case Cursor::SouthWestResize:
     case Cursor::SouthWestPanning:
-        m_platformCursor = wkCursor("ResizeSouthwest");
+        m_platformCursor = cursor("ResizeSouthwest");
         break;
 
     case Cursor::WestResize:
     case Cursor::WestPanning:
-        m_platformCursor = wkCursor("ResizeWest");
+        m_platformCursor = cursor("ResizeWest");
         break;
 
     case Cursor::NorthSouthResize:
-        m_platformCursor = wkCursor("ResizeNorthSouth");
+        m_platformCursor = cursor("ResizeNorthSouth");
         break;
 
     case Cursor::EastWestResize:
-        m_platformCursor = wkCursor("ResizeEastWest");
+        m_platformCursor = cursor("ResizeEastWest");
         break;
 
     case Cursor::NorthEastSouthWestResize:
-        m_platformCursor = wkCursor("ResizeNortheastSouthwest");
+        m_platformCursor = cursor("ResizeNortheastSouthwest");
         break;
 
     case Cursor::NorthWestSouthEastResize:
-        m_platformCursor = wkCursor("ResizeNorthwestSoutheast");
+        m_platformCursor = cursor("ResizeNorthwestSoutheast");
         break;
 
     case Cursor::ColumnResize:
@@ -184,7 +319,7 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::Cell:
-        m_platformCursor = wkCursor("Cell");
+        m_platformCursor = cursor("Cell");
         break;
 
     case Cursor::ContextMenu:
@@ -192,11 +327,11 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::Alias:
-        m_platformCursor = wkCursor("MakeAlias");
+        m_platformCursor = cursor("MakeAlias");
         break;
 
     case Cursor::Progress:
-        m_platformCursor = wkCursor("BusyButClickable");
+        m_platformCursor = cursor("BusyButClickable");
         break;
 
     case Cursor::NoDrop:
@@ -216,11 +351,11 @@ void Cursor::ensurePlatformCursor() const
         break;
 
     case Cursor::ZoomIn:
-        m_platformCursor = wkCursor("ZoomIn");
+        m_platformCursor = cursor("ZoomIn");
         break;
 
     case Cursor::ZoomOut:
-        m_platformCursor = wkCursor("ZoomOut");
+        m_platformCursor = cursor("ZoomOut");
         break;
 
     case Cursor::Grab:
index ace298c12f820ed50d69cfef651630d084c052fe..55fca128162f63820156fa211b27b7ad2cf1952a 100644 (file)
@@ -123,7 +123,6 @@ typedef enum {
     wkPatternTilingConstantSpacing
 } wkPatternTiling;
 #if !PLATFORM(IOS)
-extern void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
 extern void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
     float duration, unsigned state);
 extern void (*wkDrawMediaUIPart)(int part, CGContextRef context, CGRect rect, unsigned state);
@@ -136,24 +135,10 @@ extern void (*wkSetCookieStoragePrivateBrowsingEnabled)(BOOL);
 extern void* wkGetHyphenationLocationBeforeIndex;
 #endif
 
-#if !PLATFORM(IOS)
-extern bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
-
-extern CFStringRef (*wkCopyDefaultSearchProviderDisplayName)(void);
-
-extern NSCursor *(*wkCursor)(const char*);
-#endif // !PLATFORM(IOS)
-
 #if PLATFORM(IOS)
 extern void (*wkSetLayerContentsScale)(CALayer *);
 #endif
 
 typedef const struct __CFURLStorageSession* CFURLStorageSessionRef;
 
-#if !PLATFORM(IOS)
-extern CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
-extern CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
-extern CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
-#endif
-
 }
index 3507319b5dd8a7e706fe6313d041f384908008a3..8fbb1d3d8c8868c2454f309c69e06400f3dff96d 100644 (file)
@@ -30,7 +30,6 @@
 
 #import <Foundation/Foundation.h>
 
-void (*wkDrawBezeledTextArea)(NSRect, BOOL enabled);
 void (*wkDrawMediaSliderTrack)(CGContextRef context, CGRect rect, float timeLoaded, float currentTime,
     float duration, unsigned state);
 BOOL (*wkHitTestMediaUIPart)(int part, CGRect bounds, CGPoint point);
@@ -42,14 +41,4 @@ void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selecte
 
 void* wkGetHyphenationLocationBeforeIndex;
 
-bool (*wkExecutableWasLinkedOnOrBeforeSnowLeopard)(void);
-
 CFStringRef (*wkCopyDefaultSearchProviderDisplayName)(void);
-
-NSCursor *(*wkCursor)(const char*);
-
-#if !PLATFORM(IOS)
-CGFloat (*wkNSElasticDeltaForTimeDelta)(CGFloat initialPosition, CGFloat initialVelocity, CGFloat elapsedTime);
-CGFloat (*wkNSElasticDeltaForReboundDelta)(CGFloat delta);
-CGFloat (*wkNSReboundDeltaForElasticDelta)(CGFloat delta);
-#endif
index 93e8d6197176175d8ccb36e19cfefba9c48655ef..f00c8397b58a41aa93128a226aae75a6fb9ac54e 100644 (file)
@@ -74,6 +74,7 @@
 #import <math.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/NSColorSPI.h>
+#import <pal/spi/mac/NSCellSPI.h>
 #import <pal/spi/mac/NSSharingServicePickerSPI.h>
 #import <wtf/MathExtras.h>
 #import <wtf/RetainPtr.h>
@@ -884,7 +885,7 @@ void RenderThemeMac::adjustTextFieldStyle(StyleResolver&, RenderStyle&, const El
 bool RenderThemeMac::paintTextArea(const RenderObject& o, const PaintInfo& paintInfo, const FloatRect& r)
 {
     LocalCurrentGraphicsContext localContext(paintInfo.context());
-    wkDrawBezeledTextArea(r, isEnabled(o) && !isReadOnlyControl(o));
+    _NSDrawCarbonThemeListBox(r, isEnabled(o) && !isReadOnlyControl(o), YES, YES);
     return false;
 }
 
index 7ab132ce9d585df443e5555184693cce145cf97c..6b2f0799c6c1b41500f53c7e1e1cdc192d8f530d 100644 (file)
@@ -1,3 +1,31 @@
+2017-09-18  Andy Estes  <aestes@apple.com>
+
+        [Mac] Upstream miscellaneous WebKitSystemInterface functions
+        https://bugs.webkit.org/show_bug.cgi?id=177029
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/mac/NetworkProcessMac.mm:
+        (WebKit::NetworkProcess::initializeProcessName):
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::PluginProcess::initializeProcessName):
+        * StorageProcess/mac/StorageProcessMac.mm:
+        (WebKit::StorageProcess::initializeProcessName):
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::trackingAreaOptions):
+        (WebKit::WebViewImpl::mightBeginScrollWhileInactive):
+        * UIProcess/mac/WebPopupMenuProxyMac.mm:
+        (WebKit::WebPopupMenuProxyMac::showPopupMenu):
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        (WebKit::NetscapePlugin::popUpContextMenu):
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::handleContextMenuEvent):
+        * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+        * WebProcess/cocoa/WebProcessCocoa.mm:
+        (WebKit::WebProcess::initializeProcessName):
+        (WebKit::WebProcess::updateActivePages):
+
 2017-09-17  Michael Catanzaro  <mcatanzaro@igalia.com>
 
         [WPE][GTK] Merge ProcessLauncher[WPE,GTK]
index 6f752952e76c3487b2aca0d2de1135aac3daee87..138be6b8ffc74388501a518ebaf0242f9f12925a 100644 (file)
@@ -42,6 +42,7 @@
 #import <WebKitSystemInterface.h>
 #import <notify.h>
 #import <pal/spi/cf/CFNetworkSPI.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <sysexits.h>
 #import <wtf/MemoryPressureHandler.h>
 #import <wtf/text/WTFString.h>
@@ -59,7 +60,7 @@ void NetworkProcess::initializeProcess(const ChildProcessInitializationParameter
 void NetworkProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters)
 {
     NSString *applicationName = [NSString stringWithFormat:WEB_UI_STRING("%@ Networking", "visible name of the network process. The argument is the application name."), (NSString *)parameters.uiProcessName];
-    WKSetVisibleApplicationName((CFStringRef)applicationName);
+    _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey, (CFStringRef)applicationName, nullptr);
 }
 
 static void overrideSystemProxies(const String& httpProxy, const String& httpsProxy)
index 24d26ed1e6743aec557a8f76489b67380417fd05..da266b51b1ff9efe620de05218244848a3b0c419 100644 (file)
@@ -47,6 +47,7 @@
 #import <mach/vm_statistics.h>
 #import <objc/runtime.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <pal/spi/mac/HIToolboxSPI.h>
 #import <pal/spi/mac/NSWindowSPI.h>
 #import <sysexits.h>
@@ -622,9 +623,9 @@ void PluginProcess::platformInitializeProcess(const ChildProcessInitializationPa
 void PluginProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters)
 {
     NSString *applicationName = [NSString stringWithFormat:WEB_UI_STRING("%@ (%@ Internet plug-in)", "visible name of the plug-in host process. The first argument is the plug-in name and the second argument is the application name."), [[(NSString *)m_pluginPath lastPathComponent] stringByDeletingPathExtension], (NSString *)parameters.uiProcessName];
-    WKSetVisibleApplicationName((CFStringRef)applicationName);
+    _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey, (CFStringRef)applicationName, nullptr);
     if (!m_pluginBundleIdentifier.isEmpty())
-        WKSetApplicationInformationItem(kLSPlugInBundleIdentifierKey, m_pluginBundleIdentifier.createCFString().get());
+        _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), kLSPlugInBundleIdentifierKey, m_pluginBundleIdentifier.createCFString().get(), nullptr);
 }
 
 void PluginProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
index c038860f8f143c0dcffc93a52766d63454741f39..e39681ac74afed1d6f49fbc8e5305bfc5c436a74 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
+ * Copyright (C) 2013-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -33,6 +33,7 @@
 #import <WebCore/FileSystem.h>
 #import <WebCore/LocalizedStrings.h>
 #import <WebKitSystemInterface.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 
 using namespace WebCore;
 
@@ -47,7 +48,7 @@ void StorageProcess::initializeProcess(const ChildProcessInitializationParameter
 void StorageProcess::initializeProcessName(const ChildProcessInitializationParameters& parameters)
 {
     NSString *applicationName = [NSString stringWithFormat:WEB_UI_STRING("%@ Storage", "visible name of the storage process. The argument is the application name."), (NSString *)parameters.uiProcessName];
-    WKSetVisibleApplicationName((CFStringRef)applicationName);
+    _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey, (CFStringRef)applicationName, nullptr);
 }
 
 void StorageProcess::initializeSandbox(const ChildProcessInitializationParameters& parameters, SandboxInitializationParameters& sandboxParameters)
index 32148b956c94ff288893e16b27ab59fb74d7abb1..f8b9db265a8a24c84b2899789ed3fd8eea5a45fd 100644 (file)
@@ -71,7 +71,7 @@
 #import <wtf/NeverDestroyed.h>
 
 #if HAVE(APP_LINKS)
-#import <pal/spi/ios/LaunchServicesSPI.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #endif
 
 #if USE(QUICK_LOOK)
index 9980e15e2f99266ab09b8a5a01ba7ed787a5b505..0155cb18b151439a0f13b23aadaad61771c6e590 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -94,6 +94,7 @@
 #import <pal/spi/mac/NSAccessibilitySPI.h>
 #import <pal/spi/mac/NSApplicationSPI.h>
 #import <pal/spi/mac/NSImmediateActionGestureRecognizerSPI.h>
+#import <pal/spi/mac/NSScrollerImpSPI.h>
 #import <pal/spi/mac/NSSpellCheckerSPI.h>
 #import <pal/spi/mac/NSTextFinderSPI.h>
 #import <pal/spi/mac/NSWindowSPI.h>
@@ -1259,7 +1260,7 @@ static NSTrackingAreaOptions trackingAreaOptions()
 {
     // Legacy style scrollbars have design details that rely on tracking the mouse all the time.
     NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingCursorUpdate;
-    if (WKRecommendedScrollerStyle() == NSScrollerStyleLegacy)
+    if (_NSRecommendedScrollerStyle() == NSScrollerStyleLegacy)
         options |= NSTrackingActiveAlways;
     else
         options |= NSTrackingActiveInKeyWindow;
@@ -1945,7 +1946,7 @@ bool WebViewImpl::mightBeginDragWhileInactive()
 bool WebViewImpl::mightBeginScrollWhileInactive()
 {
     // Legacy style scrollbars have design details that rely on tracking the mouse all the time.
-    if (WKRecommendedScrollerStyle() == NSScrollerStyleLegacy)
+    if (_NSRecommendedScrollerStyle() == NSScrollerStyleLegacy)
         return true;
 
     return false;
index c3e92a7e19daa8cea431bb66e8a18716d79ae8f6..9ce8417135be4f382a9c5bb2eb605f9b5ad35cd4 100644 (file)
@@ -47,7 +47,7 @@
 #import <wtf/text/WTFString.h>
 
 #if HAVE(APP_LINKS)
-#import <pal/spi/ios/LaunchServicesSPI.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #endif
 
 #if HAVE(SAFARI_SERVICES_FRAMEWORK)
index 7d6cb3eda1d089c8745ab34a01c3cb6cfefe3c21..1241bd8d9e1b7017f09d4c4c4ff9ea3019c76bd9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2010-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -34,6 +34,7 @@
 #import "StringUtilities.h"
 #import "WebPopupItem.h"
 #import <WebKitSystemInterface.h>
+#import <pal/system/mac/PopupMenu.h>
 
 using namespace WebCore;
 
@@ -165,7 +166,7 @@ void WebPopupMenuProxyMac::showPopupMenu(const IntRect& rect, TextDirection text
     }
 
     Ref<WebPopupMenuProxyMac> protect(*this);
-    WKPopupMenu(menu, location, roundf(NSWidth(rect)), dummyView.get(), selectedIndex, font, controlSize, data.hideArrows);
+    PAL::popUpMenu(menu, location, roundf(NSWidth(rect)), dummyView.get(), selectedIndex, font, controlSize, data.hideArrows);
 
     [m_popup dismissPopUp];
     [dummyView removeFromSuperview];
index a3120e625383beb2af7070270f47f8589930c206..d291a1143cc31ecd13c8ebb822532ca7ef11c9ff 100644 (file)
@@ -38,6 +38,7 @@
 #import <WebKitSystemInterface.h>
 #import <objc/runtime.h>
 #import <pal/spi/mac/HIToolboxSPI.h>
+#import <pal/spi/mac/NSMenuSPI.h>
 #import <wtf/NeverDestroyed.h>
 #import <wtf/text/StringView.h>
 
@@ -158,7 +159,6 @@ NPBool NetscapePlugin::convertPoint(double sourceX, double sourceY, NPCoordinate
     return false;
 }
 
-
 NPError NetscapePlugin::popUpContextMenu(NPMenu* npMenu)
 {
     if (!m_currentMouseEvent)
@@ -168,7 +168,7 @@ NPError NetscapePlugin::popUpContextMenu(NPMenu* npMenu)
     if (!convertPoint(m_currentMouseEvent->data.mouse.pluginX, m_currentMouseEvent->data.mouse.pluginY, NPCoordinateSpacePlugin, screenX, screenY, NPCoordinateSpaceScreen))
         ASSERT_NOT_REACHED();
 
-    WKPopupContextMenu(reinterpret_cast<NSMenu *>(npMenu), NSMakePoint(screenX, screenY));
+    _NSPopUpCarbonMenu3(reinterpret_cast<NSMenu *>(npMenu), nil, nil, NSMakePoint(screenX, screenY), -1, nil, 0, nil, NSPopUpMenuTypeContext, nil);
     return NPERR_NO_ERROR;
 }
 
index 927c8ac43d25d6f7c7b8785666607bd273b3eba1..afcffa51745b25b9e740428307faced548decaa1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2009, 2011, 2012, 2015 Apple Inc. All rights reserved.
+ * Copyright (C) 2009-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -81,6 +81,7 @@
 #import <WebCore/WheelEventTestTrigger.h>
 #import <WebKitSystemInterface.h>
 #import <pal/spi/cg/CoreGraphicsSPI.h>
+#import <pal/spi/mac/NSMenuSPI.h>
 #import <wtf/CurrentTime.h>
 #import <wtf/UUID.h>
 
@@ -1585,7 +1586,7 @@ bool PDFPlugin::handleContextMenuEvent(const WebMouseEvent& event)
     IntPoint point = frameView->contentsToScreen(IntRect(frameView->windowToContents(event.position()), IntSize())).location();
     
     if (NSMenu *nsMenu = [m_pdfLayerController menuForEvent:nsEventForWebMouseEvent(event)]) {
-        WKPopupContextMenu(nsMenu, point);
+        _NSPopUpCarbonMenu3(nsMenu, nil, nil, point, -1, nil, 0, nil, NSPopUpMenuTypeContext, nil);
         return true;
     }
     
index 6d1dd733919ed4f48637d67ce615dc6fd0471227..b9ac396bb036d55d712c227482afa3fc97730935 100644 (file)
@@ -37,17 +37,10 @@ void InitWebCoreSystemInterface(void)
     
     dispatch_once(&initOnce, ^{
 #if !PLATFORM(IOS)
-        INIT(DrawBezeledTextArea);
         INIT(DrawMediaSliderTrack);
         INIT(DrawMediaUIPart);
         INIT(HitTestMediaUIPart);
         INIT(MeasureMediaUIPart);
-        INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
-        INIT(CopyDefaultSearchProviderDisplayName);
-        INIT(Cursor);
-        INIT(NSElasticDeltaForTimeDelta);
-        INIT(NSElasticDeltaForReboundDelta);
-        INIT(NSReboundDeltaForElasticDelta);
 #endif
     });
 }
index 7c35d8e90b791c942619fdcf76603c9b430ee02a..2a3f38e218e734f76ce97ac12b78c2140eb602df 100644 (file)
@@ -62,6 +62,7 @@
 #import <dispatch/dispatch.h>
 #import <objc/runtime.h>
 #import <pal/spi/cf/CFNetworkSPI.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #import <pal/spi/cocoa/QuartzCoreSPI.h>
 #import <pal/spi/cocoa/pthreadSPI.h>
 #import <pal/spi/mac/NSAccessibilitySPI.h>
@@ -194,7 +195,7 @@ void WebProcess::initializeProcessName(const ChildProcessInitializationParameter
         applicationName = [NSString stringWithFormat:WEB_UI_STRING("%@ Web Inspector", "Visible name of Web Inspector's web process. The argument is the application name."), (NSString *)parameters.uiProcessName];
     else
         applicationName = [NSString stringWithFormat:WEB_UI_STRING("%@ Web Content", "Visible name of the web process. The argument is the application name."), (NSString *)parameters.uiProcessName];
-    WKSetVisibleApplicationName((CFStringRef)applicationName);
+    _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), _kLSDisplayNameKey, (CFStringRef)applicationName, nullptr);
 #endif
 }
 
@@ -394,7 +395,7 @@ void WebProcess::updateActivePages()
     }
 
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), [activePageURLs] {
-        WKSetApplicationInformationItem(CFSTR("LSActivePageUserVisibleOriginsKey"), (__bridge CFArrayRef)activePageURLs.get());
+        _LSSetApplicationInformationItem(kLSDefaultSessionID, _LSGetCurrentApplicationASN(), CFSTR("LSActivePageUserVisibleOriginsKey"), (__bridge CFArrayRef)activePageURLs.get(), nullptr);
     });
 #endif
 }
index 8d98d400666bda2a9116c42402e1046456228507..5392d91d4002696ef41f20bc755aaece9a37191d 100644 (file)
@@ -1,3 +1,28 @@
+2017-09-18  Andy Estes  <aestes@apple.com>
+
+        [Mac] Upstream miscellaneous WebKitSystemInterface functions
+        https://bugs.webkit.org/show_bug.cgi?id=177029
+
+        Reviewed by Alex Christensen.
+
+        * DefaultDelegates/WebDefaultContextMenuDelegate.mm:
+        (-[WebDefaultUIDelegate menuItemWithTag:target:representedObject:]):
+        * Plugins/Hosted/NetscapePluginHostProxy.mm:
+        (WebKit::NetscapePluginHostProxy::NetscapePluginHostProxy):
+        * WebCoreSupport/PopupMenuMac.mm:
+        (PopupMenuMac::show):
+        * WebCoreSupport/WebSystemInterface.mm:
+        (InitWebCoreSystemInterface):
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView setDataSource:]):
+        (-[WebHTMLView attachRootLayer:]):
+        * WebView/WebView.mm:
+        (-[WebView _needsAdobeFrameReloadingQuirk]):
+        (-[WebView _needsLinkElementTextCSSQuirk]):
+        (-[WebView _needsIsLoadingInAPISenseQuirk]):
+        (-[WebView _needsFrameLoadDelegateRetainQuirk]):
+        (-[WebView _preferencesChanged:]):
+
 2017-09-15  Andy Estes  <aestes@apple.com>
 
         [Cocoa] Upstream MediaRemote and VideoToolbox WebKitSystemInterface functions
index 0265bf0c51a9f1871596555d6907f902370e7957..6392ab051f3392433a0070d4bfcd642bd4571a2a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005 Apple Inc.  All rights reserved.
+ * Copyright (C) 2005-2017 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -51,6 +51,7 @@
 #import <WebKitLegacy/DOM.h>
 #import <WebKitLegacy/DOMPrivate.h>
 #import <WebKitSystemInterface.h>
+#import <pal/system/mac/DefaultSearchProvider.h>
 #import <wtf/Assertions.h>
 
 @implementation WebDefaultUIDelegate (WebContextMenu)
@@ -91,7 +92,7 @@
             action = @selector(_searchWithSpotlightFromMenu:);
             break;
         case WebMenuItemTagSearchWeb: {
-            RetainPtr<CFStringRef> searchProviderName = adoptCF(WKCopyDefaultSearchProviderDisplayName());
+            auto searchProviderName = PAL::defaultSearchProviderDisplayName();
             title = [NSString stringWithFormat:UI_STRING_INTERNAL("Search with %@", "Search with search provider context menu item with provider name inserted"), searchProviderName.get()];
             action = @selector(_searchWithGoogleFromMenu:);
             break;
index 19b38ae2e834327dd67338617b617e897d768d9b..384a591efe1782619ea2d8ddea1500fd95df2cd0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008-2017 Apple Inc. All Rights Reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -41,6 +41,7 @@
 #import <WebCore/Frame.h>
 #import <WebCore/IdentifierRep.h>
 #import <WebCore/ScriptController.h>
+#import <pal/spi/mac/HIServicesSPI.h>
 #import <wtf/NeverDestroyed.h>
 
 extern "C" {
@@ -117,7 +118,7 @@ NetscapePluginHostProxy::NetscapePluginHostProxy(mach_port_t clientPort, mach_po
     
     CFRunLoopAddSource(CFRunLoopGetCurrent(), deathPortSource.get(), kCFRunLoopDefaultMode);
     
-    m_clientPortSource = adoptCF(WKCreateMIGServerSource((mig_subsystem_t)&WKWebKitPluginClient_subsystem, m_clientPort));
+    m_clientPortSource = adoptCF(MSHCreateMIGServerSource(nullptr, 0, (mig_subsystem_t)&WKWebKitPluginClient_subsystem, 0, m_clientPort, nullptr));
     CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), kCFRunLoopDefaultMode);
     CFRunLoopAddSource(CFRunLoopGetCurrent(), m_clientPortSource.get(), (CFStringRef)NSEventTrackingRunLoopMode);
 }
index cc5f81dfd656fc8e735d1857f5ae8538d074fe14..81cf4c75d209cbcf1c471f13ce3ce4f0f1b10c2a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2006, 2008, 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2006-2017 Apple Inc. All rights reserved.
  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
  *
  * This library is free software; you can redistribute it and/or
@@ -33,6 +33,7 @@
 #import <WebCore/Page.h>
 #import <WebCore/PopupMenuClient.h>
 #import <WebKitSystemInterface.h>
+#import <pal/system/mac/PopupMenu.h>
 #import <wtf/BlockObjCExceptions.h>
 
 using namespace WebCore;
@@ -217,7 +218,7 @@ void PopupMenuMac::show(const IntRect& r, FrameView* v, int index)
         break;
     }
 
-    WKPopupMenu(menu, location, roundf(NSWidth(r)), dummyView.get(), index, toNSFont(font), controlSize, !m_client->menuStyle().hasDefaultAppearance());
+    PAL::popUpMenu(menu, location, roundf(NSWidth(r)), dummyView.get(), index, toNSFont(font), controlSize, !m_client->menuStyle().hasDefaultAppearance());
 
     [m_popup dismissPopUp];
     [dummyView removeFromSuperview];
index f9b87022b6619d1908176fa1173a0c9b9956a1c2..89f3e065ee37fcff327e6f28bc54b614fb49e8d0 100644 (file)
 
 #if HAVE(APP_LINKS)
 #import <WebCore/WebCoreThreadRun.h>
-#import <pal/spi/ios/LaunchServicesSPI.h>
+#import <pal/spi/cocoa/LaunchServicesSPI.h>
 #endif
 
 #if ENABLE(CONTENT_FILTERING)
index bf716b757b0c59737f883102ea505859300237ea..a99298bf680daeb307b84b21ac7054046d837dae 100644 (file)
@@ -43,24 +43,11 @@ void InitWebCoreSystemInterface(void)
         return;
 
 #if !PLATFORM(IOS)
-    INIT(DrawBezeledTextArea);
     INIT(DrawMediaUIPart);
     INIT(DrawMediaSliderTrack);
     INIT(HitTestMediaUIPart);
     INIT(MeasureMediaUIPart);
 #endif
 
-#if !PLATFORM(IOS)
-    INIT(ExecutableWasLinkedOnOrBeforeSnowLeopard);
-    INIT(CopyDefaultSearchProviderDisplayName);
-    INIT(Cursor);
-#endif
-
-#if !PLATFORM(IOS)
-    INIT(NSElasticDeltaForTimeDelta);
-    INIT(NSElasticDeltaForReboundDelta);
-    INIT(NSReboundDeltaForElasticDelta);
-#endif
-
     didInit = true;
 }
index 274a1687057454414ab92975a5c048c60ee5a58a..8d3f9ebbf827fe148de2416029f3fd6abe3312da 100644 (file)
 #import <WebKitSystemInterface.h>
 #import <dlfcn.h>
 #import <limits>
+#import <pal/spi/cf/CFUtilitiesSPI.h>
 #import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
+#import <pal/spi/mac/NSScrollerImpSPI.h>
 #import <pal/spi/mac/NSSpellCheckerSPI.h>
 #import <pal/spi/mac/NSViewSPI.h>
 #import <pal/spi/mac/NSWindowSPI.h>
@@ -4682,7 +4684,7 @@ static RefPtr<KeyboardEvent> currentKeyboardEvent(Frame* coreFrame)
 #if PLATFORM(MAC)
     if (!_private->installedTrackingArea) {
         NSTrackingAreaOptions options = NSTrackingMouseMoved | NSTrackingMouseEnteredAndExited | NSTrackingInVisibleRect | NSTrackingCursorUpdate;
-        if (WKRecommendedScrollerStyle() == NSScrollerStyleLegacy
+        if (_NSRecommendedScrollerStyle() == NSScrollerStyleLegacy
 #if ENABLE(DASHBOARD_SUPPORT)
             || [[self _webView] _dashboardBehavior:WebDashboardBehaviorAlwaysSendMouseEventsToAllWindows]
 #endif
@@ -6354,7 +6356,7 @@ static BOOL writingDirectionKeyBindingsEnabled()
     if ([[self _webView] _postsAcceleratedCompositingNotifications])
         [[NSNotificationCenter defaultCenter] postNotificationName:_WebViewDidStartAcceleratedCompositingNotification object:[self _webView] userInfo:nil];
 
-    if (WKExecutableWasLinkedOnOrBeforeLion())
+    if (!_CFExecutableLinkedOnOrAfter(CFSystemVersionMountainLion))
         [viewLayer setGeometryFlipped:YES];
 }
 
index ad29a82252989c66a65f65894f4e861135191c30..4e8b821611b888d47e628ddef9d3beb598518f29 100644 (file)
 #import <mach-o/dyld.h>
 #import <objc/runtime.h>
 #import <pal/spi/cf/CFNetworkSPI.h>
+#import <pal/spi/cf/CFUtilitiesSPI.h>
 #import <pal/spi/cocoa/NSTouchBarSPI.h>
 #import <pal/spi/cocoa/NSURLFileTypeMappingsSPI.h>
 #import <pal/spi/mac/NSResponderSPI.h>
@@ -2609,16 +2610,16 @@ static bool fastDocumentTeardownEnabled()
 #if !PLATFORM(IOS)
 - (BOOL)_needsAdobeFrameReloadingQuirk
 {
-    static BOOL needsQuirk = WKAppVersionCheckLessThan(@"com.adobe.Acrobat", -1, 9.0)
-        || WKAppVersionCheckLessThan(@"com.adobe.Acrobat.Pro", -1, 9.0)
-        || WKAppVersionCheckLessThan(@"com.adobe.Reader", -1, 9.0)
-        || WKAppVersionCheckLessThan(@"com.adobe.distiller", -1, 9.0)
-        || WKAppVersionCheckLessThan(@"com.adobe.Contribute", -1, 4.2)
-        || WKAppVersionCheckLessThan(@"com.adobe.dreamweaver-9.0", -1, 9.1)
-        || WKAppVersionCheckLessThan(@"com.macromedia.fireworks", -1, 9.1)
-        || WKAppVersionCheckLessThan(@"com.adobe.InCopy", -1, 5.1)
-        || WKAppVersionCheckLessThan(@"com.adobe.InDesign", -1, 5.1)
-        || WKAppVersionCheckLessThan(@"com.adobe.Soundbooth", -1, 2);
+    static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.adobe.Acrobat"), -1, 9.0)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Acrobat.Pro"), -1, 9.0)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Reader"), -1, 9.0)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.distiller"), -1, 9.0)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Contribute"), -1, 4.2)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.dreamweaver-9.0"), -1, 9.1)
+        || _CFAppVersionCheckLessThan(CFSTR("com.macromedia.fireworks"), -1, 9.1)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.InCopy"), -1, 5.1)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.InDesign"), -1, 5.1)
+        || _CFAppVersionCheckLessThan(CFSTR("com.adobe.Soundbooth"), -1, 2);
 
     return needsQuirk;
 }
@@ -2626,13 +2627,13 @@ static bool fastDocumentTeardownEnabled()
 - (BOOL)_needsLinkElementTextCSSQuirk
 {
     static BOOL needsQuirk = !WebKitLinkedOnOrAfter(WEBKIT_FIRST_VERSION_WITHOUT_LINK_ELEMENT_TEXT_CSS_QUIRK)
-        && WKAppVersionCheckLessThan(@"com.e-frontier.shade10", -1, 10.6);
+        && _CFAppVersionCheckLessThan(CFSTR("com.e-frontier.shade10"), -1, 10.6);
     return needsQuirk;
 }
 
 - (BOOL)_needsIsLoadingInAPISenseQuirk
 {
-    static BOOL needsQuirk = WKAppVersionCheckLessThan(@"com.apple.iAdProducer", -1, 2.1);
+    static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.apple.iAdProducer"), -1, 2.1);
     
     return needsQuirk;
 }
@@ -2645,7 +2646,7 @@ static bool fastDocumentTeardownEnabled()
 
 - (BOOL)_needsFrameLoadDelegateRetainQuirk
 {
-    static BOOL needsQuirk = WKAppVersionCheckLessThan(@"com.equinux.iSale5", -1, 5.6);    
+    static BOOL needsQuirk = _CFAppVersionCheckLessThan(CFSTR("com.equinux.iSale5"), -1, 5.6);
     return needsQuirk;
 }
 
@@ -2927,7 +2928,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings.setNeedsAdobeFrameReloadingQuirk([self _needsAdobeFrameReloadingQuirk]);
     settings.setTreatsAnyTextCSSLinkAsStylesheet([self _needsLinkElementTextCSSQuirk]);
     settings.setNeedsKeyboardEventDisambiguationQuirks([self _needsKeyboardEventDisambiguationQuirks]);
-    settings.setEnforceCSSMIMETypeInNoQuirksMode(!WKAppVersionCheckLessThan(@"com.apple.iWeb", -1, 2.1));
+    settings.setEnforceCSSMIMETypeInNoQuirksMode(!_CFAppVersionCheckLessThan(CFSTR("com.apple.iWeb"), -1, 2.1));
     settings.setNeedsIsLoadingInAPISenseQuirk([self _needsIsLoadingInAPISenseQuirk]);
     settings.setTextAreasAreResizable([preferences textAreasAreResizable]);
     settings.setExperimentalNotificationsEnabled([preferences experimentalNotificationsEnabled]);