Title: [176808] branches/safari-600.3-branch/Source/WebCore

Diff

Modified: branches/safari-600.3-branch/Source/WebCore/ChangeLog (176807 => 176808)


--- branches/safari-600.3-branch/Source/WebCore/ChangeLog	2014-12-04 19:47:31 UTC (rev 176807)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog	2014-12-04 19:54:16 UTC (rev 176808)
@@ -1,5 +1,26 @@
 2014-12-04  Dana Burkart  <[email protected]>
 
+        Merge r176682. <rdar://problem/18903995>
+
+    2014-12-02  Tim Horton  <[email protected]>
+
+            Always show the arrow for text selection services
+            https://bugs.webkit.org/show_bug.cgi?id=139191
+            <rdar://problem/18903995>
+
+            Reviewed by Anders Carlsson.
+
+            * platform/spi/mac/DataDetectorsSPI.h:
+            * page/mac/ServicesOverlayController.mm:
+            Move a few things to DataDetectorsSPI.h.
+
+            (WebCore::ServicesOverlayController::buildPhoneNumberHighlights):
+            (WebCore::ServicesOverlayController::buildSelectionHighlight):
+            Make use of the real DDHighlightStyle names.
+            Add DDHighlightStyleButtonShowAlways for selection services.
+
+2014-12-04  Dana Burkart  <[email protected]>
+
         Merge r176766. <rdar://problem/19072083>
 
     2014-12-03  Beth Dakin  <[email protected]> 

Modified: branches/safari-600.3-branch/Source/WebCore/page/mac/ServicesOverlayController.mm (176807 => 176808)


--- branches/safari-600.3-branch/Source/WebCore/page/mac/ServicesOverlayController.mm	2014-12-04 19:47:31 UTC (rev 176807)
+++ branches/safari-600.3-branch/Source/WebCore/page/mac/ServicesOverlayController.mm	2014-12-04 19:54:16 UTC (rev 176808)
@@ -30,6 +30,7 @@
 
 #import "Chrome.h"
 #import "ChromeClient.h"
+#import "DataDetectorsSPI.h"
 #import "Document.h"
 #import "Editor.h"
 #import "EventHandler.h"
@@ -50,23 +51,9 @@
 #import "SoftLinking.h"
 #import <QuartzCore/QuartzCore.h>
 
-#if __has_include(<DataDetectors/DDHighlightDrawing.h>)
-#import <DataDetectors/DDHighlightDrawing.h>
-#else
-typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
-#endif
-
-#if __has_include(<DataDetectors/DDHighlightDrawing_Private.h>)
-#import <DataDetectors/DDHighlightDrawing_Private.h>
-#endif
-
 const float highlightFadeAnimationDuration = 0.3;
 
-typedef NSUInteger DDHighlightStyle;
-static const DDHighlightStyle DDHighlightNoOutlineWithArrow = (1 << 16);
-static const DDHighlightStyle DDHighlightOutlineWithArrow = (1 << 16) | 1;
-
-SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors)
+// FIXME: Move more of this to DataDetectorsSPI.h.
 SOFT_LINK(DataDetectors, DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection, DDHighlightRef, (CFAllocatorRef allocator, CGRect* rects, CFIndex count, CGRect globalVisibleRect, DDHighlightStyle style, Boolean withArrow, NSWritingDirection writingDirection, Boolean endsWithEOL, Boolean flipped), (allocator, rects, count, globalVisibleRect, style, withArrow, writingDirection, endsWithEOL, flipped))
 SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
 SOFT_LINK(DataDetectors, DDHighlightGetBoundingRect, CGRect, (DDHighlightRef highlight), (highlight))
@@ -511,7 +498,7 @@
             rect.setLocation(mainFrameView.windowToContents(viewForRange->contentsToWindow(rect.location())));
 
             CGRect cgRect = rect;
-            RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlightOutlineWithArrow, YES, NSWritingDirectionNatural, NO, YES));
+            RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlightStyleBubbleStandard | DDHighlightStyleStandardIconArrow, YES, NSWritingDirectionNatural, NO, YES));
 
             newPotentialHighlights.add(Highlight::createForTelephoneNumber(*this, ddHighlight, range));
         }
@@ -555,7 +542,7 @@
 
         if (!cgRects.isEmpty()) {
             CGRect visibleRect = mainFrameView->visibleContentRect();
-            RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, cgRects.begin(), cgRects.size(), visibleRect, DDHighlightNoOutlineWithArrow, YES, NSWritingDirectionNatural, NO, YES));
+            RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, cgRects.begin(), cgRects.size(), visibleRect, DDHighlightStyleBubbleNone | DDHighlightStyleStandardIconArrow | DDHighlightStyleButtonShowAlways, YES, NSWritingDirectionNatural, NO, YES));
             
             newPotentialHighlights.add(Highlight::createForSelection(*this, ddHighlight, selectionRange));
         }

Modified: branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h (176807 => 176808)


--- branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h	2014-12-04 19:47:31 UTC (rev 176807)
+++ branches/safari-600.3-branch/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h	2014-12-04 19:54:16 UTC (rev 176808)
@@ -26,9 +26,12 @@
 #import "SoftLinking.h"
 #import <objc/runtime.h>
 
+// FIXME: This header should include various DataDetectors SPI headers if using the internal SDK.
+
 typedef struct __DDScanner DDScanner, *DDScannerRef;
 typedef struct __DDScanQuery *DDScanQueryRef;
 typedef struct __DDResult *DDResultRef;
+typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
 
 typedef enum {
     DDScannerTypeStandard = 0,
@@ -72,6 +75,22 @@
 - (DDActionContext *)contextForView:(NSView *)view altMode:(BOOL)altMode interactionStartedHandler:(void (^)(void))interactionStartedHandler interactionChangedHandler:(void (^)(void))interactionChangedHandler interactionStoppedHandler:(void (^)(void))interactionStoppedHandler;
 
 @end
+
+enum {
+    DDHighlightStyleBubbleNone = 0,
+    DDHighlightStyleBubbleStandard = 1
+};
+
+enum {
+    DDHighlightStyleIconNone = (0 << 16),
+    DDHighlightStyleStandardIconArrow = (1 << 16)
+};
+
+enum {
+    DDHighlightStyleButtonShowAlways  = (1 << 24),
+};
+
+typedef NSUInteger DDHighlightStyle;
 #endif
 
 SOFT_LINK_CLASS(DataDetectors, DDActionsManager)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to