[Webkit-unassigned] [Bug 207981] New: input type='number' with maxlength attribute is ignored
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Feb 19 18:00:46 PST 2020
https://bugs.webkit.org/show_bug.cgi?id=207981
Bug ID: 207981
Summary: input type='number' with maxlength attribute is
ignored
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Forms
Assignee: webkit-unassigned at lists.webkit.org
Reporter: karl+webkit at la-grange.net
CC: cdumez at apple.com, wenson_hsieh at apple.com
Created attachment 391234
--> https://bugs.webkit.org/attachment.cgi?id=391234&action=review
test case for input/number and maxlength
Steps to reproduce the problem:
1. Open the test case
2. Type 123 in the input form
What is the expected behavior?
12 is displayed
What went wrong?
123 is displayed
Did this work before? N/A
Does this work in other browsers? N/A
Safari version: Release 100 (Safari 13.2, WebKit 15610.1.2.1)) Channel: Tech Preview
OS Version: OS X 10.15
Flash Version:
What is the spec saying https://html.spec.whatwg.org/multipage/input.html#attr-input-maxlength
> The maxlength attribute, when it applies, is a form control maxlength attribute.
Following https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fe-maxlength
> Constraint validation: If an element has a maximum allowed value length, its dirty value flag is true, its value was last changed by a user edit (as opposed to a change made by a script), and the JavaScript string length of the element's API value is greater than the element's maximum allowed value length, then the element is suffering from being too long.
>
> User agents may prevent the user from causing the element's API value to be set to a value whose JavaScript string length is greater than the element's maximum allowed value length.
It doesn't seem a hard constraint, but
## results for type='number'
1. enter into the url bar
```
data:text/html,<input type='number' maxlength='2'/>
```
2. type 123
Results in different browsers
* firefox: 12 (75.0a1 (2020-02-18) (64-bit))
* chrome: 123 (Version 82.0.4062.4 (Build officiel) canary (64 bits))
* safari: 123 (Release 100 (Safari 13.2, WebKit 15610.1.2.1))
## results for type='text'
```
data:text/html,<input type='text' maxlength='2'/>
```
Results in different browsers
* firefox: 12 (75.0a1 (2020-02-18) (64-bit))
* chrome: 12 (Version 82.0.4062.4 (Build officiel) canary (64 bits))
* safari: 12 (Release 100 (Safari 13.2, WebKit 15610.1.2.1))
This was originally filed as a bug on mozilla bugzilla
https://bugzilla.mozilla.org/show_bug.cgi?id=1616620
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200220/75465d6f/attachment-0001.htm>
More information about the webkit-unassigned
mailing list