NEW 284363
<input type="number"> does not support full-width numbers (e.g., "ー200") for Japanese IME users
https://bugs.webkit.org/show_bug.cgi?id=284363
Summary <input type="number"> does not support full-width numbers (e.g., "ー200") for ...
Kyouhei Horizumi
Reported 2024-12-10 04:19:51 PST
When entering full-width numbers in an `<input type="number">` field and pressing Enter, the entered value disappears. Unlike Firefox, Webkit-based browsers do not support full-width number input. This results in complaints from some Japanese users, especially those unfamiliar with input limitations, as they are unable to input numbers. Safari should allow full-width number input, similar to Firefox. ## Reproduction Steps: 1. Create an `<input type="number">` field. 2. Try entering the value `ー200` (a full-width number). ## Expected Behavior: The browser should accept full-width numbers as valid input and convert them to their half-width equivalents when necessary, similar to Firefox. ## Actual Behavior: ### Safari: Input value: ー200 (input allowed, but invalid) .value: "" .valueAsNumber: NaN ### Firefox: Input value: ー200 (input allowed, valid) .value: "-200" .valueAsNumber: -200 ### Chrome: Input value: ー200 (unable to input) .value: "" .valueAsNumber: NaN ## Environment: + Safari Technology Preview Release 209 (Safari 18.2, Webkit 20621.1.6) (macOS 15) + Firefox 133.0 (Windows 11) + Chrome 131.0.6778.109 (Windows 11) ## Reference https://issuetracker.google.com/issues/383232110
Attachments
testcase (898 bytes, text/html)
2024-12-18 21:53 PST, Karl Dubost
no flags
Japanese Full-width Input Normalization Test (3.66 KB, text/html)
2025-06-22 09:52 PDT, Kyouhei Horizumi
no flags
Patch (14.37 KB, patch)
2025-06-22 23:07 PDT, Kyouhei Horizumi
kyouhei.horizumi: review?
ews-feeder: commit-queue-
Japanese Full-width Input Normalization Testcase (4.40 KB, text/html)
2025-06-24 11:43 PDT, Kyouhei Horizumi
no flags
Japanese Full-width Input Normalization Testcase (4.42 KB, text/html)
2025-06-24 11:46 PDT, Kyouhei Horizumi
no flags
Radar WebKit Bug Importer
Comment 1 2024-12-10 18:46:53 PST
Kyouhei Horizumi
Comment 2 2024-12-13 01:12:13 PST
Sorry, I initially wrote that when entering full-width numbers in an <input type="number"> field and pressing Enter, the entered value disappears. However, I need to correct this: that behavior occurs in Chrome. In WebKit, the value does not disappear when pressing Enter but is internally treated as empty.
Karl Dubost
Comment 3 2024-12-18 21:53:18 PST
Created attachment 473601 [details] testcase This is a testcase to quickly try the issue for someone.
Anne van Kesteren
Comment 4 2024-12-18 23:15:13 PST
See also bug 250535. We're generally pretty strict at the moment for end user input, which isn't ideal.
Kyouhei Horizumi
Comment 5 2025-06-22 09:52:42 PDT
Created attachment 475624 [details] Japanese Full-width Input Normalization Test Replacing the previous test with a complete, self-contained test case for <input type="number"> normalization. This test covers: - Full-width digits (U+FF10–U+FF19) - Minus sign variants: - U+FF0D (full-width hyphen-minus, common on Windows) - U+30FC (long sound mark, inserted by IMEs when typing minus in kana mode) - U+2212 (Unicode minus sign, common on macOS) - Full-width full stop (U+FF0E)
Kyouhei Horizumi
Comment 6 2025-06-22 23:07:13 PDT
Karl Dubost
Comment 7 2025-06-23 01:16:51 PDT
are there tests for web platform tests? Maybe some additional tests to add to https://wpt.fyi/results/html/semantics/forms/the-input-element
Kyouhei Horizumi
Comment 8 2025-06-23 01:49:35 PDT
For now, I’ve only added a LayoutTests. I’ll look into adding a WPT later.
Kyouhei Horizumi
Comment 9 2025-06-23 08:27:39 PDT
(In reply to Karl Dubost from comment #7) > are there tests for web platform tests? > > Maybe some additional tests to add to > https://wpt.fyi/results/html/semantics/forms/the-input-element As far as I understand, there is a patch under review in WebKit that normalizes full-width characters entered into <input type="number"> fields: - Full-width digits: U+FF10–U+FF19 - Minus variants: - U+30FC (long sound mark) - U+FF0D (full-width hyphen-minus, often from Windows) - U+2212 (Unicode minus sign, often from macOS) - Full-width full stop: U+FF0E These characters are mapped to their ASCII equivalents during native text input — not via JavaScript assignment to `.value`. (Note that in WebKit and Firefox, assigning full-width characters to `.value` is accepted, while in Chromium it is not, since such behavior is currently outside the scope of the HTML specification.) Since Web Platform Tests (WPT) are intended to cover only behaviors explicitly defined in the HTML specification, we cannot add corresponding WPTs unless this normalization is formally specified. This raises a broader question: **Should this normalization be defined in the HTML specification, so that all engines behave consistently?** At present, this is treated as an implementation detail within each engine's input handling layer. But from a user’s perspective — especially in Japanese input environments — numeric input is expected to “just work,” regardless of character variants. Would you be open to discussing whether this behavior could be standardized (e.g., through parsing/sanitization rules or input behavior notes)? I'm happy to draft an issue on WHATWG if you think it would be appropriate.
Alexey Proskuryakov
Comment 10 2025-06-23 08:43:03 PDT
Comment on attachment 475626 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=475626&action=review > LayoutTests/fast/forms/number/number-fullwidth-numeral-normalization-expected.txt:7 > + text run at (0,0) width 37: "PASS" Given that this is a pass/fail test, having a render tree dump makes it more difficult to maintain (unnecessary dependency on font sizes). And definitely no need for a .png expectation here. You can start with the `make-new-script-test` script to create a template, and then you can mostly copy/paste into it. I do not have any opinions about the rest of the proposed patch.
Kyouhei Horizumi
Comment 11 2025-06-23 08:48:36 PDT
(In reply to Alexey Proskuryakov from comment #10) > Comment on attachment 475626 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=475626&action=review > > > LayoutTests/fast/forms/number/number-fullwidth-numeral-normalization-expected.txt:7 > > + text run at (0,0) width 37: "PASS" > > Given that this is a pass/fail test, having a render tree dump makes it more > difficult to maintain (unnecessary dependency on font sizes). And definitely > no need for a .png expectation here. > > You can start with the `make-new-script-test` script to create a template, > and then you can mostly copy/paste into it. > > I do not have any opinions about the rest of the proposed patch. Thank you for the review. I'll follow your suggestion and create the test using make-new-script-test as a pass/fail test without relying on render tree dumps or PNG expectations. Also, since it's more common nowadays, I'll prepare a revised version as a GitHub Pull Request rather than a patch file.
Kyouhei Horizumi
Comment 12 2025-06-23 17:59:58 PDT
Kyouhei Horizumi
Comment 13 2025-06-24 11:43:56 PDT
Created attachment 475644 [details] Japanese Full-width Input Normalization Testcase
Kyouhei Horizumi
Comment 14 2025-06-24 11:46:19 PDT
Created attachment 475645 [details] Japanese Full-width Input Normalization Testcase
Note You need to log in before you can comment on or make changes to this bug.