Use the same overloaded addInputString in WKContentViewInteraction
authorjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 19:48:48 +0000 (19:48 +0000)
committerjiewen_tan@apple.com <jiewen_tan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2018 19:48:48 +0000 (19:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=186376
<rdar://problem/18498360>

Reviewed by Brent Fulgham.

Different overloaded variants of [UIKeyboardImpl -addInputString] behaves differently. We should use the same
overloaded variant consistently: [UIKeyboardImpl -addInputString:withFlags:withInputManagerHint:].

Sadly, there is no test case for this change as:
1) UIScriptController has troubles simulating '\r' keyboard event, and
2) API test couldn't simulate proper UI keyboard events.

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

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

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

index b3b0fe2..dc739d1 100644 (file)
@@ -1,3 +1,21 @@
+2018-06-07  Jiewen Tan  <jiewen_tan@apple.com>
+
+        Use the same overloaded addInputString in WKContentViewInteraction
+        https://bugs.webkit.org/show_bug.cgi?id=186376
+        <rdar://problem/18498360>
+
+        Reviewed by Brent Fulgham.
+
+        Different overloaded variants of [UIKeyboardImpl -addInputString] behaves differently. We should use the same
+        overloaded variant consistently: [UIKeyboardImpl -addInputString:withFlags:withInputManagerHint:].
+
+        Sadly, there is no test case for this change as:
+        1) UIScriptController has troubles simulating '\r' keyboard event, and
+        2) API test couldn't simulate proper UI keyboard events.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _interpretKeyEvent:isCharEvent:]):
+
 2018-06-07  Alex Christensen  <achristensen@webkit.org>
 
         REGRESSION(r224134) Client certificate challenges don't always appear
index ea1080b..d6d7f36 100644 (file)
@@ -3742,7 +3742,7 @@ static NSString *contentTypeFromFieldName(WebCore::AutofillFieldName fieldName)
     case kWebReturnKey:
         if (contentEditable && isCharEvent) {
             // Map \r from HW keyboard to \n to match the behavior of the soft keyboard.
-            [keyboard addInputString:@"\n" withFlags:0];
+            [keyboard addInputString:@"\n" withFlags:0 withInputManagerHint:nil];
             return YES;
         }
         break;