Changeset 246544 in webkit


Ignore:
Timestamp:
Jun 18, 2019 9:48:34 AM (5 years ago)
Author:
Truitt Savell
Message:

Unreviewed, rolling out r246531.

Broke internal builds.

Reverted changeset:

"Expose DataDetectors context generation on
WKContentViewInteraction"
https://bugs.webkit.org/show_bug.cgi?id=198950
https://trac.webkit.org/changeset/246531

Location:
trunk/Source/WebKit
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r246538 r246544  
     12019-06-18  Truitt Savell  <tsavell@apple.com>
     2
     3        Unreviewed, rolling out r246531.
     4
     5        Broke internal builds.
     6
     7        Reverted changeset:
     8
     9        "Expose DataDetectors context generation on
     10        WKContentViewInteraction"
     11        https://bugs.webkit.org/show_bug.cgi?id=198950
     12        https://trac.webkit.org/changeset/246531
     13
    1142019-06-18  Simon Fraser  <simon.fraser@apple.com>
    215
  • trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h

    r246531 r246544  
    8383- (void)interactionDidStartWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)information;
    8484- (NSArray *)currentAvailableActionTitles;
    85 - (Optional<WebKit::InteractionInformationAtPosition>)currentPositionInformation;
    8685@end
    8786
  • trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm

    r246531 r246544  
    326326}
    327327
    328 - (Optional<WebKit::InteractionInformationAtPosition>)currentPositionInformation
    329 {
    330     return _positionInformation;
    331 }
    332 
    333328- (void)_createSheetWithElementActions:(NSArray *)actions defaultTitle:(NSString *)defaultTitle showLinkTitle:(BOOL)showLinkTitle
    334329{
     
    652647    NSDictionary *context = nil;
    653648    NSString *textAtSelection = nil;
     649    RetainPtr<NSMutableDictionary> extendedContext;
    654650
    655651    if ([_delegate respondsToSelector:@selector(dataDetectionContextForActionSheetAssistant:)])
     
    657653    if ([_delegate respondsToSelector:@selector(selectedTextForActionSheetAssistant:)])
    658654        textAtSelection = [_delegate selectedTextForActionSheetAssistant:self];
     655    if (!_positionInformation->textBefore.isEmpty() || !_positionInformation->textAfter.isEmpty()) {
     656        extendedContext = adoptNS([@{
     657            getkDataDetectorsLeadingText() : _positionInformation->textBefore,
     658            getkDataDetectorsTrailingText() : _positionInformation->textAfter,
     659        } mutableCopy]);
     660       
     661        if (context)
     662            [extendedContext addEntriesFromDictionary:context];
     663        context = extendedContext.get();
     664    }
    659665
    660666    if ([controller respondsToSelector:@selector(shouldImmediatelyLaunchDefaultActionForURL:)] && [controller shouldImmediatelyLaunchDefaultActionForURL:targetURL]) {
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r246531 r246544  
    471471- (WKFormInputSession *)_formInputSession;
    472472- (void)_didChangeWebViewEditability;
    473 - (NSDictionary *)dataDetectionContextForPositionInformation:(WebKit::InteractionInformationAtPosition)positionInformation;
    474473
    475474- (void)willFinishIgnoringCalloutBarFadeAfterPerformingAction;
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r246531 r246544  
    61406140}
    61416141
    6142 - (NSDictionary *)dataDetectionContextForPositionInformation:(WebKit::InteractionInformationAtPosition)positionInformation
    6143 {
    6144     RetainPtr<NSMutableDictionary> context;
     6142- (NSDictionary *)dataDetectionContextForActionSheetAssistant:(WKActionSheetAssistant *)assistant
     6143{
     6144    NSDictionary *context = nil;
    61456145    id <WKUIDelegatePrivate> uiDelegate = static_cast<id <WKUIDelegatePrivate>>([_webView UIDelegate]);
    61466146    if ([uiDelegate respondsToSelector:@selector(_dataDetectionContextForWebView:)])
    6147         context = adoptNS([[uiDelegate _dataDetectionContextForWebView:_webView] mutableCopy]);
    6148    
    6149     if (!context)
    6150         context = adoptNS([[NSMutableDictionary alloc] init]);
    6151    
    6152     if (!positionInformation.textBefore.isEmpty())
    6153         context.get()[getkDataDetectorsLeadingText()] = positionInformation.textBefore;
    6154     if (!positionInformation.textAfter.isEmpty())
    6155         context.get()[getkDataDetectorsTrailingText()] = positionInformation.textAfter;
    6156    
    6157     return context.autorelease();
    6158 }
    6159 
    6160 - (NSDictionary *)dataDetectionContextForActionSheetAssistant:(WKActionSheetAssistant *)assistant
    6161 {
    6162     return [self dataDetectionContextForPositionInformation:assistant.currentPositionInformation.valueOr(_positionInformation)];
     6147        context = [uiDelegate _dataDetectionContextForWebView:_webView];
     6148    return context;
    61636149}
    61646150
Note: See TracChangeset for help on using the changeset viewer.