Title: [258653] trunk/Source/WebKit
- Revision
- 258653
- Author
- [email protected]
- Date
- 2020-03-18 11:15:41 -0700 (Wed, 18 Mar 2020)
Log Message
Remove unneeded and incorrect respondsToSelector checks.
https://bugs.webkit.org/show_bug.cgi?id=209208
<rdar://problem/60512470>
Reviewed by Tim Horton.
No behaviour change, no tests needed.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView continueContextMenuInteractionWithDataDetectors:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (258652 => 258653)
--- trunk/Source/WebKit/ChangeLog 2020-03-18 18:15:34 UTC (rev 258652)
+++ trunk/Source/WebKit/ChangeLog 2020-03-18 18:15:41 UTC (rev 258653)
@@ -1,3 +1,16 @@
+2020-03-18 Megan Gardner <[email protected]>
+
+ Remove unneeded and incorrect respondsToSelector checks.
+ https://bugs.webkit.org/show_bug.cgi?id=209208
+ <rdar://problem/60512470>
+
+ Reviewed by Tim Horton.
+
+ No behaviour change, no tests needed.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView continueContextMenuInteractionWithDataDetectors:]):
+
2020-03-18 Brent Fulgham <[email protected]>
Switch from debug ASSERT to RELEASE_ASSERT in toNPObjectProxy
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (258652 => 258653)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2020-03-18 18:15:34 UTC (rev 258652)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2020-03-18 18:15:41 UTC (rev 258653)
@@ -8434,18 +8434,16 @@
// and create one. We need to replicate this code for the new API.
if (!previewViewController || [(NSURL *)url iTunesStoreURL]) {
auto ddContextMenuActionClass = getDDContextMenuActionClass();
- if ([ddContextMenuActionClass respondsToSelector:@selector(contextMenuConfigurationForURL:identifier:selectedText:results:inView:context:menuIdentifier:)]) {
- BEGIN_BLOCK_OBJC_EXCEPTIONS;
- NSDictionary *context = [self dataDetectionContextForPositionInformation:_positionInformation];
- RetainPtr<UIContextMenuConfiguration> dataDetectorsResult = [ddContextMenuActionClass contextMenuConfigurationForURL:url identifier:_positionInformation.dataDetectorIdentifier selectedText:self.selectedText results:_positionInformation.dataDetectorResults.get() inView:self context:context menuIdentifier:nil];
- if (_showLinkPreviews && dataDetectorsResult && dataDetectorsResult.get().previewProvider)
- _contextMenuLegacyPreviewController = dataDetectorsResult.get().previewProvider();
- if (dataDetectorsResult && dataDetectorsResult.get().actionProvider) {
- auto menuElements = menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo);
- _contextMenuLegacyMenu = dataDetectorsResult.get().actionProvider(menuElements);
- }
- END_BLOCK_OBJC_EXCEPTIONS;
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ NSDictionary *context = [self dataDetectionContextForPositionInformation:_positionInformation];
+ RetainPtr<UIContextMenuConfiguration> dataDetectorsResult = [ddContextMenuActionClass contextMenuConfigurationForURL:url identifier:_positionInformation.dataDetectorIdentifier selectedText:self.selectedText results:_positionInformation.dataDetectorResults.get() inView:self context:context menuIdentifier:nil];
+ if (_showLinkPreviews && dataDetectorsResult && dataDetectorsResult.get().previewProvider)
+ _contextMenuLegacyPreviewController = dataDetectorsResult.get().previewProvider();
+ if (dataDetectorsResult && dataDetectorsResult.get().actionProvider) {
+ auto menuElements = menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo);
+ _contextMenuLegacyMenu = dataDetectorsResult.get().actionProvider(menuElements);
}
+ END_BLOCK_OBJC_EXCEPTIONS;
return;
}
@@ -8588,8 +8586,8 @@
#if ENABLE(DATA_DETECTION)
if ([(NSURL *)linkURL iTunesStoreURL]) {
- if ([self continueContextMenuInteractionWithDataDetectors:continueWithContextMenuConfiguration])
- return;
+ [self continueContextMenuInteractionWithDataDetectors:continueWithContextMenuConfiguration];
+ return;
}
#endif
@@ -8651,10 +8649,11 @@
return;
}
- if ([strongSelf continueContextMenuInteractionWithDataDetectors:continueWithContextMenuConfiguration.get()])
- return;
+ [strongSelf continueContextMenuInteractionWithDataDetectors:continueWithContextMenuConfiguration.get()];
+ return;
+#else
+ continueWithContextMenuConfiguration(nil);
#endif
- continueWithContextMenuConfiguration(nil);
});
_contextMenuActionProviderDelegateNeedsOverride = NO;
@@ -8689,22 +8688,17 @@
}
#if ENABLE(DATA_DETECTION)
-- (BOOL)continueContextMenuInteractionWithDataDetectors:(void(^)(UIContextMenuConfiguration *))continueWithContextMenuConfiguration
+- (void)continueContextMenuInteractionWithDataDetectors:(void(^)(UIContextMenuConfiguration *))continueWithContextMenuConfiguration
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
auto ddContextMenuActionClass = getDDContextMenuActionClass();
- if ([ddContextMenuActionClass respondsToSelector:@selector(contextMenuConfigurationWithURL:inView:context:menuIdentifier:)]) {
- URL linkURL = _positionInformation.url;
- NSDictionary *context = [self dataDetectionContextForPositionInformation:_positionInformation];
- UIContextMenuConfiguration *configurationFromDD = [ddContextMenuActionClass contextMenuConfigurationForURL:linkURL identifier:_positionInformation.dataDetectorIdentifier selectedText:[self selectedText] results:_positionInformation.dataDetectorResults.get() inView:self context:context menuIdentifier:nil];
- _contextMenuActionProviderDelegateNeedsOverride = YES;
- _page->startInteractionWithPositionInformation(_positionInformation);
- continueWithContextMenuConfiguration(configurationFromDD);
- return YES;
- }
+ URL linkURL = _positionInformation.url;
+ NSDictionary *context = [self dataDetectionContextForPositionInformation:_positionInformation];
+ UIContextMenuConfiguration *configurationFromDD = [ddContextMenuActionClass contextMenuConfigurationForURL:linkURL identifier:_positionInformation.dataDetectorIdentifier selectedText:[self selectedText] results:_positionInformation.dataDetectorResults.get() inView:self context:context menuIdentifier:nil];
+ _contextMenuActionProviderDelegateNeedsOverride = YES;
+ _page->startInteractionWithPositionInformation(_positionInformation);
+ continueWithContextMenuConfiguration(configurationFromDD);
END_BLOCK_OBJC_EXCEPTIONS;
-
- return NO;
}
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes