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

Changeset 176477 in webkit


Ignore:
Timestamp:
Nov 21, 2014, 3:38:19 PM (12 years ago)
Author:
timothy_horton@apple.com
Message:

REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
https://bugs.webkit.org/show_bug.cgi?id=138960
<rdar://problem/19056715>

Reviewed by Anders Carlsson.

  • UIProcess/mac/WKActionMenuController.mm:

(-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
(-[WKActionMenuController _defaultMenuItemsForMailtoLink]): Deleted.

  • WebView/WebActionMenuController.mm:

(-[WebActionMenuController _defaultMenuItemsForMailtoLink]):
(-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
Use DataDetectors SPI instead of an explicit blacklist.

  • platform/spi/mac/DataDetectorsSPI.h:

Add some DataDetectors SPI.

Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r176476 r176477  
     12014-11-21  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
     4        ​https://bugs.webkit.org/show_bug.cgi?id=138960
     5        <rdar://problem/19056715>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * platform/spi/mac/DataDetectorsSPI.h:
     10        Add some DataDetectors SPI.
     11
    1122014-11-21  Jer Noble  <jer.noble@apple.com>
    213
  • trunk/Source/WebCore/platform/spi/mac/DataDetectorsSPI.h

    r176463 r176477  
    6868@property (retain) NSArray *allResults;
    6969@property (retain) __attribute__((NSObject)) DDResultRef mainResult;
    70 @property (assign) BOOL forActionMenuContent;
     70@property (assign) BOOL altMode;
    7171
    7272- (DDActionContext *)contextForView:(NSView *)view altMode:(BOOL)altMode interactionStartedHandler:(void (^)(void))interactionStartedHandler interactionChangedHandler:(void (^)(void))interactionChangedHandler interactionStoppedHandler:(void (^)(void))interactionStoppedHandler;
     
    8787+ (void)didUseActions;
    8888
     89- (BOOL)hasActionsForResult:(DDResultRef)result actionContext:(DDActionContext *)actionContext;
    8990
    9091@end
  • trunk/Source/WebKit/mac/ChangeLog

    r176463 r176477  
     12014-11-21  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
     4        ​https://bugs.webkit.org/show_bug.cgi?id=138960
     5        <rdar://problem/19056715>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * WebView/WebActionMenuController.mm:
     10        (-[WebActionMenuController _defaultMenuItemsForMailtoLink]):
     11        (-[WebActionMenuController _defaultMenuItemsForDataDetectedText]):
     12        Use DataDetectors SPI instead of an explicit blacklist.
     13
    1142014-11-21  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebKit/mac/WebView/WebActionMenuController.mm

    r176463 r176477  
    310310
    311311    RetainPtr<DDActionContext> actionContext = [[getDDActionContextClass() alloc] init];
    312     [actionContext setForActionMenuContent:YES];
     312    [actionContext setAltMode:YES];
    313313
    314314    // FIXME: Should this show a yellow highlight?
     
    573573        return @[ ];
    574574
    575     // Blacklist contact results, because they don't have useful menus. If we
    576     // bail here, before setting up _currentActionContext, we'll still allow fallthrough
    577     // to ordinary text actions, avoiding mysterious failure when a contact is detected.
    578     if (CFEqual(DDResultGetType([actionContext mainResult]), CFSTR("Contact")))
    579         return @[ ];
    580 
     575    [actionContext setAltMode:YES];
     576    if ([[getDDActionsManagerClass() sharedManager] respondsToSelector:@selector(hasActionsForResult:actionContext:)]) {
     577        if (![[getDDActionsManagerClass() sharedManager] hasActionsForResult:[actionContext mainResult] actionContext:actionContext.get()])
     578            return @[ ];
     579    }
    581580
    582581    // FIXME: We should hide/show the yellow highlight here.
  • trunk/Source/WebKit2/ChangeLog

    r176474 r176477  
     12014-11-21  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (r176351): Parts of apple.com/contact aren't Lookup-able
     4        ​https://bugs.webkit.org/show_bug.cgi?id=138960
     5        <rdar://problem/19056715>
     6
     7        Reviewed by Anders Carlsson.
     8
     9        * UIProcess/mac/WKActionMenuController.mm:
     10        (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
     11        (-[WKActionMenuController _defaultMenuItemsForMailtoLink]): Deleted.
     12        Use DataDetectors SPI instead of an explicit blacklist.
     13
    1142014-11-21  Tim Horton  <timothy_horton@apple.com>
    215
  • trunk/Source/WebKit2/UIProcess/mac/WKActionMenuController.mm

    r176463 r176477  
    636636        return @[ ];
    637637
    638     // Blacklist contact results, because they don't have useful menus. If we
    639     // bail here, before setting up _currentActionContext, we'll still allow fallthrough
    640     // to ordinary text actions, avoiding mysterious failure when a contact is detected.
    641     if (CFEqual(DDResultGetType(actionContext.mainResult), CFSTR("Contact")))
    642         return @[ ];
     638    actionContext.altMode = YES;
     639    if ([[getDDActionsManagerClass() sharedManager] respondsToSelector:@selector(hasActionsForResult:actionContext:)]) {
     640        if (![[getDDActionsManagerClass() sharedManager] hasActionsForResult:actionContext.mainResult actionContext:actionContext])
     641            return @[ ];
     642    }
    643643
    644644    // Ref our WebPageProxy for use in the blocks below.
     
    756756    // FIXME: Should this show a yellow highlight?
    757757    RetainPtr<DDActionContext> actionContext = [[getDDActionContextClass() alloc] init];
    758     [actionContext setForActionMenuContent:YES];
     758    [actionContext setAltMode:YES];
    759759    [actionContext setHighlightFrame:[_wkView.window convertRectToScreen:[_wkView convertRect:hitTestResult->elementBoundingBox() toView:nil]]];
    760760    return [[getDDActionsManagerClass() sharedManager] menuItemsForTargetURL:hitTestResult->absoluteLinkURL() actionContext:actionContext.get()];
Note: See TracChangeset for help on using the changeset viewer.