[Extra zoom mode] Specify password mode as needed when inputting text
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2018 08:16:10 +0000 (08:16 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Mar 2018 08:16:10 +0000 (08:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183428
<rdar://problem/37609386>

Reviewed by Tim Horton.

If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
the text input view controller to opt in to password text input mode.

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

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

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

index a8de1b2..70165b6 100644 (file)
@@ -1,3 +1,17 @@
+2018-03-08  Wenson Hsieh  <wenson_hsieh@apple.com>
+
+        [Extra zoom mode] Specify password mode as needed when inputting text
+        https://bugs.webkit.org/show_bug.cgi?id=183428
+        <rdar://problem/37609386>
+
+        Reviewed by Tim Horton.
+
+        If the focused element is a password field, or the input delegate has forced secure text entry, set a flag on
+        the text input view controller to opt in to password text input mode.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView presentTextInputViewController:]):
+
 2018-03-07  Tim Horton  <timothy_horton@apple.com>
 
         Sort and separate FeatureDefines.xcconfig
index c176a05..6d6f89a 100644 (file)
@@ -4274,6 +4274,7 @@ static bool isAssistableInputType(InputType type)
 
     _textInputViewController = adoptNS([[WKTextInputViewController alloc] initWithText:_assistedNodeInformation.value textSuggestions:@[ ]]);
     [_textInputViewController setDelegate:self];
+    [_textInputViewController setUsesPasswordEntryMode:_assistedNodeInformation.elementType == InputType::Password || [_formInputSession forceSecureTextEntry]];
     [_focusedFormControlViewController presentViewController:_textInputViewController.get() animated:animated completion:nil];
 
     [_textInputViewController setSuggestions:[_focusedFormControlViewController suggestions]];