Modified: trunk/Source/WebKit/ChangeLog (245337 => 245338)
--- trunk/Source/WebKit/ChangeLog 2019-05-15 19:06:06 UTC (rev 245337)
+++ trunk/Source/WebKit/ChangeLog 2019-05-15 19:24:16 UTC (rev 245338)
@@ -1,3 +1,21 @@
+2019-05-15 Wenson Hsieh <[email protected]>
+
+ inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
+ https://bugs.webkit.org/show_bug.cgi?id=197916
+ <rdar://problem/50815427>
+
+ Reviewed by Timothy Hatcher.
+
+ Use UIKeyboardTypeNumberPad instead of UIKeyboardTypeNumbersAndPunctuation when presenting a keyboard for a
+ field with inputmode="numeric". While the WhatWG specification merely requires the UA to display a keyboard
+ "capable of numeric input", it suggests that the keyboard should be "useful for PIN entry", which loosely
+ implies a number pad.
+
+ This is also generally in line with feedback from web developers.
+
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView textInputTraits]):
+
2019-05-15 Don Olmstead <[email protected]>
Add USE(LIBWPE) for AcceleratedSurface
Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (245337 => 245338)
--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-05-15 19:06:06 UTC (rev 245337)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-05-15 19:24:16 UTC (rev 245338)
@@ -4380,7 +4380,7 @@
[_traits setKeyboardType:UIKeyboardTypeEmailAddress];
break;
case WebCore::InputMode::Numeric:
- [_traits setKeyboardType:UIKeyboardTypeNumbersAndPunctuation];
+ [_traits setKeyboardType:UIKeyboardTypeNumberPad];
break;
case WebCore::InputMode::Decimal:
[_traits setKeyboardType:UIKeyboardTypeDecimalPad];
Modified: trunk/Tools/ChangeLog (245337 => 245338)
--- trunk/Tools/ChangeLog 2019-05-15 19:06:06 UTC (rev 245337)
+++ trunk/Tools/ChangeLog 2019-05-15 19:24:16 UTC (rev 245338)
@@ -1,3 +1,17 @@
+2019-05-15 Wenson Hsieh <[email protected]>
+
+ inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
+ https://bugs.webkit.org/show_bug.cgi?id=197916
+ <rdar://problem/50815427>
+
+ Reviewed by Timothy Hatcher.
+
+ Re-enable this previously flaky test, and rebaseline the result to to expect UIKeyboardTypeNumberPad for
+ inputmode="numeric".
+
+ * TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm:
+ (TestWebKitAPI::TEST):
+
2019-05-15 Youenn Fablet <[email protected]>
Reuse existing WebPageProxy quota handler for NetworkProcessProxy quota requests
Modified: trunk/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm (245337 => 245338)
--- trunk/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm 2019-05-15 19:06:06 UTC (rev 245337)
+++ trunk/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm 2019-05-15 19:24:16 UTC (rev 245338)
@@ -359,7 +359,7 @@
[webView waitForSelectionViewRectsToBecome:expectedSelectionRects];
}
-TEST(KeyboardInputTests, DISABLED_KeyboardTypeForInput)
+TEST(KeyboardInputTests, KeyboardTypeForInput)
{
auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]);
auto inputDelegate = adoptNS([[TestInputDelegate alloc] init]);
@@ -369,11 +369,11 @@
}];
[webView _setInputDelegate:inputDelegate.get()];
[webView synchronouslyLoadHTMLString:@"<input id='input'>"];
+ [webView evaluateJavaScriptAndWaitForInputSessionToChange:@"input.focus()"];
auto runTest = ^(NSString *inputType, NSString *inputMode, NSString *pattern, UIKeyboardType expectedKeyboardType) {
- [webView stringByEvaluatingJavaScript:@"input.blur()"];
- [webView stringByEvaluatingJavaScript:[NSString stringWithFormat:@"input.type = '%@'; input.inputMode = '%@'; input.pattern = '%@'", inputType, inputMode, pattern]];
- [webView stringByEvaluatingJavaScript:@"input.focus()"];
+ [webView evaluateJavaScriptAndWaitForInputSessionToChange:@"input.blur()"];
+ [webView evaluateJavaScriptAndWaitForInputSessionToChange:[NSString stringWithFormat:@"input.type = '%@'; input.inputMode = '%@'; input.pattern = '%@'; input.focus()", inputType, inputMode, pattern]];
UIView<UITextInputPrivate> *textInput = (UIView<UITextInputPrivate> *)[webView textInputContentView];
UIKeyboardType keyboardType = [textInput textInputTraits].keyboardType;
@@ -401,7 +401,7 @@
@"tel": @(UIKeyboardTypePhonePad),
@"url": @(UIKeyboardTypeURL),
@"email": @(UIKeyboardTypeEmailAddress),
- @"numeric": @(UIKeyboardTypeNumbersAndPunctuation),
+ @"numeric": @(UIKeyboardTypeNumberPad),
@"decimal": @(UIKeyboardTypeDecimalPad),
@"search": @(UIKeyboardTypeWebSearch)
};
@@ -412,21 +412,17 @@
@"[0-9]*": @(UIKeyboardTypeNumberPad)
};
- for (NSString *inputType in [expectedKeyboardTypeForInputType allKeys]) {
- for (NSString *inputMode in [expectedKeyboardTypeForInputMode allKeys]) {
- for (NSString *pattern in [expectedKeyboardTypeForPattern allKeys]) {
+ for (NSString *inputType in expectedKeyboardTypeForInputType) {
+ BOOL isNumberOrTextInput = [inputType isEqual:@"text"] || [inputType isEqual:@"number"];
+ for (NSString *inputMode in expectedKeyboardTypeForInputMode) {
+ for (NSString *pattern in expectedKeyboardTypeForPattern) {
NSNumber *keyboardType;
if (inputMode.length) {
// inputmode has the highest priority.
keyboardType = expectedKeyboardTypeForInputMode[inputMode];
} else {
- if (pattern.length && ([inputType isEqual: @"text"] || [inputType isEqual: @"number"])) {
- // Special case for text and number inputs that have a numeric pattern.
- keyboardType = expectedKeyboardTypeForPattern[pattern];
- } else {
- // Otherwise, the input type determines the keyboard type.
- keyboardType = expectedKeyboardTypeForInputType[inputType];
- }
+ // Special case for text and number inputs that have a numeric pattern. Otherwise, the input type determines the keyboard type.
+ keyboardType = pattern.length && isNumberOrTextInput ? expectedKeyboardTypeForPattern[pattern] : expectedKeyboardTypeForInputType[inputType];
}
EXPECT_TRUE(runTest(inputType, inputMode, pattern, (UIKeyboardType)keyboardType.intValue));