Soft linking to Reveal framework should be optional
authorachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2019 22:31:14 +0000 (22:31 +0000)
committerachristensen@apple.com <achristensen@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 11 Mar 2019 22:31:14 +0000 (22:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195576
<rdar://problem/46822452>

Reviewed by Megan Gardner.

Source/WebCore:

Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.

* editing/cocoa/DictionaryLookup.mm:
(WebCore::showPopupOrCreateAnimationController):

Source/WebCore/PAL:

* pal/spi/cocoa/RevealSPI.h:

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

Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/cocoa/RevealSPI.h
Source/WebCore/editing/cocoa/DictionaryLookup.mm

index 4f862be..619cd6a 100644 (file)
@@ -1,3 +1,16 @@
+2019-03-11  Alex Christensen  <achristensen@webkit.org>
+
+        Soft linking to Reveal framework should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=195576
+        <rdar://problem/46822452>
+
+        Reviewed by Megan Gardner.
+
+        Systems exist with ENABLE(REVEAL) true and the Reveal framework does not exist.
+
+        * editing/cocoa/DictionaryLookup.mm:
+        (WebCore::showPopupOrCreateAnimationController):
+
 2019-03-11  Yusuke Suzuki  <ysuzuki@apple.com>
 
         [JSC] Reduce # of structures in JSGlobalObject initialization
index acbcaa7..5189603 100644 (file)
@@ -1,3 +1,13 @@
+2019-03-11  Alex Christensen  <achristensen@webkit.org>
+
+        Soft linking to Reveal framework should be optional
+        https://bugs.webkit.org/show_bug.cgi?id=195576
+        <rdar://problem/46822452>
+
+        Reviewed by Megan Gardner.
+
+        * pal/spi/cocoa/RevealSPI.h:
+
 2019-03-07  Andy Estes  <aestes@apple.com>
 
         [Apple Pay] Untangle PKPaymentAuthorizationViewController from WebPaymentCoordinatorProxy
index 39dba5c..50c0790 100644 (file)
 #endif // PLATFORM(MAC)
 #import <wtf/SoftLinking.h>
 
-SOFT_LINK_PRIVATE_FRAMEWORK(Reveal)
-SOFT_LINK_PRIVATE_FRAMEWORK(RevealCore)
-SOFT_LINK_CLASS_OPTIONAL(Reveal, RVPresenter)
-SOFT_LINK_CLASS_OPTIONAL(Reveal, RVPresentingContext)
-SOFT_LINK_CLASS_OPTIONAL(RevealCore, RVItem)
-SOFT_LINK_CLASS_OPTIONAL(RevealCore, RVSelection)
-
 #if ENABLE(REVEAL)
 
 #if USE(APPLE_INTERNAL_SDK)
index a010b83..710ddcf 100644 (file)
@@ -68,6 +68,15 @@ SOFT_LINK(UIKitMacHelper, UINSSharedRevealController, id<UINSRevealController>,
 
 #endif // PLATFORM(IOSMAC)
 
+#if ENABLE(REVEAL)
+SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(Reveal)
+SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(RevealCore)
+SOFT_LINK_CLASS_OPTIONAL(Reveal, RVPresenter)
+SOFT_LINK_CLASS_OPTIONAL(Reveal, RVPresentingContext)
+SOFT_LINK_CLASS_OPTIONAL(RevealCore, RVItem)
+SOFT_LINK_CLASS_OPTIONAL(RevealCore, RVSelection)
+#endif
+
 #if PLATFORM(MAC)
 
 @interface WebRevealHighlight <RVPresenterHighlightDelegate> : NSObject {
@@ -266,7 +275,7 @@ std::tuple<RefPtr<Range>, NSDictionary *> DictionaryLookup::rangeForSelection(co
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
-    if (!getRVItemClass())
+    if (!RevealLibrary() || !RevealCoreLibrary() || !getRVItemClass())
         return { nullptr, nil };
     
     auto selectedRange = selection.toNormalizedRange();
@@ -301,7 +310,7 @@ std::tuple<RefPtr<Range>, NSDictionary *> DictionaryLookup::rangeAtHitTestResult
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
-    if (!getRVItemClass())
+    if (!RevealLibrary() || !RevealCoreLibrary() || !getRVItemClass())
         return { nullptr, nil };
     
     auto* node = hitTestResult.innerNonSharedNode();
@@ -392,7 +401,7 @@ std::tuple<NSString *, NSDictionary *> DictionaryLookup::stringForPDFSelection(P
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS;
     
-    if (!getRVItemClass())
+    if (!RevealLibrary() || !RevealCoreLibrary() || !getRVItemClass())
         return { nullptr, nil };
 
     // Don't do anything if there is no character at the point.
@@ -436,7 +445,7 @@ static WKRevealController showPopupOrCreateAnimationController(bool createAnimat
     
 #if PLATFORM(MAC)
     
-    if (!getRVItemClass() || !getRVPresenterClass())
+    if (!RevealLibrary() || !RevealCoreLibrary() || !getRVItemClass() || !getRVPresenterClass())
         return nil;
 
     RetainPtr<NSMutableDictionary> mutableOptions = adoptNS([[NSMutableDictionary alloc] init]);