Title: [292880] trunk/Source/WebKit
Revision
292880
Author
[email protected]
Date
2022-04-14 11:00:45 -0700 (Thu, 14 Apr 2022)

Log Message

[iOS] Add support for find-and-replace keyboard shortcut
https://bugs.webkit.org/show_bug.cgi?id=239320
rdar://91537724

Reviewed by Wenson Hsieh.

* UIProcess/API/ios/WKWebViewIOS.h:
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView canPerformActionForWebView:withSender:]):
(-[WKContentView findAndReplaceForWebView:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (292879 => 292880)


--- trunk/Source/WebKit/ChangeLog	2022-04-14 17:55:19 UTC (rev 292879)
+++ trunk/Source/WebKit/ChangeLog	2022-04-14 18:00:45 UTC (rev 292880)
@@ -1,3 +1,17 @@
+2022-04-14  Aditya Keerthi  <[email protected]>
+
+        [iOS] Add support for find-and-replace keyboard shortcut
+        https://bugs.webkit.org/show_bug.cgi?id=239320
+        rdar://91537724
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/API/ios/WKWebViewIOS.h:
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView canPerformActionForWebView:withSender:]):
+        (-[WKContentView findAndReplaceForWebView:]):
+
 2022-04-14  Chris Dumez  <[email protected]>
 
         Drop inefficient String::append() overloads

Modified: trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h (292879 => 292880)


--- trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h	2022-04-14 17:55:19 UTC (rev 292879)
+++ trunk/Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h	2022-04-14 18:00:45 UTC (rev 292880)
@@ -133,6 +133,7 @@
 - (void)find:(id)sender;
 - (void)findNext:(id)sender;
 - (void)findPrevious:(id)sender;
+- (void)findAndReplace:(id)sender;
 
 - (id<_UITextSearching>)_searchableObject;
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (292879 => 292880)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2022-04-14 17:55:19 UTC (rev 292879)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2022-04-14 18:00:45 UTC (rev 292880)
@@ -166,7 +166,8 @@
 #define FOR_EACH_FIND_WKCONTENTVIEW_ACTION(M) \
     M(find) \
     M(findNext) \
-    M(findPrevious)
+    M(findPrevious) \
+    M(findAndReplace)
 #else
 #define FOR_EACH_FIND_WKCONTENTVIEW_ACTION(M)
 #endif

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (292879 => 292880)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2022-04-14 17:55:19 UTC (rev 292879)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2022-04-14 18:00:45 UTC (rev 292880)
@@ -4145,6 +4145,9 @@
 #if HAVE(UIFINDINTERACTION)
     if (action == @selector(find:) || action == @selector(findNext:) || action == @selector(findPrevious:))
         return self.webView._findInteractionEnabled;
+
+    if (action == @selector(findAndReplace:))
+        return self.webView._findInteractionEnabled && self.supportsTextReplacement;
 #endif
 
     return [super canPerformAction:action withSender:sender];
@@ -10384,6 +10387,11 @@
     [self.webView._findInteraction findPrevious];
 }
 
+- (void)findAndReplaceForWebView:(id)sender
+{
+    [self.webView._findInteraction presentFindNavigatorShowingReplace:YES];
+}
+
 - (void)performTextSearchWithQueryString:(NSString *)string usingOptions:(_UITextSearchOptions *)options resultAggregator:(id<_UITextSearchAggregator>)aggregator
 {
     OptionSet<WebKit::FindOptions> findOptions;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to