WebKit Bugzilla
Attachment 369969 Details for
Bug 197916
: inputmode="numeric" should show a number pad with digits 0-9, instead of the numeric keyplane
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197916-20190515103855.patch (text/plain), 7.00 KB, created by
Wenson Hsieh
on 2019-05-15 10:38:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Wenson Hsieh
Created:
2019-05-15 10:38:56 PDT
Size:
7.00 KB
patch
obsolete
>Subversion Revision: 245325 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index b25a8b549bd0b2dd3fc1a5ba0914c60becb9192c..b76b69cddb559b692d5326104e07eb5156ffb1ff 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,21 @@ >+2019-05-15 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ 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 Alex Christensen <achristensen@webkit.org> > > Allow NSFileCoordinator to be called from WebContent process >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index b8aa435a4992228d18cd5812c54c836f3937a6a6..4803498f7d398a787ea72ae44705a55b65014be5 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -4380,7 +4380,7 @@ - (UITextInputTraits *)textInputTraits > [_traits setKeyboardType:UIKeyboardTypeEmailAddress]; > break; > case WebCore::InputMode::Numeric: >- [_traits setKeyboardType:UIKeyboardTypeNumbersAndPunctuation]; >+ [_traits setKeyboardType:UIKeyboardTypeNumberPad]; > break; > case WebCore::InputMode::Decimal: > [_traits setKeyboardType:UIKeyboardTypeDecimalPad]; >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 06198de47d8bed4478bf147c9832c7063174b532..168d944af8bfa4b05b6cb53b83c55608bb9cf56c 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,17 @@ >+2019-05-15 Wenson Hsieh <wenson_hsieh@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ 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 Philippe Normand <pnormand@igalia.com> > > [GTK][jhbuild] misc cleanups and bumps >diff --git a/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm b/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >index 655ef1309318a5cb4615119beb04c9adf114c421..fe3b01d57e0a2d4f3df5cc04f0a5ca9c37dfdd04 100644 >--- a/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >+++ b/Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm >@@ -359,7 +359,7 @@ TEST(KeyboardInputTests, RangedSelectionRectAfterRestoringFirstResponder) > [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 @@ TEST(KeyboardInputTests, DISABLED_KeyboardTypeForInput) > }]; > [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 @@ TEST(KeyboardInputTests, DISABLED_KeyboardTypeForInput) > @"tel": @(UIKeyboardTypePhonePad), > @"url": @(UIKeyboardTypeURL), > @"email": @(UIKeyboardTypeEmailAddress), >- @"numeric": @(UIKeyboardTypeNumbersAndPunctuation), >+ @"numeric": @(UIKeyboardTypeNumberPad), > @"decimal": @(UIKeyboardTypeDecimalPad), > @"search": @(UIKeyboardTypeWebSearch) > }; >@@ -412,21 +412,17 @@ TEST(KeyboardInputTests, DISABLED_KeyboardTypeForInput) > @"[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));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197916
: 369969