Changeset 176682 in webkit
- Timestamp:
- Dec 2, 2014, 11:49:34 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
page/mac/ServicesOverlayController.mm (modified) (4 diffs)
-
platform/spi/mac/DataDetectorsSPI.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r176675 r176682 1 2014-12-02 Tim Horton <timothy_horton@apple.com> 2 3 Always show the arrow for text selection services 4 https://bugs.webkit.org/show_bug.cgi?id=139191 5 <rdar://problem/18903995> 6 7 Reviewed by Anders Carlsson. 8 9 * platform/spi/mac/DataDetectorsSPI.h: 10 * page/mac/ServicesOverlayController.mm: 11 Move a few things to DataDetectorsSPI.h. 12 13 (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): 14 (WebCore::ServicesOverlayController::buildSelectionHighlight): 15 Make use of the real DDHighlightStyle names. 16 Add DDHighlightStyleButtonShowAlways for selection services. 17 1 18 2014-12-02 Anders Carlsson <andersca@apple.com> 2 19 -
trunk/Source/WebCore/page/mac/ServicesOverlayController.mm
r176592 r176682 31 31 #import "Chrome.h" 32 32 #import "ChromeClient.h" 33 #import "DataDetectorsSPI.h" 33 34 #import "Document.h" 34 35 #import "Editor.h" … … 51 52 #import <QuartzCore/QuartzCore.h> 52 53 53 #if __has_include(<DataDetectors/DDHighlightDrawing.h>)54 #import <DataDetectors/DDHighlightDrawing.h>55 #else56 typedef struct __DDHighlight DDHighlight, *DDHighlightRef;57 #endif58 59 #if __has_include(<DataDetectors/DDHighlightDrawing_Private.h>)60 #import <DataDetectors/DDHighlightDrawing_Private.h>61 #endif62 63 54 const float highlightFadeAnimationDuration = 0.3; 64 55 65 typedef NSUInteger DDHighlightStyle; 66 static const DDHighlightStyle DDHighlightNoOutlineWithArrow = (1 << 16); 67 static const DDHighlightStyle DDHighlightOutlineWithArrow = (1 << 16) | 1; 68 69 SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL(DataDetectors) 56 // FIXME: Move more of this to DataDetectorsSPI.h. 70 57 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)) 71 58 SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context)) … … 512 499 513 500 CGRect cgRect = rect; 514 RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlight OutlineWithArrow, YES, NSWritingDirectionNatural, NO, YES));501 RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlightStyleBubbleStandard | DDHighlightStyleStandardIconArrow, YES, NSWritingDirectionNatural, NO, YES)); 515 502 516 503 newPotentialHighlights.add(Highlight::createForTelephoneNumber(*this, ddHighlight, range)); … … 556 543 if (!cgRects.isEmpty()) { 557 544 CGRect visibleRect = mainFrameView->visibleContentRect(); 558 RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, cgRects.data(), cgRects.size(), visibleRect, DDHighlight NoOutlineWithArrow, YES, NSWritingDirectionNatural, NO, YES));545 RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, cgRects.data(), cgRects.size(), visibleRect, DDHighlightStyleBubbleNone | DDHighlightStyleStandardIconArrow | DDHighlightStyleButtonShowAlways, YES, NSWritingDirectionNatural, NO, YES)); 559 546 560 547 newPotentialHighlights.add(Highlight::createForSelection(*this, ddHighlight, selectionRange)); -
trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h
r176477 r176682 27 27 #import <objc/runtime.h> 28 28 29 // FIXME: This header should include various DataDetectors SPI headers if using the internal SDK. 30 29 31 typedef struct __DDScanner DDScanner, *DDScannerRef; 30 32 typedef struct __DDScanQuery *DDScanQueryRef; 31 33 typedef struct __DDResult *DDResultRef; 34 typedef struct __DDHighlight DDHighlight, *DDHighlightRef; 32 35 33 36 typedef enum { … … 73 76 74 77 @end 78 79 enum { 80 DDHighlightStyleBubbleNone = 0, 81 DDHighlightStyleBubbleStandard = 1 82 }; 83 84 enum { 85 DDHighlightStyleIconNone = (0 << 16), 86 DDHighlightStyleStandardIconArrow = (1 << 16) 87 }; 88 89 enum { 90 DDHighlightStyleButtonShowAlways = (1 << 24), 91 }; 92 93 typedef NSUInteger DDHighlightStyle; 75 94 #endif 76 95
Note:
See TracChangeset
for help on using the changeset viewer.