Changeset 248469 in webkit
- Timestamp:
- Aug 9, 2019 12:50:44 PM (5 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/PAL/ChangeLog
r248381 r248469 1 2019-08-09 Tim Horton <timothy_horton@apple.com> 2 3 Tapping buttons in Data Detectors lookup previews doesn't work 4 https://bugs.webkit.org/show_bug.cgi?id=200579 5 <rdar://problem/54056519> 6 7 Reviewed by Megan Gardner. 8 9 * pal/spi/ios/DataDetectorsUISPI.h: 10 1 11 2019-08-07 Dean Jackson <dino@apple.com> 2 12 -
trunk/Source/WebCore/PAL/pal/spi/ios/DataDetectorsUISPI.h
r247355 r248469 84 84 #if HAVE(LINK_PREVIEW) && USE(UICONTEXTMENU) 85 85 SOFT_LINK_CLASS(DataDetectorsUI, DDContextMenuAction); 86 SOFT_LINK_CLASS(DataDetectorsUI, DDContextMenuConfiguration); 86 87 #endif 87 88 SOFT_LINK_CLASS(DataDetectorsUI, DDDetectionController) -
trunk/Source/WebKit/ChangeLog
r248456 r248469 1 2019-08-09 Tim Horton <timothy_horton@apple.com> 2 3 Tapping buttons in Data Detectors lookup previews doesn't work 4 https://bugs.webkit.org/show_bug.cgi?id=200579 5 <rdar://problem/54056519> 6 7 Reviewed by Megan Gardner. 8 9 * Platform/spi/ios/UIKitSPI.h: 10 * UIProcess/ios/WKContentViewInteraction.mm: 11 (-[WKContentView _contextMenuInteraction:styleForMenuWithConfiguration:]): 12 If a Data Detectors context menu wants the action menu style, provide it. 13 14 (-[WKContentView contextMenuInteraction:willPerformPreviewActionForMenuWithConfiguration:animator:]): 15 If a Data Detectors context menu provides a view controller to present 16 on context menu commit, present it. We present on top of the same view 17 controller that is currently presenting the context menu, but modally 18 instead of inside the context menu. 19 20 If a Data Detectors context menu instead provides a URL to launch on 21 context menu commit, call openURL. 22 23 In both cases, change the commit style to pop, since we're committing 24 instead of dismissing. 25 1 26 2019-08-08 Dean Jackson <dino@apple.com> 2 27 -
trunk/Source/WebKit/Platform/spi/ios/UIKitSPI.h
r248455 r248469 91 91 #import <UIKit/UIPreviewItemController.h> 92 92 #if USE(UICONTEXTMENU) 93 #import <UIKit/UIContextMenuInteraction_ForSpringBoardOnly.h> 93 94 #import <UIKit/UIContextMenuInteraction_ForWebKitOnly.h> 94 95 #endif -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r248456 r248469 8226 8226 } 8227 8227 8228 - (nullable _UIContextMenuStyle *)_contextMenuInteraction:(UIContextMenuInteraction *)interaction styleForMenuWithConfiguration:(UIContextMenuConfiguration *)configuration 8229 { 8230 #if defined(DD_CONTEXT_MENU_SPI_VERSION) && DD_CONTEXT_MENU_SPI_VERSION >= 2 8231 if ([configuration isKindOfClass:getDDContextMenuConfigurationClass()]) { 8232 DDContextMenuConfiguration *ddConfiguration = static_cast<DDContextMenuConfiguration *>(configuration); 8233 8234 if (ddConfiguration.prefersActionMenuStyle) { 8235 _UIContextMenuStyle *style = [_UIContextMenuStyle defaultStyle]; 8236 style.preferredLayout = _UIContextMenuLayoutActionsOnly; 8237 return style; 8238 } 8239 } 8240 #endif 8241 8242 return nil; 8243 } 8244 8228 8245 - (void)contextMenuInteraction:(UIContextMenuInteraction *)interaction willPerformPreviewActionForMenuWithConfiguration:(UIContextMenuConfiguration *)configuration animator:(id<UIContextMenuInteractionCommitAnimating>)animator 8229 8246 { … … 8277 8294 ALLOW_DEPRECATED_DECLARATIONS_END 8278 8295 } 8296 8297 #if defined(DD_CONTEXT_MENU_SPI_VERSION) && DD_CONTEXT_MENU_SPI_VERSION >= 2 8298 if ([configuration isKindOfClass:getDDContextMenuConfigurationClass()]) { 8299 DDContextMenuConfiguration *ddConfiguration = static_cast<DDContextMenuConfiguration *>(configuration); 8300 8301 BOOL shouldExpandPreview = NO; 8302 RetainPtr<UIViewController> presentedViewController; 8303 8304 #if defined(DD_CONTEXT_MENU_SPI_VERSION) && DD_CONTEXT_MENU_SPI_VERSION >= 3 8305 shouldExpandPreview = !!ddConfiguration.interactionViewControllerProvider; 8306 if (shouldExpandPreview) 8307 presentedViewController = ddConfiguration.interactionViewControllerProvider(); 8308 #else 8309 shouldExpandPreview = ddConfiguration.expandPreviewOnInteraction; 8310 presentedViewController = animator.previewViewController; 8311 #endif 8312 8313 if (shouldExpandPreview) { 8314 animator.preferredCommitStyle = UIContextMenuInteractionCommitStylePop; 8315 8316 // We will re-present modally on the same VC that is currently presenting the preview in a context menu. 8317 RetainPtr<UIViewController> presentingViewController = animator.previewViewController.presentingViewController; 8318 8319 [animator addAnimations:^{ 8320 [presentingViewController presentViewController:presentedViewController.get() animated:NO completion:nil]; 8321 }]; 8322 return; 8323 } 8324 8325 if (NSURL *interactionURL = ddConfiguration.interactionURL) { 8326 animator.preferredCommitStyle = UIContextMenuInteractionCommitStylePop; 8327 8328 [animator addAnimations:^{ 8329 [[UIApplication sharedApplication] openURL:interactionURL withCompletionHandler:nil]; 8330 }]; 8331 return; 8332 } 8333 } 8334 #endif 8279 8335 } 8280 8336
Note: See TracChangeset
for help on using the changeset viewer.