Title: [280252] trunk/Source/WebKit
Revision
280252
Author
[email protected]
Date
2021-07-23 11:43:05 -0700 (Fri, 23 Jul 2021)

Log Message

[watchOS] It should be possible to select contact AutoFill text suggestions in email and username fields
https://bugs.webkit.org/show_bug.cgi?id=228237
rdar://77299680

Reviewed by Tim Horton.

After the changes in r278957, WKTextInputListViewController now presents modern Quickboard text input UI, as
well as contact AutoFill suggestions provided by Safari. For email and username fields (for which we currently
use PUICQuickboardController), this means that there's no longer any reason to prefer showing
PUICQuickboardController over WKTextInputListViewController, since both use modern text input UI (with support
for keychain AutoFill suggestions), but only the latter additionally supports contact AutoFill suggestions.

As such, we should change these to use WKTextInputListViewController instead of PUICQuickboardController. Note
that because contact AutoFill suggestions do not encompass passwords, it still makes more sense to pop directly
into PUICQuickboardController for password fields.

* Platform/spi/watchos/PepperUICoreSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView createQuickboardTextInputContext]):

Drive-by fix: additionally populate the placeholder of the text field in WKTextInputListViewController with
the input label text of the focused element (i.e., either placeholder text, the ARIA label, title, or text
content of an associated label).

(canUseQuickboardControllerFor):

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (280251 => 280252)


--- trunk/Source/WebKit/ChangeLog	2021-07-23 18:36:31 UTC (rev 280251)
+++ trunk/Source/WebKit/ChangeLog	2021-07-23 18:43:05 UTC (rev 280252)
@@ -1,3 +1,31 @@
+2021-07-23  Wenson Hsieh  <[email protected]>
+
+        [watchOS] It should be possible to select contact AutoFill text suggestions in email and username fields
+        https://bugs.webkit.org/show_bug.cgi?id=228237
+        rdar://77299680
+
+        Reviewed by Tim Horton.
+
+        After the changes in r278957, WKTextInputListViewController now presents modern Quickboard text input UI, as
+        well as contact AutoFill suggestions provided by Safari. For email and username fields (for which we currently
+        use PUICQuickboardController), this means that there's no longer any reason to prefer showing
+        PUICQuickboardController over WKTextInputListViewController, since both use modern text input UI (with support
+        for keychain AutoFill suggestions), but only the latter additionally supports contact AutoFill suggestions.
+
+        As such, we should change these to use WKTextInputListViewController instead of PUICQuickboardController. Note
+        that because contact AutoFill suggestions do not encompass passwords, it still makes more sense to pop directly
+        into PUICQuickboardController for password fields.
+
+        * Platform/spi/watchos/PepperUICoreSPI.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView createQuickboardTextInputContext]):
+
+        Drive-by fix: additionally populate the placeholder of the text field in WKTextInputListViewController with
+        the input label text of the focused element (i.e., either placeholder text, the ARIA label, title, or text
+        content of an associated label).
+
+        (canUseQuickboardControllerFor):
+
 2021-07-23  Richard Houle  <[email protected]>
 
         WebSocket traffic should be correctly assigned to either Developer or User.

Modified: trunk/Source/WebKit/Platform/spi/watchos/PepperUICoreSPI.h (280251 => 280252)


--- trunk/Source/WebKit/Platform/spi/watchos/PepperUICoreSPI.h	2021-07-23 18:36:31 UTC (rev 280251)
+++ trunk/Source/WebKit/Platform/spi/watchos/PepperUICoreSPI.h	2021-07-23 18:43:05 UTC (rev 280252)
@@ -174,6 +174,7 @@
 @property (nonatomic, strong) NSAttributedString *attributedHeaderText;
 
 #if HAVE(QUICKBOARD_CONTROLLER)
+@property (nonatomic, copy) NSString *placeholder;
 @property (nonatomic, copy, nullable) NSArray<NSString *> *suggestions;
 @property (nonatomic, readwrite) BOOL acceptsEmoji;
 @property (nonatomic, readwrite) BOOL shouldPresentModernTextInputUI;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (280251 => 280252)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-07-23 18:36:31 UTC (rev 280251)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2021-07-23 18:43:05 UTC (rev 280252)
@@ -6790,6 +6790,7 @@
 #if HAVE(QUICKBOARD_CONTROLLER)
     [context setAcceptsEmoji:YES];
     [context setShouldPresentModernTextInputUI:YES];
+    [context setPlaceholder:self.inputLabelText];
 #endif
     return context;
 }
@@ -6810,7 +6811,7 @@
 
 static bool canUseQuickboardControllerFor(UITextContentType type)
 {
-    return [type isEqualToString:UITextContentTypeUsername] || [type isEqualToString:UITextContentTypePassword] || [type isEqualToString:UITextContentTypeEmailAddress];
+    return [type isEqualToString:UITextContentTypePassword];
 }
 
 #endif // HAVE(QUICKBOARD_CONTROLLER)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to