Title: [273915] trunk/Source/WebKit
- Revision
- 273915
- Author
- wenson_hs...@apple.com
- Date
- 2021-03-04 13:06:56 -0800 (Thu, 04 Mar 2021)
Log Message
[iOS] Add support for a new image-extraction-related responder action
https://bugs.webkit.org/show_bug.cgi?id=222743
<rdar://problem/75001149>
Reviewed by Devin Rousso.
Add support for the new action, such that we return `YES` if and only if we're in an editable context, and also
such that we return a non-null target for the new action.
* UIProcess/ios/WKContentViewInteraction.h:
Add a fallback definition for `FOR_EACH_ADDITIONAL_WKCONTENTVIEW_ACTION`, which can be used by WebKitAdditions
to inject additional responder actions when generating selector forwarding code between `WKContentView` and
`WKWebView`.
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
Modified Paths
Diff
Modified: trunk/Source/WebKit/ChangeLog (273914 => 273915)
--- trunk/Source/WebKit/ChangeLog 2021-03-04 21:00:51 UTC (rev 273914)
+++ trunk/Source/WebKit/ChangeLog 2021-03-04 21:06:56 UTC (rev 273915)
@@ -1,3 +1,23 @@
+2021-03-04 Wenson Hsieh <wenson_hs...@apple.com>
+
+ [iOS] Add support for a new image-extraction-related responder action
+ https://bugs.webkit.org/show_bug.cgi?id=222743
+ <rdar://problem/75001149>
+
+ Reviewed by Devin Rousso.
+
+ Add support for the new action, such that we return `YES` if and only if we're in an editable context, and also
+ such that we return a non-null target for the new action.
+
+ * UIProcess/ios/WKContentViewInteraction.h:
+
+ Add a fallback definition for `FOR_EACH_ADDITIONAL_WKCONTENTVIEW_ACTION`, which can be used by WebKitAdditions
+ to inject additional responder actions when generating selector forwarding code between `WKContentView` and
+ `WKWebView`.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView canPerformActionForWebView:withSender:]):
+
2021-03-04 Chris Dumez <cdu...@apple.com>
Unreviewed build fix after r272629.
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (273914 => 273915)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2021-03-04 21:00:51 UTC (rev 273914)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h 2021-03-04 21:06:56 UTC (rev 273915)
@@ -145,7 +145,12 @@
typedef BlockPtr<void(WebKit::InteractionInformationAtPosition)> InteractionInformationCallback;
typedef std::pair<WebKit::InteractionInformationRequest, InteractionInformationCallback> InteractionInformationRequestAndCallback;
+#if !defined(FOR_EACH_ADDITIONAL_WKCONTENTVIEW_ACTION)
+#define FOR_EACH_ADDITIONAL_WKCONTENTVIEW_ACTION(M)
+#endif
+
#define FOR_EACH_WKCONTENTVIEW_ACTION(M) \
+ FOR_EACH_ADDITIONAL_WKCONTENTVIEW_ACTION(M) \
M(_addShortcut) \
M(_define) \
M(_lookup) \
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (273914 => 273915)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-03-04 21:00:51 UTC (rev 273914)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2021-03-04 21:06:56 UTC (rev 273915)
@@ -3698,6 +3698,11 @@
return baseWritingDirection != WebCore::WritingDirection::RightToLeft;
}
+#if ENABLE(IMAGE_EXTRACTION)
+ if (action == WebKit::imageExtractionAction())
+ return editorState.isContentEditable;
+#endif
+
return [super canPerformAction:action withSender:sender];
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes