maxLength not enforced with negative values
Reported by
seba.ker...@gmail.com,
Apr 21 2016
|
||
Issue descriptionUserAgent: 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
,
Apr 22 2016
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 |
||
Comment 1 by dtapu...@chromium.org
, Apr 22 2016