Skip to content

input[type=number] accepts non-ASCII digits in Gecko (needs test coverage) #53441

Open
@kyouhei-horizumi

Description

@kyouhei-horizumi

Proposal

Firefox currently accepts and normalizes full-width digits (U+FF10–U+FF19) when entering values into .

This behavior appears to diverge from the HTML specification, which requires that the value conforms to the grammar for a valid floating-point number, i.e., using only ASCII digits, minus signs, and decimal points.

I propose adding a dedicated Web Platform Test to cover this behavior and ensure consistent implementation across browsers.

It would be useful to have a dedicated web platform test to ensure consistent behavior across browsers.

Tentative WPT snippet

Below is a tentative WPT-style test for <input type="number"> with full-width digits and symbols:

<!-- input-type-number-rejects-non-ascii-digits.tentative.html -->
<script>
    test(() => {
        const input = document.createElement('input');
        input.type = 'number';
        input.value = '234'; // full-width digits
        assert_equals(input.value, '', 'Full-width digits should not be accepted');
    }, 'Reject full-width digits (U+FF12 etc) in input[type=number]');
</script>

Console results

Firefox 141 Chrome 140 Safari 18.4
Image Image Image

Related issue


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions