W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2013

Re: [whatwg] Can the maximum allowed value length be changed to restrict the number of characters?

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Tue, 20 Aug 2013 10:33:12 -0400
Message-ID: <52137E28.80101@mit.edu>
To: whatwg@lists.whatwg.org
On 8/19/13 7:40 PM, Ryosuke Niwa wrote:
> Also, http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#the-maxlength-attribute says "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."
>
> This doesn't seem to match the behaviors of existing Web browsers

The spec bit you quote above is an _authoring_ conformance requirement. 
  That is <input maxlength="2" value="abc"> is not valid HTML and a 
validator would flag it as invalid.  What UAs do with this markup, on 
the other hand, is defined by the UA conformance requirements, and what 
they do is allow a value longer than maxlength if it's specified.

> or http://www.whatwg.org/specs/web-apps/current-work/multipage/association-of-controls-and-forms.html#maximum-allowed-value-length

These are the UA conformance requirements in question.

> The paragraph should be revised to mention and only mention that the maxlength attribute affects the validation and the user agents may prevent the user from typing more characters than the specified value.

The basic question is whether a validator should flag <input 
maxlength="2" value="abc"> as a conformance error or not.  It seems to 
me like it should.

-Boris
Received on Tuesday, 20 August 2013 14:45:15 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:23 UTC