⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176682 in webkit


Ignore:
Timestamp:
Dec 2, 2014, 11:49:34 AM (12 years ago)
Author:
timothy_horton@apple.com
Message:

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.

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176675 r176682  
     12014-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
    1182014-12-02  Anders Carlsson  <andersca@apple.com>
    219
  • trunk/Source/WebCore/page/mac/ServicesOverlayController.mm

    r176592 r176682  
    3131#import "Chrome.h"
    3232#import "ChromeClient.h"
     33#import "DataDetectorsSPI.h"
    3334#import "Document.h"
    3435#import "Editor.h"
     
    5152#import <QuartzCore/QuartzCore.h>
    5253
    53 #if __has_include(<DataDetectors/DDHighlightDrawing.h>)
    54 #import <DataDetectors/DDHighlightDrawing.h>
    55 #else
    56 typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
    57 #endif
    58 
    59 #if __has_include(<DataDetectors/DDHighlightDrawing_Private.h>)
    60 #import <DataDetectors/DDHighlightDrawing_Private.h>
    61 #endif
    62 
    6354const float highlightFadeAnimationDuration = 0.3;
    6455
    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.
    7057SOFT_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))
    7158SOFT_LINK(DataDetectors, DDHighlightGetLayerWithContext, CGLayerRef, (DDHighlightRef highlight, CGContextRef context), (highlight, context))
     
    512499
    513500            CGRect cgRect = rect;
    514             RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlightOutlineWithArrow, YES, NSWritingDirectionNatural, NO, YES));
     501            RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, &cgRect, 1, mainFrameView.visibleContentRect(), DDHighlightStyleBubbleStandard | DDHighlightStyleStandardIconArrow, YES, NSWritingDirectionNatural, NO, YES));
    515502
    516503            newPotentialHighlights.add(Highlight::createForTelephoneNumber(*this, ddHighlight, range));
     
    556543        if (!cgRects.isEmpty()) {
    557544            CGRect visibleRect = mainFrameView->visibleContentRect();
    558             RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, cgRects.data(), cgRects.size(), visibleRect, DDHighlightNoOutlineWithArrow, YES, NSWritingDirectionNatural, NO, YES));
     545            RetainPtr<DDHighlightRef> ddHighlight = adoptCF(DDHighlightCreateWithRectsInVisibleRectWithStyleAndDirection(nullptr, cgRects.data(), cgRects.size(), visibleRect, DDHighlightStyleBubbleNone | DDHighlightStyleStandardIconArrow | DDHighlightStyleButtonShowAlways, YES, NSWritingDirectionNatural, NO, YES));
    559546           
    560547            newPotentialHighlights.add(Highlight::createForSelection(*this, ddHighlight, selectionRange));
  • trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h

    r176477 r176682  
    2727#import <objc/runtime.h>
    2828
     29// FIXME: This header should include various DataDetectors SPI headers if using the internal SDK.
     30
    2931typedef struct __DDScanner DDScanner, *DDScannerRef;
    3032typedef struct __DDScanQuery *DDScanQueryRef;
    3133typedef struct __DDResult *DDResultRef;
     34typedef struct __DDHighlight DDHighlight, *DDHighlightRef;
    3235
    3336typedef enum {
     
    7376
    7477@end
     78
     79enum {
     80    DDHighlightStyleBubbleNone = 0,
     81    DDHighlightStyleBubbleStandard = 1
     82};
     83
     84enum {
     85    DDHighlightStyleIconNone = (0 << 16),
     86    DDHighlightStyleStandardIconArrow = (1 << 16)
     87};
     88
     89enum {
     90    DDHighlightStyleButtonShowAlways  = (1 << 24),
     91};
     92
     93typedef NSUInteger DDHighlightStyle;
    7594#endif
    7695
Note: See TracChangeset for help on using the changeset viewer.