[iOS] Option + Delete should delete previous word
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 22:11:59 +0000 (22:11 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 22:11:59 +0000 (22:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191381
<rdar://problem/23681351>

Reviewed by Wenson Hsieh.

Implement support for pressing Option + Delete to delete the previous word. This makes text editing
in WebKit more closely match the platform conventions.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteByWord]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237943 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index e6326bc..4bb978a 100644 (file)
@@ -1,5 +1,19 @@
 2018-11-07  Daniel Bates  <dabates@apple.com>
 
+        [iOS] Option + Delete should delete previous word
+        https://bugs.webkit.org/show_bug.cgi?id=191381
+        <rdar://problem/23681351>
+
+        Reviewed by Wenson Hsieh.
+
+        Implement support for pressing Option + Delete to delete the previous word. This makes text editing
+        in WebKit more closely match the platform conventions.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _deleteByWord]):
+
+2018-11-07  Daniel Bates  <dabates@apple.com>
+
         Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree
         https://bugs.webkit.org/show_bug.cgi?id=190141
 
index 92025a6..1218457 100644 (file)
@@ -3927,6 +3927,11 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     });
 }
 
+- (void)_deleteByWord
+{
+    [self executeEditCommandWithCallback:@"deleteWordBackward"];
+}
+
 - (UITextInputArrowKeyHistory *)_moveUp:(BOOL)extending withHistory:(UITextInputArrowKeyHistory *)history
 {
     [self executeEditCommandWithCallback:extending ? @"moveUpAndModifySelection" : @"moveUp"];