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

Changeset 248371 in webkit


Ignore:
Timestamp:
Aug 7, 2019, 10:19:08 AM (7 years ago)
Author:
Ryan Haddad
Message:

Unreviewed, rolling out r248330.

Breaks internal builds.

Reverted changeset:

"Context menu on a universal link produces a blank preview"
https://bugs.webkit.org/show_bug.cgi?id=200485
https://trac.webkit.org/changeset/248330

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/ChangeLog

    r248366 r248371  
     12019-08-07  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r248330.
     4
     5        Breaks internal builds.
     6
     7        Reverted changeset:
     8
     9        "Context menu on a universal link produces a blank preview"
     10        https://bugs.webkit.org/show_bug.cgi?id=200485
     11        https://trac.webkit.org/changeset/248330
     12
    1132019-08-07  Youenn Fablet  <youenn@apple.com>
    214
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h

    r248330 r248371  
    3333#import <CoreServices/CoreServicesPriv.h>
    3434#elif PLATFORM(IOS_FAMILY)
    35 #import <CoreServices/LSURLOverridePriv.h>
    3635#import <MobileCoreServices/LSAppLinkPriv.h>
    3736#endif
    3837
    39 #endif // USE(APPLE_INTERNAL_SDK)
     38#endif
    4039
    4140#if HAVE(APP_LINKS)
     
    7574#endif
    7675
    77 @interface NSURL ()
    78 - (NSURL *)iTunesStoreURL;
    79 @end
    80 
    8176#if PLATFORM(MAC)
    8277enum LSSessionID {
  • trunk/Source/WebKit/ChangeLog

    r248338 r248371  
     12019-08-07  Ryan Haddad  <ryanhaddad@apple.com>
     2
     3        Unreviewed, rolling out r248330.
     4
     5        Breaks internal builds.
     6
     7        Reverted changeset:
     8
     9        "Context menu on a universal link produces a blank preview"
     10        https://bugs.webkit.org/show_bug.cgi?id=200485
     11        https://trac.webkit.org/changeset/248330
     12
    1132019-08-06  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r248330 r248371  
    107107#import <pal/spi/cg/CoreGraphicsSPI.h>
    108108#import <pal/spi/cocoa/DataDetectorsCoreSPI.h>
    109 #import <pal/spi/cocoa/LaunchServicesSPI.h>
    110109#import <pal/spi/ios/DataDetectorsUISPI.h>
    111110#import <pal/spi/ios/GraphicsServicesSPI.h>
     
    78107809        // Previously, UIPreviewItemController would detect the case where there was no previewViewController
    78117810        // and create one. We need to replicate this code for the new API.
    7812         if (!previewViewController || [(NSURL *)url iTunesStoreURL]) {
     7811        if (!previewViewController) {
    78137812            auto ddContextMenuActionClass = getDDContextMenuActionClass();
    78147813            if ([ddContextMenuActionClass respondsToSelector:@selector(contextMenuConfigurationForURL:identifier:selectedText:results:inView:context:menuIdentifier:)]) {
     
    79557954        _page->startInteractionWithElementAtPosition(_positionInformation.request.point);
    79567955
    7957         continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]);
    7958         return;
    7959     }
    7960 
    7961 #if ENABLE(DATA_DETECTION)
    7962     if ([(NSURL *)linkURL iTunesStoreURL]) {
    7963         if ([self continueContextMenuInteractionWithDataDetectors:continueWithContextMenuConfiguration])
    7964             return;
    7965     }
    7966 #endif
     7956        // FIXME: Should we provide an identifier and ASSERT in delegates if we don't match?
     7957        return continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]);
     7958    }
    79677959
    79687960    auto completionBlock = makeBlockPtr([continueWithContextMenuConfiguration = makeBlockPtr(continueWithContextMenuConfiguration), linkURL = WTFMove(linkURL), weakSelf = WeakObjCPtr<WKContentView>(self)] (UIContextMenuConfiguration *configurationFromWKUIDelegate) mutable {
    79697961
    79707962        auto strongSelf = weakSelf.get();
    7971         if (!strongSelf) {
    7972             continueWithContextMenuConfiguration(nil);
    7973             return;
    7974         }
     7963        if (!strongSelf)
     7964            return continueWithContextMenuConfiguration(nil);
    79757965
    79767966        if (configurationFromWKUIDelegate) {
     
    80077997            };
    80087998
    8009             continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]);
    8010             return;
     7999            return continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]);
    80118000        }
    80128001
     
    80198008        // FIXME: Support JavaScript urls here. But make sure they don't show a preview.
    80208009        // <rdar://problem/50572283>
    8021         if (!linkURL.protocolIsInHTTPFamily() && !WebCore::DataDetection::canBePresentedByDataDetectors(linkURL)) {
    8022             continueWithContextMenuConfiguration(nil);
    8023             return;
     8010        if (!linkURL.protocolIsInHTTPFamily() && !WebCore::DataDetection::canBePresentedByDataDetectors(linkURL))
     8011            return continueWithContextMenuConfiguration(nil);
     8012
     8013        BEGIN_BLOCK_OBJC_EXCEPTIONS;
     8014        auto ddContextMenuActionClass = getDDContextMenuActionClass();
     8015        if ([ddContextMenuActionClass respondsToSelector:@selector(contextMenuConfigurationWithURL:inView:context:menuIdentifier:)]) {
     8016            NSDictionary *context = [strongSelf dataDetectionContextForPositionInformation:strongSelf->_positionInformation];
     8017            UIContextMenuConfiguration *configurationFromDD = [ddContextMenuActionClass contextMenuConfigurationForURL:linkURL identifier:strongSelf->_positionInformation.dataDetectorIdentifier selectedText:[strongSelf selectedText] results:strongSelf->_positionInformation.dataDetectorResults.get() inView:strongSelf.get() context:context menuIdentifier:nil];
     8018            strongSelf->_contextMenuActionProviderDelegateNeedsOverride = YES;
     8019            strongSelf->_page->startInteractionWithElementAtPosition(strongSelf->_positionInformation.request.point);
     8020            if (strongSelf->_showLinkPreviews)
     8021                return continueWithContextMenuConfiguration(configurationFromDD);
     8022            return continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:[configurationFromDD identifier] previewProvider:nil actionProvider:[configurationFromDD actionProvider]]);
    80248023        }
    8025 
    8026         if ([strongSelf continueContextMenuInteractionWithDataDetectors:continueWithContextMenuConfiguration.get()])
    8027             return;
    8028 #endif
    8029         continueWithContextMenuConfiguration(nil);
     8024        END_BLOCK_OBJC_EXCEPTIONS;
     8025#endif
     8026        return continueWithContextMenuConfiguration(nil);
    80308027    });
    80318028
     
    80518048        completionBlock(nil);
    80528049}
    8053 
    8054 #if ENABLE(DATA_DETECTION)
    8055 - (BOOL)continueContextMenuInteractionWithDataDetectors:(void(^)(UIContextMenuConfiguration *))continueWithContextMenuConfiguration
    8056 {
    8057     BEGIN_BLOCK_OBJC_EXCEPTIONS;
    8058     auto ddContextMenuActionClass = getDDContextMenuActionClass();
    8059     if ([ddContextMenuActionClass respondsToSelector:@selector(contextMenuConfigurationWithURL:inView:context:menuIdentifier:)]) {
    8060         URL linkURL = _positionInformation.url;
    8061         NSDictionary *context = [self dataDetectionContextForPositionInformation:_positionInformation];
    8062         UIContextMenuConfiguration *configurationFromDD = [ddContextMenuActionClass contextMenuConfigurationForURL:linkURL identifier:_positionInformation.dataDetectorIdentifier selectedText:[self selectedText] results:_positionInformation.dataDetectorResults.get() inView:self context:context menuIdentifier:nil];
    8063         _contextMenuActionProviderDelegateNeedsOverride = YES;
    8064         _page->startInteractionWithElementAtPosition(_positionInformation.request.point);
    8065         continueWithContextMenuConfiguration(configurationFromDD);
    8066         return YES;
    8067     }
    8068     END_BLOCK_OBJC_EXCEPTIONS;
    8069 
    8070     return NO;
    8071 }
    8072 #endif
    80738050
    80748051- (NSArray<UIMenuElement *> *)_contextMenuInteraction:(UIContextMenuInteraction *)interaction overrideSuggestedActionsForConfiguration:(UIContextMenuConfiguration *)configuration
Note: See TracChangeset for help on using the changeset viewer.