Title: [261662] branches/safari-610.1.13-branch/Source/WebKit
- Revision
- 261662
- Author
- [email protected]
- Date
- 2020-05-13 15:41:13 -0700 (Wed, 13 May 2020)
Log Message
Cherry-pick r261478. rdar://problem/63203495
Unreviewed, fix the watchOS build after r261457
Put -[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:] behind a USE(UICONTEXTMENU)
compiler guard; currently, it is declared everywhere, but only implemented if ENABLE(DATA_DETECTION) &&
USE(UICONTEXTMENU). However, WKContentView only invokes it behind code that is guarded by USE(UICONTEXTMENU).
* UIProcess/ios/WKActionSheetAssistant.h:
* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-610.1.13-branch/Source/WebKit/ChangeLog (261661 => 261662)
--- branches/safari-610.1.13-branch/Source/WebKit/ChangeLog 2020-05-13 22:33:20 UTC (rev 261661)
+++ branches/safari-610.1.13-branch/Source/WebKit/ChangeLog 2020-05-13 22:41:13 UTC (rev 261662)
@@ -1,5 +1,33 @@
2020-05-13 Alan Coon <[email protected]>
+ Cherry-pick r261478. rdar://problem/63203495
+
+ Unreviewed, fix the watchOS build after r261457
+
+ Put -[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:] behind a USE(UICONTEXTMENU)
+ compiler guard; currently, it is declared everywhere, but only implemented if ENABLE(DATA_DETECTION) &&
+ USE(UICONTEXTMENU). However, WKContentView only invokes it behind code that is guarded by USE(UICONTEXTMENU).
+
+ * UIProcess/ios/WKActionSheetAssistant.h:
+ * UIProcess/ios/WKActionSheetAssistant.mm:
+ (-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]):
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@261478 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-05-11 Wenson Hsieh <[email protected]>
+
+ Unreviewed, fix the watchOS build after r261457
+
+ Put -[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:] behind a USE(UICONTEXTMENU)
+ compiler guard; currently, it is declared everywhere, but only implemented if ENABLE(DATA_DETECTION) &&
+ USE(UICONTEXTMENU). However, WKContentView only invokes it behind code that is guarded by USE(UICONTEXTMENU).
+
+ * UIProcess/ios/WKActionSheetAssistant.h:
+ * UIProcess/ios/WKActionSheetAssistant.mm:
+ (-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]):
+
+2020-05-13 Alan Coon <[email protected]>
+
Cherry-pick r261617. rdar://problem/63195712
REGRESSION (r261254): Broke Apple Pay on macOS
Modified: branches/safari-610.1.13-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h (261661 => 261662)
--- branches/safari-610.1.13-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h 2020-05-13 22:33:20 UTC (rev 261661)
+++ branches/safari-610.1.13-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h 2020-05-13 22:41:13 UTC (rev 261662)
@@ -90,7 +90,9 @@
- (BOOL)isShowingSheet;
- (void)interactionDidStartWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)information;
- (NSArray *)currentAvailableActionTitles;
+#if USE(UICONTEXTMENU)
- (NSArray<UIMenuElement *> *)suggestedActionsForContextMenuWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)positionInformation;
+#endif
@end
#endif // PLATFORM(IOS_FAMILY)
Modified: branches/safari-610.1.13-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm (261661 => 261662)
--- branches/safari-610.1.13-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm 2020-05-13 22:33:20 UTC (rev 261661)
+++ branches/safari-610.1.13-branch/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm 2020-05-13 22:41:13 UTC (rev 261662)
@@ -720,7 +720,29 @@
#endif // ENABLE(DATA_DETECTION)
}
-#if USE(UICONTEXTMENU) && ENABLE(DATA_DETECTION)
+#if USE(UICONTEXTMENU)
+
+static NSArray<UIMenuElement *> *menuElementsFromDefaultActions(RetainPtr<NSArray> defaultElementActions, RetainPtr<_WKActivatedElementInfo> elementInfo)
+{
+ if (![defaultElementActions count])
+ return nil;
+
+ auto actions = [NSMutableArray arrayWithCapacity:[defaultElementActions count]];
+ for (_WKElementAction *elementAction in defaultElementActions.get())
+ [actions addObject:[elementAction uiActionForElementInfo:elementInfo.get()]];
+
+ return actions;
+}
+
+- (NSArray<UIMenuElement *> *)suggestedActionsForContextMenuWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)positionInformation
+{
+ auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithInteractionInformationAtPosition:positionInformation userInfo:nil]);
+ RetainPtr<NSArray<_WKElementAction *>> defaultActionsFromAssistant = positionInformation.isLink ? [self defaultActionsForLinkSheet:elementInfo.get()] : [self defaultActionsForImageSheet:elementInfo.get()];
+ return menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo);
+}
+
+#if ENABLE(DATA_DETECTION)
+
- (UIContextMenuConfiguration *)contextMenuInteraction:(UIContextMenuInteraction *)interaction configurationForMenuAtLocation:(CGPoint)location
{
DDDetectionController *controller = [getDDDetectionControllerClass() sharedController];
@@ -777,18 +799,6 @@
}];
}
-static NSArray<UIMenuElement *> *menuElementsFromDefaultActions(RetainPtr<NSArray> defaultElementActions, RetainPtr<_WKActivatedElementInfo> elementInfo)
-{
- if (![defaultElementActions count])
- return nil;
-
- auto actions = [NSMutableArray arrayWithCapacity:[defaultElementActions count]];
- for (_WKElementAction *elementAction in defaultElementActions.get())
- [actions addObject:[elementAction uiActionForElementInfo:elementInfo.get()]];
-
- return actions;
-}
-
- (NSArray<UIMenuElement *> *)_contextMenuInteraction:(UIContextMenuInteraction *)interaction overrideSuggestedActionsForConfiguration:(UIContextMenuConfiguration *)configuration
{
if (!_positionInformation)
@@ -796,16 +806,10 @@
return [self suggestedActionsForContextMenuWithPositionInformation:*_positionInformation];
}
-- (NSArray<UIMenuElement *> *)suggestedActionsForContextMenuWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)positionInformation
-{
- auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithInteractionInformationAtPosition:positionInformation userInfo:nil]);
- RetainPtr<NSArray<_WKElementAction *>> defaultActionsFromAssistant = positionInformation.isLink ? [self defaultActionsForLinkSheet:elementInfo.get()] : [self defaultActionsForImageSheet:elementInfo.get()];
- return menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo);
+#endif // ENABLE(DATA_DETECTION)
-}
+#endif // USE(UICONTEXTMENU)
-#endif
-
- (void)cleanupSheet
{
auto delegate = _delegate.get();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes