Changeset 248371 in webkit
- Timestamp:
- Aug 7, 2019, 10:19:08 AM (7 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
-
WebCore/PAL/ChangeLog (modified) (1 diff)
-
WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h (modified) (2 diffs)
-
WebKit/ChangeLog (modified) (1 diff)
-
WebKit/UIProcess/ios/WKContentViewInteraction.mm (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/PAL/ChangeLog
r248366 r248371 1 2019-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 1 13 2019-08-07 Youenn Fablet <youenn@apple.com> 2 14 -
trunk/Source/WebCore/PAL/pal/spi/cocoa/LaunchServicesSPI.h
r248330 r248371 33 33 #import <CoreServices/CoreServicesPriv.h> 34 34 #elif PLATFORM(IOS_FAMILY) 35 #import <CoreServices/LSURLOverridePriv.h>36 35 #import <MobileCoreServices/LSAppLinkPriv.h> 37 36 #endif 38 37 39 #endif // USE(APPLE_INTERNAL_SDK)38 #endif 40 39 41 40 #if HAVE(APP_LINKS) … … 75 74 #endif 76 75 77 @interface NSURL ()78 - (NSURL *)iTunesStoreURL;79 @end80 81 76 #if PLATFORM(MAC) 82 77 enum LSSessionID { -
trunk/Source/WebKit/ChangeLog
r248338 r248371 1 2019-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 1 13 2019-08-06 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r248330 r248371 107 107 #import <pal/spi/cg/CoreGraphicsSPI.h> 108 108 #import <pal/spi/cocoa/DataDetectorsCoreSPI.h> 109 #import <pal/spi/cocoa/LaunchServicesSPI.h>110 109 #import <pal/spi/ios/DataDetectorsUISPI.h> 111 110 #import <pal/spi/ios/GraphicsServicesSPI.h> … … 7810 7809 // Previously, UIPreviewItemController would detect the case where there was no previewViewController 7811 7810 // and create one. We need to replicate this code for the new API. 7812 if (!previewViewController || [(NSURL *)url iTunesStoreURL]) {7811 if (!previewViewController) { 7813 7812 auto ddContextMenuActionClass = getDDContextMenuActionClass(); 7814 7813 if ([ddContextMenuActionClass respondsToSelector:@selector(contextMenuConfigurationForURL:identifier:selectedText:results:inView:context:menuIdentifier:)]) { … … 7955 7954 _page->startInteractionWithElementAtPosition(_positionInformation.request.point); 7956 7955 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 } 7967 7959 7968 7960 auto completionBlock = makeBlockPtr([continueWithContextMenuConfiguration = makeBlockPtr(continueWithContextMenuConfiguration), linkURL = WTFMove(linkURL), weakSelf = WeakObjCPtr<WKContentView>(self)] (UIContextMenuConfiguration *configurationFromWKUIDelegate) mutable { 7969 7961 7970 7962 auto strongSelf = weakSelf.get(); 7971 if (!strongSelf) { 7972 continueWithContextMenuConfiguration(nil); 7973 return; 7974 } 7963 if (!strongSelf) 7964 return continueWithContextMenuConfiguration(nil); 7975 7965 7976 7966 if (configurationFromWKUIDelegate) { … … 8007 7997 }; 8008 7998 8009 continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]); 8010 return; 7999 return continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]); 8011 8000 } 8012 8001 … … 8019 8008 // FIXME: Support JavaScript urls here. But make sure they don't show a preview. 8020 8009 // <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]]); 8024 8023 } 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); 8030 8027 }); 8031 8028 … … 8051 8048 completionBlock(nil); 8052 8049 } 8053 8054 #if ENABLE(DATA_DETECTION)8055 - (BOOL)continueContextMenuInteractionWithDataDetectors:(void(^)(UIContextMenuConfiguration *))continueWithContextMenuConfiguration8056 {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 #endif8073 8050 8074 8051 - (NSArray<UIMenuElement *> *)_contextMenuInteraction:(UIContextMenuInteraction *)interaction overrideSuggestedActionsForConfiguration:(UIContextMenuConfiguration *)configuration
Note:
See TracChangeset
for help on using the changeset viewer.