New issue
Advanced search Search tips

Issue 605694 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Apr 2016
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

maxLength not enforced with negative values

Reported by seba.ker...@gmail.com, Apr 21 2016

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. Have an input field with a negative maxLength, e.g. <input type="text" maxLength="-1">
2. Try to type in it, and you can type whatever you want

What is the expected behavior?
The HTML5 spec (both w3c and WhatWG): https://www.w3.org/TR/html5/forms.html#the-maxlength-and-minlength-attributes doesn't say the value of maxLength can't be a negative integer. It does however specify: "If the input element has a maximum allowed value length, then the code-unit length of the value of the element's value attribute must be equal to or less than the element's maximum allowed value length." Therefore one would assume that a value of "-1" would allow no typing in the field.

This seems to be correct in IE11 and Edge. Behavior in firefox is same as chrome.

What went wrong?
I can type, but shouldn't be able to.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? No firefox 

Chrome version: 49.0.2623.112  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 21.0 r0
 
Components: -Blink Blink>Forms

Comment 2 by tkent@chromium.org, Apr 22 2016

Components: -Blink>Forms Blink>Forms>Maxlength
Owner: tkent@chromium.org
Status: WontFix (was: Unconfirmed)
https://www.w3.org/TR/html5/forms.html#attr-fe-maxlength clearly says "there is no maximum allowed value length" in such case.

Sign in to add a comment