[iOS] Support deleting to the start of the line and to the end of the line
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 22:14:21 +0000 (22:14 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Nov 2018 22:14:21 +0000 (22:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=191389
<rdar://problem/45883972>

Reviewed by Wenson Hsieh.

Add support for the key commands Command + Delete and Control + K to delete to the start
of the line and to delete to the end of the line, respectively.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _deleteToStartOfLine]): Added.
(-[WKContentView _deleteToEndOfLine]): Added.

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

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

index 4bb978a..bb12df6 100644 (file)
@@ -1,5 +1,20 @@
 2018-11-07  Daniel Bates  <dabates@apple.com>
 
+        [iOS] Support deleting to the start of the line and to the end of the line
+        https://bugs.webkit.org/show_bug.cgi?id=191389
+        <rdar://problem/45883972>
+
+        Reviewed by Wenson Hsieh.
+
+        Add support for the key commands Command + Delete and Control + K to delete to the start
+        of the line and to delete to the end of the line, respectively.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _deleteToStartOfLine]): Added.
+        (-[WKContentView _deleteToEndOfLine]): Added.
+
+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>
index 1218457..614ad9f 100644 (file)
@@ -3932,6 +3932,16 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     [self executeEditCommandWithCallback:@"deleteWordBackward"];
 }
 
+- (void)_deleteToStartOfLine
+{
+    [self executeEditCommandWithCallback:@"deleteToBeginningOfLine"];
+}
+
+- (void)_deleteToEndOfLine
+{
+    [self executeEditCommandWithCallback:@"deleteToEndOfLine"];
+}
+
 - (UITextInputArrowKeyHistory *)_moveUp:(BOOL)extending withHistory:(UITextInputArrowKeyHistory *)history
 {
     [self executeEditCommandWithCallback:extending ? @"moveUpAndModifySelection" : @"moveUp"];