Closed Bug 1415513 Opened 9 years ago Closed 3 years ago

Value of input tag is not equal to entered value

Categories

(Core :: Layout: Form Controls, defect, P3)

56 Branch
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: kostya1917, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0 Build ID: 20171003101214 Steps to reproduce: Firefox allows use dot or comma to separate decimal figure in input field with number type. Actual results: See here http://jsbin.com/fukuhudafo/1/edit?html,js,console,output For example: 1. Enter 1.333 figure and see console output (1.333) 2. Enter 1,333 figure and see console output (1333 - without separator dot or comma) If you set lang attribute to another language this behavior would be changed for dot and comma. Expected results: Must be correct value and don't depend on separator (dot or comma).
Summary: Value of input tag is not equal entered value → Value of input tag is not equal to entered value
Component: Untriaged → Layout: Form Controls
Product: Firefox → Core
Priority: -- → P3
Severity: normal → S3

It doesn't appear that commas are allowed here by the spec.

Per §4.10.5.1.12 Input element - Number state:

The value attribute, if specified and not empty, must have a value that is a valid floating-point number.

Per §2.3.4.3 Floating-point numbers:

A string is a valid floating-point number if it consists of:

  1. Optionally, a U+002D HYPHEN-MINUS character (-).
  2. One or both of the following, in the given order:
    1. A series of one or more ASCII digits.
    2. Both of the following, in the given order:
      1. A single U+002E FULL STOP character (.).
      2. A series of one or more ASCII digits.
  3. Optionally:
    1. Either a U+0065 LATIN SMALL LETTER E character (e) or a U+0045 LATIN CAPITAL LETTER E character (E).
    2. Optionally, a U+002D HYPHEN-MINUS character (-) or U+002B PLUS SIGN character (+).
    3. A series of one or more ASCII digits.

Per spec, an invalid floating-point number in the value field should produce an empty string, which it didn't according to the original bug report but it does as of 119, so I think we can close this?

Flags: needinfo?(emilio)

Yeah would be good to find when this was fixed.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(emilio)
Resolution: --- → WORKSFORME

:emilio I got you: Bug 1509057

Narrowed to this Nightly range with mozregression and grepped for input, based on the test change in the patch I'm pretty sure this is the one.

You need to log in before you can comment on or make changes to this bug.