Title: [240494] trunk/Source
Revision
240494
Author
ddkil...@apple.com
Date
2019-01-25 12:24:14 -0800 (Fri, 25 Jan 2019)

Log Message

Move soft-linking of Lookup.framework out of LookupSPI.h
<https://webkit.org/b/193815>

Reviewed by Tim Horton.

Source/WebCore:

* editing/cocoa/DictionaryLookup.mm:
- Remove unused header.

* editing/mac/DictionaryLookupLegacy.mm:
(WebCore::tokenRange):
(WebCore::showPopupOrCreateAnimationController):
(WebCore::DictionaryLookup::hidePopup):
- Move soft-linking to LookupSoftLink.{h,mm}.

* platform/ios/ValidationBubbleIOS.mm:
(WebCore::ValidationBubble::show):
- Update for changes to UIKitSoftLink.{h,mm} now that
  UIAccessibilityAnnouncementNotification is using
  SOFT_LINK_CONSTANT*().

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/PlatformMac.cmake:
- Add LookupSoftLink.{h,mm} files to the project.

* pal/ios/UIKitSoftLink.h:
* pal/ios/UIKitSoftLink.mm:
- Change SOFT_LINK_VARIABLE_FOR_HEADER() to
  SOFT_LINK_CONSTANT_FOR_HEADER() for
  UIAccessibilityAnnouncementNotification constant.

* pal/mac/LookupSoftLink.h: Copied from Source/WebCore/PAL/pal/spi/mac/LookupSPI.h.
* pal/mac/LookupSoftLink.mm: Copied from Source/WebCore/PAL/pal/spi/mac/LookupSPI.h.
- Migrate soft-linking from LookupSPI.h to here.

* pal/spi/mac/LookupSPI.h:
- Replace soft-linking of Lookup.framework with
  LookupSoftLink.h.

Source/WebKit:

* UIProcess/Cocoa/WebViewImpl.mm:
(-[WKWindowVisibilityObserver dealloc]):
(-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
- Move soft-linking to LookupSoftLink.{h,mm}.

Source/WebKitLegacy/mac:

* WebView/WebImmediateActionController.mm:
(-[WebImmediateActionController _animationControllerForText]):
* WebView/WebView.mm:
(-[WebView _prepareForDictionaryLookup]):
- Move soft-linking to LookupSoftLink.{h,mm}.

Source/WTF:

* wtf/cocoa/SoftLinking.h:
(SOFT_LINK_CONSTANT_FOR_HEADER):
(SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
(SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER):
- Remove local declaration of constant.  This should be handled
  by including *SPI.h or "real" headers.
(SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT):
- Remove local declaration of constant.
- Rename from SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE() and add
  `export` argument to support exporting of functions.
(SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE):
- Redefine in terms of
  SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT().

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (240493 => 240494)


--- trunk/Source/WTF/ChangeLog	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WTF/ChangeLog	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,3 +1,24 @@
+2019-01-25  David Kilzer  <ddkil...@apple.com>
+
+        Move soft-linking of Lookup.framework out of LookupSPI.h
+        <https://webkit.org/b/193815>
+
+        Reviewed by Tim Horton.
+
+        * wtf/cocoa/SoftLinking.h:
+        (SOFT_LINK_CONSTANT_FOR_HEADER):
+        (SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT):
+        (SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER):
+        - Remove local declaration of constant.  This should be handled
+          by including *SPI.h or "real" headers.
+        (SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT):
+        - Remove local declaration of constant.
+        - Rename from SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE() and add
+          `export` argument to support exporting of functions.
+        (SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE):
+        - Redefine in terms of
+          SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT().
+
 2019-01-24  Youenn Fablet  <you...@apple.com>
 
         Use MonotonicTime in WorkerRunLoop

Modified: trunk/Source/WTF/wtf/cocoa/SoftLinking.h (240493 => 240494)


--- trunk/Source/WTF/wtf/cocoa/SoftLinking.h	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WTF/wtf/cocoa/SoftLinking.h	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2007-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -429,17 +429,11 @@
     SOFT_LINK_CLASS_FOR_SOURCE_WITH_EXPORT_AND_ASSERTION(functionNamespace, framework, className, , NO_ASSERT)
 
 #define SOFT_LINK_CONSTANT_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
-    WTF_EXTERN_C_BEGIN \
-    extern const variableType variableName; \
-    WTF_EXTERN_C_END \
     namespace functionNamespace { \
     variableType get_##framework##_##variableName(); \
     }
 
 #define SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, export) \
-    WTF_EXTERN_C_BEGIN \
-    extern const variableType variableName; \
-    WTF_EXTERN_C_END \
     namespace functionNamespace { \
     export variableType get_##framework##_##variableName(); \
     variableType get_##framework##_##variableName() \
@@ -459,9 +453,6 @@
     SOFT_LINK_CONSTANT_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, )
 
 #define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(functionNamespace, framework, variableName, variableType) \
-    WTF_EXTERN_C_BEGIN \
-    extern const variableType variableName; \
-    WTF_EXTERN_C_END \
     namespace functionNamespace { \
     bool canLoad_##framework##_##variableName(); \
     bool init_##framework##_##variableName(); \
@@ -468,10 +459,7 @@
     variableType get_##framework##_##variableName(); \
     }
 
-#define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE(functionNamespace, framework, variableName, variableType) \
-    WTF_EXTERN_C_BEGIN \
-    extern const variableType variableName; \
-    WTF_EXTERN_C_END \
+#define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, export) \
     namespace functionNamespace { \
     static variableType constant##framework##variableName; \
     bool init_##framework##_##variableName(); \
@@ -483,13 +471,13 @@
         constant##framework##variableName = *static_cast<variableType const *>(constant); \
         return true; \
     } \
-    bool canLoad_##framework##_##variableName(); \
+    export bool canLoad_##framework##_##variableName(); \
     bool canLoad_##framework##_##variableName() \
     { \
         static bool loaded = init_##framework##_##variableName(); \
         return loaded; \
     } \
-    variableType get_##framework##_##variableName(); \
+    export variableType get_##framework##_##variableName(); \
     variableType get_##framework##_##variableName() \
     { \
         return constant##framework##variableName; \
@@ -496,6 +484,9 @@
     } \
     }
 
+#define SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE(functionNamespace, framework, variableName, variableType) \
+    SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(functionNamespace, framework, variableName, variableType, )
+
 #define SOFT_LINK_FUNCTION_FOR_HEADER(functionNamespace, framework, functionName, resultType, parameterDeclarations, parameterNames) \
     WTF_EXTERN_C_BEGIN \
     resultType functionName parameterDeclarations; \

Modified: trunk/Source/WebCore/ChangeLog (240493 => 240494)


--- trunk/Source/WebCore/ChangeLog	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/ChangeLog	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,3 +1,25 @@
+2019-01-25  David Kilzer  <ddkil...@apple.com>
+
+        Move soft-linking of Lookup.framework out of LookupSPI.h
+        <https://webkit.org/b/193815>
+
+        Reviewed by Tim Horton.
+
+        * editing/cocoa/DictionaryLookup.mm:
+        - Remove unused header.
+
+        * editing/mac/DictionaryLookupLegacy.mm:
+        (WebCore::tokenRange):
+        (WebCore::showPopupOrCreateAnimationController):
+        (WebCore::DictionaryLookup::hidePopup):
+        - Move soft-linking to LookupSoftLink.{h,mm}.
+
+        * platform/ios/ValidationBubbleIOS.mm:
+        (WebCore::ValidationBubble::show):
+        - Update for changes to UIKitSoftLink.{h,mm} now that
+          UIAccessibilityAnnouncementNotification is using
+          SOFT_LINK_CONSTANT*().
+
 2019-01-25  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"

Modified: trunk/Source/WebCore/PAL/ChangeLog (240493 => 240494)


--- trunk/Source/WebCore/PAL/ChangeLog	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/PAL/ChangeLog	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,3 +1,28 @@
+2019-01-25  David Kilzer  <ddkil...@apple.com>
+
+        Move soft-linking of Lookup.framework out of LookupSPI.h
+        <https://webkit.org/b/193815>
+
+        Reviewed by Tim Horton.
+
+        * PAL.xcodeproj/project.pbxproj:
+        * pal/PlatformMac.cmake:
+        - Add LookupSoftLink.{h,mm} files to the project.
+
+        * pal/ios/UIKitSoftLink.h:
+        * pal/ios/UIKitSoftLink.mm:
+        - Change SOFT_LINK_VARIABLE_FOR_HEADER() to
+          SOFT_LINK_CONSTANT_FOR_HEADER() for
+          UIAccessibilityAnnouncementNotification constant.
+
+        * pal/mac/LookupSoftLink.h: Copied from Source/WebCore/PAL/pal/spi/mac/LookupSPI.h.
+        * pal/mac/LookupSoftLink.mm: Copied from Source/WebCore/PAL/pal/spi/mac/LookupSPI.h.
+        - Migrate soft-linking from LookupSPI.h to here.
+
+        * pal/spi/mac/LookupSPI.h:
+        - Replace soft-linking of Lookup.framework with
+          LookupSoftLink.h.
+
 2019-01-24  Eric Carlson  <eric.carl...@apple.com>
 
         [iOS] Silence MediaPlayer compile warnings

Modified: trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj (240493 => 240494)


--- trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj	2019-01-25 20:24:14 UTC (rev 240494)
@@ -114,6 +114,8 @@
 		442956CD218A72DF0080DB54 /* RevealSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 442956CC218A72DE0080DB54 /* RevealSPI.h */; };
 		4450FC9F21F5F602004DFA56 /* QuickLookSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4450FC9D21F5F602004DFA56 /* QuickLookSoftLink.mm */; };
 		4450FCA021F5F602004DFA56 /* QuickLookSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 4450FC9E21F5F602004DFA56 /* QuickLookSoftLink.h */; };
+		44E1A8AF21FA54E600C3048E /* LookupSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 44E1A8AD21FA54DA00C3048E /* LookupSoftLink.h */; };
+		44E1A8B021FA54EB00C3048E /* LookupSoftLink.mm in Sources */ = {isa = PBXBuildFile; fileRef = 44E1A8AE21FA54DA00C3048E /* LookupSoftLink.mm */; };
 		570AB8F120AE2E8D00B8BE87 /* SecKeyProxySPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */; };
 		570AB8F920AF6E3D00B8BE87 /* NSXPCConnectionSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */; };
 		63C7EDC721AFAE04006A7B99 /* NSProgressSPI.h in Headers */ = {isa = PBXBuildFile; fileRef = 63E369F921AFA83F001C14BC /* NSProgressSPI.h */; };
@@ -273,6 +275,8 @@
 		442956CC218A72DE0080DB54 /* RevealSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RevealSPI.h; sourceTree = "<group>"; };
 		4450FC9D21F5F602004DFA56 /* QuickLookSoftLink.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QuickLookSoftLink.mm; sourceTree = "<group>"; };
 		4450FC9E21F5F602004DFA56 /* QuickLookSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuickLookSoftLink.h; sourceTree = "<group>"; };
+		44E1A8AD21FA54DA00C3048E /* LookupSoftLink.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LookupSoftLink.h; sourceTree = "<group>"; };
+		44E1A8AE21FA54DA00C3048E /* LookupSoftLink.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = LookupSoftLink.mm; sourceTree = "<group>"; };
 		570AB8F020AE2E8D00B8BE87 /* SecKeyProxySPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SecKeyProxySPI.h; sourceTree = "<group>"; };
 		570AB8F820AF6E3D00B8BE87 /* NSXPCConnectionSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSXPCConnectionSPI.h; sourceTree = "<group>"; };
 		63E369F921AFA83F001C14BC /* NSProgressSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NSProgressSPI.h; sourceTree = "<group>"; };
@@ -517,6 +521,7 @@
 				1C4876DE1F8D831300CCEEBD /* cocoa */,
 				1C09D0511E31C41200725F18 /* crypto */,
 				2E87C06E215A993100D6CD32 /* ios */,
+				44E1A8AC21FA548F00C3048E /* mac */,
 				0C2DA0651F33CA3300DBC317 /* spi */,
 				A3788E9F1F05B7CE00679425 /* system */,
 				A30D411D1F0DD0AC00B71954 /* text */,
@@ -585,6 +590,15 @@
 			path = ios;
 			sourceTree = "<group>";
 		};
+		44E1A8AC21FA548F00C3048E /* mac */ = {
+			isa = PBXGroup;
+			children = (
+				44E1A8AD21FA54DA00C3048E /* LookupSoftLink.h */,
+				44E1A8AE21FA54DA00C3048E /* LookupSoftLink.mm */,
+			);
+			path = mac;
+			sourceTree = "<group>";
+		};
 		A30D411D1F0DD0AC00B71954 /* text */ = {
 			isa = PBXGroup;
 			children = (
@@ -693,6 +707,7 @@
 				A30D41211F0DD0EA00B71954 /* KillRing.h in Headers */,
 				0C5AF91C1F43A4C7002EAC02 /* LaunchServicesSPI.h in Headers */,
 				1C4876D91F8D7F4E00CCEEBD /* Logging.h in Headers */,
+				44E1A8AF21FA54E600C3048E /* LookupSoftLink.h in Headers */,
 				0C77858B1F45130F00F4EBB6 /* LookupSPI.h in Headers */,
 				0C2DA1481F3BEB4900DBC317 /* MachVMSPI.h in Headers */,
 				0C5AF91D1F43A4C7002EAC02 /* MediaPlayerSPI.h in Headers */,
@@ -867,6 +882,7 @@
 				A30D41221F0DD0EA00B71954 /* KillRing.cpp in Sources */,
 				A30D41251F0DD12D00B71954 /* KillRingMac.mm in Sources */,
 				1C4876D81F8D7F4E00CCEEBD /* Logging.cpp in Sources */,
+				44E1A8B021FA54EB00C3048E /* LookupSoftLink.mm in Sources */,
 				0CF99CA41F736375007EE793 /* MediaTimeAVFoundation.cpp in Sources */,
 				A1F63CA021A4DBF7006FB43B /* PassKitSoftLink.mm in Sources */,
 				A1175B4F1F6B337300C4B9F0 /* PopupMenu.mm in Sources */,

Modified: trunk/Source/WebCore/PAL/pal/PlatformMac.cmake (240493 => 240494)


--- trunk/Source/WebCore/PAL/pal/PlatformMac.cmake	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/PAL/pal/PlatformMac.cmake	2019-01-25 20:24:14 UTC (rev 240494)
@@ -5,6 +5,8 @@
 
     cocoa/PassKitSoftLink.h
 
+    mac/LookupSoftLink.h
+
     spi/cf/CFLocaleSPI.h
     spi/cf/CFNetworkConnectionCacheSPI.h
     spi/cf/CFNetworkSPI.h
@@ -107,6 +109,8 @@
 
     crypto/commoncrypto/CryptoDigestCommonCrypto.cpp
 
+    mac/LookupSoftLink.mm
+
     system/cocoa/SleepDisablerCocoa.cpp
 
     system/mac/ClockCM.mm

Modified: trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h (240493 => 240494)


--- trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.h	2019-01-25 20:24:14 UTC (rev 240494)
@@ -34,6 +34,7 @@
 
 SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, UIKit)
 
+SOFT_LINK_CONSTANT_FOR_HEADER(PAL, UIKit, UIAccessibilityAnnouncementNotification, UIAccessibilityNotifications)
 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, UIKit, UIApplicationWillResignActiveNotification, NSNotificationName)
 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, UIKit, UIApplicationWillEnterForegroundNotification, NSNotificationName)
 SOFT_LINK_CONSTANT_FOR_HEADER(PAL, UIKit, UIApplicationDidBecomeActiveNotification, NSNotificationName)
@@ -63,6 +64,5 @@
 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityIsReduceMotionEnabled, BOOL, (void), ())
 SOFT_LINK_FUNCTION_FOR_HEADER(PAL, UIKit, UIAccessibilityPostNotification, void, (UIAccessibilityNotifications n, id argument), (n, argument))
-SOFT_LINK_VARIABLE_FOR_HEADER(PAL, UIKit, UIAccessibilityAnnouncementNotification, UIAccessibilityNotifications)
 
 #endif

Modified: trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm (240493 => 240494)


--- trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/PAL/pal/ios/UIKitSoftLink.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -34,6 +34,7 @@
 
 SOFT_LINK_FRAMEWORK_FOR_SOURCE(PAL, UIKit)
 
+SOFT_LINK_CONSTANT_FOR_SOURCE(PAL, UIKit, UIAccessibilityAnnouncementNotification, UIAccessibilityNotifications)
 SOFT_LINK_CONSTANT_FOR_SOURCE(PAL, UIKit, UIApplicationWillResignActiveNotification, NSNotificationName)
 SOFT_LINK_CONSTANT_FOR_SOURCE(PAL, UIKit, UIApplicationWillEnterForegroundNotification, NSNotificationName)
 SOFT_LINK_CONSTANT_FOR_SOURCE(PAL, UIKit, UIApplicationDidBecomeActiveNotification, NSNotificationName)
@@ -63,6 +64,5 @@
 SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, UIKit, UIAccessibilityIsInvertColorsEnabled, BOOL, (void), ())
 SOFT_LINK_FUNCTION_FOR_SOURCE_WITH_EXPORT(PAL, UIKit, UIAccessibilityIsReduceMotionEnabled, BOOL, (void), (), PAL_EXPORT)
 SOFT_LINK_FUNCTION_FOR_SOURCE(PAL, UIKit, UIAccessibilityPostNotification, void, (UIAccessibilityNotifications n, id argument), (n, argument))
-SOFT_LINK_VARIABLE_FOR_SOURCE(PAL, UIKit, UIAccessibilityAnnouncementNotification, UIAccessibilityNotifications)
 
 #endif

Copied: trunk/Source/WebCore/PAL/pal/mac/LookupSoftLink.h (from rev 240493, trunk/Source/WebCore/PAL/pal/spi/mac/LookupSPI.h) (0 => 240494)


--- trunk/Source/WebCore/PAL/pal/mac/LookupSoftLink.h	                        (rev 0)
+++ trunk/Source/WebCore/PAL/pal/mac/LookupSoftLink.h	2019-01-25 20:24:14 UTC (rev 240494)
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2014-2019 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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.
+ */
+
+#if PLATFORM(MAC)
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_FRAMEWORK_FOR_HEADER(PAL, Lookup)
+SOFT_LINK_CLASS_FOR_HEADER(PAL, LULookupDefinitionModule)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
+
+#if !ENABLE(REVEAL)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_HEADER(PAL, Lookup, LUNotificationPopoverWillClose, NSString *)
+#endif
+
+#endif // PLATFORM(MAC)

Copied: trunk/Source/WebCore/PAL/pal/mac/LookupSoftLink.mm (from rev 240493, trunk/Source/WebCore/PAL/pal/spi/mac/LookupSPI.h) (0 => 240494)


--- trunk/Source/WebCore/PAL/pal/mac/LookupSoftLink.mm	                        (rev 0)
+++ trunk/Source/WebCore/PAL/pal/mac/LookupSoftLink.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2014-2019 Apple Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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.
+ */
+
+#include "config.h"
+
+#if PLATFORM(MAC)
+
+#import <wtf/SoftLinking.h>
+
+SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(PAL, Lookup)
+SOFT_LINK_CLASS_FOR_SOURCE_OPTIONAL_WITH_EXPORT(PAL, Lookup, LULookupDefinitionModule, PAL_EXPORT)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE(PAL, Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
+
+#if !ENABLE(REVEAL)
+SOFT_LINK_CONSTANT_MAY_FAIL_FOR_SOURCE_WITH_EXPORT(PAL, Lookup, LUNotificationPopoverWillClose, NSString *, PAL_EXPORT)
+#endif
+
+#endif // PLATFORM(MAC)

Modified: trunk/Source/WebCore/PAL/pal/spi/mac/LookupSPI.h (240493 => 240494)


--- trunk/Source/WebCore/PAL/pal/spi/mac/LookupSPI.h	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/PAL/pal/spi/mac/LookupSPI.h	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc.  All rights reserved.
+ * Copyright (C) 2014-2019 Apple Inc.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -20,19 +20,15 @@
  * 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. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-
 #if PLATFORM(MAC)
 
 #import <objc/runtime.h>
+#import <pal/mac/LookupSoftLink.h>
 #import <pal/spi/mac/NSImmediateActionGestureRecognizerSPI.h>
-#import <wtf/SoftLinking.h>
 
-SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(Lookup)
-SOFT_LINK_CLASS_OPTIONAL(Lookup, LULookupDefinitionModule)
-
 #if USE(APPLE_INTERNAL_SDK)
 
 #import <Lookup/Lookup.h>

Modified: trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm (240493 => 240494)


--- trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/editing/cocoa/DictionaryLookup.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -50,7 +50,6 @@
 #import <pal/spi/cg/CoreGraphicsSPI.h>
 #import <pal/spi/cocoa/RevealSPI.h>
 #import <pal/spi/ios/UIKitSPI.h>
-#import <pal/spi/mac/LookupSPI.h>
 #import <wtf/BlockObjCExceptions.h>
 #import <wtf/RefPtr.h>
 

Modified: trunk/Source/WebCore/editing/mac/DictionaryLookupLegacy.mm (240493 => 240494)


--- trunk/Source/WebCore/editing/mac/DictionaryLookupLegacy.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/editing/mac/DictionaryLookupLegacy.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -48,18 +48,16 @@
 #import <wtf/BlockObjCExceptions.h>
 #import <wtf/RefPtr.h>
 
-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
-
 namespace WebCore {
 
 static NSRange tokenRange(const String& string, NSRange range, NSDictionary **options)
 {
-    if (!getLULookupDefinitionModuleClass())
+    if (!PAL::getLULookupDefinitionModuleClass())
         return NSMakeRange(NSNotFound, 0);
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    return [classLULookupDefinitionModule tokenRangeForString:string range:range options:options];
+    return [PAL::getLULookupDefinitionModuleClass() tokenRangeForString:string range:range options:options];
 
     END_BLOCK_OBJC_EXCEPTIONS;
 
@@ -206,7 +204,7 @@
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    if (!getLULookupDefinitionModuleClass())
+    if (!PAL::getLULookupDefinitionModuleClass())
         return nil;
 
     RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);
@@ -215,9 +213,9 @@
 
     auto textIndicator = TextIndicator::create(dictionaryPopupInfo.textIndicator);
 
-    if (canLoadLUTermOptionDisableSearchTermIndicator() && textIndicator.get().contentImage()) {
+    if (PAL::canLoad_Lookup_LUTermOptionDisableSearchTermIndicator() && textIndicator.get().contentImage()) {
         textIndicatorInstallationCallback(textIndicator.get());
-        [mutableOptions setObject:@YES forKey:getLUTermOptionDisableSearchTermIndicator()];
+        [mutableOptions setObject:@YES forKey:PAL::get_Lookup_LUTermOptionDisableSearchTermIndicator()];
 
         FloatRect firstTextRectInViewCoordinates = textIndicator.get().textRectsInBoundingRectCoordinates()[0];
         FloatRect textBoundingRectInViewCoordinates = textIndicator.get().textBoundingRectInRootViewCoordinates();
@@ -225,9 +223,9 @@
             textBoundingRectInViewCoordinates = rootViewToViewConversionCallback(textBoundingRectInViewCoordinates);
         firstTextRectInViewCoordinates.moveBy(textBoundingRectInViewCoordinates.location());
         if (createAnimationController)
-            return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:firstTextRectInViewCoordinates ofView:view options:mutableOptions.get()];
+            return [PAL::getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:firstTextRectInViewCoordinates ofView:view options:mutableOptions.get()];
 
-        [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:firstTextRectInViewCoordinates ofView:view options:mutableOptions.get()];
+        [PAL::getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() relativeToRect:firstTextRectInViewCoordinates ofView:view options:mutableOptions.get()];
         return nil;
     }
 
@@ -238,9 +236,9 @@
     textBaselineOrigin = [view.window convertRectToScreen:NSMakeRect(textBaselineOrigin.x, textBaselineOrigin.y, 0, 0)].origin;
 
     if (createAnimationController)
-        return [getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+        return [PAL::getLULookupDefinitionModuleClass() lookupAnimationControllerForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
 
-    [getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
+    [PAL::getLULookupDefinitionModuleClass() showDefinitionForTerm:dictionaryPopupInfo.attributedString.get() atLocation:textBaselineOrigin options:mutableOptions.get()];
     return nil;
 
     END_BLOCK_OBJC_EXCEPTIONS;
@@ -258,9 +256,9 @@
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
 
-    if (!getLULookupDefinitionModuleClass())
+    if (!PAL::getLULookupDefinitionModuleClass())
         return;
-    [getLULookupDefinitionModuleClass() hideDefinition];
+    [PAL::getLULookupDefinitionModuleClass() hideDefinition];
 
     END_BLOCK_OBJC_EXCEPTIONS;
 }

Modified: trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm (240493 => 240494)


--- trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebCore/platform/ios/ValidationBubbleIOS.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -135,7 +135,7 @@
         [protectedThis->m_popoverController.get().view setAccessibilityElementsHidden:YES];
     }];
 
-    PAL::softLinkUIKitUIAccessibilityPostNotification(*PAL::get_UIKit_UIAccessibilityAnnouncementNotification(), m_message);
+    PAL::softLinkUIKitUIAccessibilityPostNotification(PAL::get_UIKit_UIAccessibilityAnnouncementNotification(), m_message);
 }
 
 static UIViewController *fallbackViewController(UIView *view)

Modified: trunk/Source/WebKit/ChangeLog (240493 => 240494)


--- trunk/Source/WebKit/ChangeLog	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebKit/ChangeLog	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,3 +1,15 @@
+2019-01-25  David Kilzer  <ddkil...@apple.com>
+
+        Move soft-linking of Lookup.framework out of LookupSPI.h
+        <https://webkit.org/b/193815>
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (-[WKWindowVisibilityObserver dealloc]):
+        (-[WKWindowVisibilityObserver startObservingLookupDismissalIfNeeded]):
+        - Move soft-linking to LookupSoftLink.{h,mm}.
+
 2019-01-25  Antti Koivisto  <an...@apple.com>
 
         REGRESSION (PSON): After swipe back, first few attempts to swipe forward not recognized as swipe gestures

Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (240493 => 240494)


--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2015-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -135,10 +135,6 @@
 static NSString * const WKMediaExitFullScreenItem = @"WKMediaExitFullScreenItem";
 #endif // HAVE(TOUCH_BAR) && ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
 
-#if PLATFORM(MAC) && !ENABLE(REVEAL)
-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
-#endif // ENABLE(REVEAL)
-
 WTF_DECLARE_CF_TYPE_TRAIT(CGImage);
 
 @interface NSApplication ()
@@ -233,8 +229,8 @@
 - (void)dealloc
 {
 #if !ENABLE(REVEAL)
-    if (_didRegisterForLookupPopoverCloseNotifications && canLoadLUNotificationPopoverWillClose())
-        [[NSNotificationCenter defaultCenter] removeObserver:self name:getLUNotificationPopoverWillClose() object:nil];
+    if (_didRegisterForLookupPopoverCloseNotifications && PAL::canLoad_Lookup_LUNotificationPopoverWillClose())
+        [[NSNotificationCenter defaultCenter] removeObserver:self name:PAL::get_Lookup_LUNotificationPopoverWillClose() object:nil];
 #endif // !ENABLE(REVEAL)
 
     NSNotificationCenter *workspaceNotificationCenter = [[NSWorkspace sharedWorkspace] notificationCenter];
@@ -310,8 +306,8 @@
 
     _didRegisterForLookupPopoverCloseNotifications = YES;
 #if !ENABLE(REVEAL)
-    if (canLoadLUNotificationPopoverWillClose())
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
+    if (PAL::canLoad_Lookup_LUNotificationPopoverWillClose())
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:PAL::get_Lookup_LUNotificationPopoverWillClose() object:nil];
 #endif
 }
 

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (240493 => 240494)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,3 +1,16 @@
+2019-01-25  David Kilzer  <ddkil...@apple.com>
+
+        Move soft-linking of Lookup.framework out of LookupSPI.h
+        <https://webkit.org/b/193815>
+
+        Reviewed by Tim Horton.
+
+        * WebView/WebImmediateActionController.mm:
+        (-[WebImmediateActionController _animationControllerForText]):
+        * WebView/WebView.mm:
+        (-[WebView _prepareForDictionaryLookup]):
+        - Move soft-linking to LookupSoftLink.{h,mm}.
+
 2019-01-25  Wenson Hsieh  <wenson_hs...@apple.com>
 
         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm (240493 => 240494)


--- trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebImmediateActionController.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2014-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -547,7 +547,7 @@
 
 - (id<NSImmediateActionAnimationController>)_animationControllerForText
 {
-    if (!getLULookupDefinitionModuleClass())
+    if (!PAL::getLULookupDefinitionModuleClass())
         return nil;
 
     Node* node = _hitTestResult.innerNode();

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (240493 => 240494)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2019-01-25 20:20:17 UTC (rev 240493)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2019-01-25 20:24:14 UTC (rev 240494)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005-2018 Apple Inc. All rights reserved.
+ * Copyright (C) 2005-2019 Apple Inc. All rights reserved.
  * Copyright (C) 2006 David Smith (catfish....@gmail.com)
  * Copyright (C) 2010 Igalia S.L
  *
@@ -352,10 +352,6 @@
 #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101300
 #endif // HAVE(TOUCH_BAR) && ENABLE(WEB_PLAYBACK_CONTROLS_MANAGER)
 
-#if PLATFORM(MAC) && !ENABLE(REVEAL)
-SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
-#endif
-
 #if !PLATFORM(IOS_FAMILY)
 
 @interface NSSpellChecker (WebNSSpellCheckerDetails)
@@ -9618,8 +9614,8 @@
     _private->hasInitializedLookupObserver = YES;
     
 #if !ENABLE(REVEAL)
-    if (canLoadLUNotificationPopoverWillClose())
-        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:getLUNotificationPopoverWillClose() object:nil];
+    if (PAL::canLoad_Lookup_LUNotificationPopoverWillClose())
+        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_dictionaryLookupPopoverWillClose:) name:PAL::get_Lookup_LUNotificationPopoverWillClose() object:nil];
 #endif // !ENABLE(REVEAL)
     
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to