Title: [261478] trunk/Source/WebKit
Revision
261478
Author
[email protected]
Date
2020-05-11 07:59:28 -0700 (Mon, 11 May 2020)

Log Message

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:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (261477 => 261478)


--- trunk/Source/WebKit/ChangeLog	2020-05-11 14:56:51 UTC (rev 261477)
+++ trunk/Source/WebKit/ChangeLog	2020-05-11 14:59:28 UTC (rev 261478)
@@ -1,3 +1,15 @@
+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-11  Philippe Normand  <[email protected]>
 
         [GTK] Media and audio permission request unit tests are timing out

Modified: trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h (261477 => 261478)


--- trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h	2020-05-11 14:56:51 UTC (rev 261477)
+++ trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h	2020-05-11 14:59:28 UTC (rev 261478)
@@ -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: trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm (261477 => 261478)


--- trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm	2020-05-11 14:56:51 UTC (rev 261477)
+++ trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm	2020-05-11 14:59:28 UTC (rev 261478)
@@ -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

Reply via email to