Short URL: http://html5.org/r/2311
| SVN | Bug | Comment | Time (UTC) |
|---|---|---|---|
| 2311 | WF2: <textarea maxlength>; also, factoring out common stuff for this from <input> to reduce duplication. | 2008-10-09 23:57 |
Index: source =================================================================== --- source (revision 2310) +++ source (revision 2311) @@ -1033,6 +1033,7 @@ such.</p> + <h4>Common parser idioms</h4> <p>The <dfn title="space character">space characters</dfn>, for the @@ -1082,7 +1083,15 @@ <span>White_Space</span> characters. In both cases, the collected characters are not used. <a href="#refsUNICODE">[UNICODE]</a></p> + <p>When a user agent is to <dfn>strip line breaks</dfn> from a + string, the user agent must remove any U+000A LINE FEED (LF) and + U+000D CARRIAGE RETURN (CR) characters from that string.</p> + <p>The <dfn>codepoint length</dfn> of a string is the number of + Unicode codepoints in that string.</p> + + + <h4>Boolean attributes</h4> <p>A number of attributes in HTML5 are <dfn title="boolean @@ -26656,7 +26665,8 @@ element's <span title="concept-fe-value">value</span>.</p> <p><strong>The <span>value sanitization algorithm</span> is as - follows:</strong> <span>Strip line breaks from the value</span>.</p> + follows:</strong> <span>Strip line breaks</span> from the <span + title="concept-fe-value">value</span>.</p> <div class="bookkeeping"> @@ -26727,7 +26737,8 @@ title="concept-fe-value">value</span>.</p> <p><strong>The <span>value sanitization algorithm</span> is as - follows:</strong> <span>Strip line breaks from the value</span>.</p> + follows:</strong> <span>Strip line breaks</span> from the <span + title="concept-fe-value">value</span>.</p> <p><strong>Constraint validation:</strong> While the <span title="concept-fe-value">value</span> of the element does not match @@ -26807,7 +26818,8 @@ title="concept-fe-value">value</span>.</p> <p><strong>The <span>value sanitization algorithm</span> is as - follows:</strong> <span>Strip line breaks from the value</span>.</p> + follows:</strong> <span>Strip line breaks</span> from the <span + title="concept-fe-value">value</span>.</p> <p><strong>Constraint validation:</strong> While the <span title="concept-fe-value">value</span> of the element is not a @@ -26879,7 +26891,8 @@ title="concept-fe-value">value</span>.</p> <p><strong>The <span>value sanitization algorithm</span> is as - follows:</strong> <span>Strip line breaks from the value</span>.</p> + follows:</strong> <span>Strip line breaks</span> from the <span + title="concept-fe-value">value</span>.</p> <div class="bookkeeping"> @@ -28706,15 +28719,7 @@ - <h6>Common algorithms</h6> - <p>When a user agent is to <dfn>strip line breaks from the - value</dfn>, the user agent must remove any U+000A LINE FEED (LF) - and U+000D CARRIAGE RETURN (CR) characters from <span - title="concept-fe-value">value</span>.</p> - - - <h5>Common <code>input</code> element attributes</h5> <p>These attributes only apply to an <code>input</code> element if @@ -28909,42 +28914,20 @@ <h6>The <code title="attr-input-maxlength">maxlength</code> attribute</h6> <p>The <dfn - title="attr-input-maxlength"><code>maxlength</code></dfn> attribute - allows authors to specify the maximum length allowed for user - input.</p> + title="attr-input-maxlength"><code>maxlength</code></dfn> attribute, + when it applies, is a <span title="attr-fe-maxlength">form control + <code title="">maxlength</code> attribute</span> controlled by the + <code>input</code> element's <span + title="concept-input-value-dirty-flag">dirty value flag</span>.</p> - <p>The <dfn>codepoint length</dfn> of a string is the number of - Unicode codepoints in that string.</p> - - <p>If the attribute is specified, the attribute's value must be a - <span>valid non-negative integer</span>. If the attribute is - specified and applying the <span>rules for parsing non-negative - integers</span> to its value results in a number, then that number - is the element's <dfn>maximum allowed value length</dfn>. If the - attribute is omitted or parsing its value results in an error, then - there is no <span>maximum allowed value length</span>.</p> - <p>If the <code>input</code> element has a <span>maximum allowed value length</span>, then the <span>codepoint length</span> of the value of the element's <code title="attr-input-value">value</code> attribute must be equal to or less than the element's <span>maximum allowed value length</span>.</p> - <p><strong>Constraint validation:</strong> If an <code>input</code> - element has a <span>maximum allowed value length</span>, its <span - title="concept-input-value-dirty-flag">dirty value flag</span> is - false, and the <span>codepoint length</span> of the element's <span - title="concept-fe-value">value</span> is greater than the element's - <span>maximum allowed value length</span>, then the element is - <span>suffering from being too long</span>.</p> - <p>User agents may prevent the user from setting the element's <span - title="concept-fe-value">value</span> to a value whose - <span>codepoint length</span> is greater than the element's - <span>maximum allowed value length</span>.</p> - - <h6>The <code title="attr-input-pattern">pattern</code> attribute</h6> <p>The <dfn title="attr-input-pattern"><code>pattern</code></dfn> @@ -30252,8 +30235,20 @@ </ol> - <p class="XXX"> ... <dfn title="attr-textarea-maxlength"><code>maxlength</code></dfn> + <p>The <dfn + title="attr-textarea-maxlength"><code>maxlength</code></dfn> + attribute is a <span title="attr-fe-maxlength">form control <code + title="">maxlength</code> attribute</span> controlled by the + <code>textarea</code> element's <span + title="concept-textarea-dirty">dirty value flag</span>.</p> + <p>If the <code>textarea</code> element has a <span>maximum allowed + value length</span>, then the element's children must be such that + the <span>codepoint length</span> of the value of the element's + <code>textContent</code> DOM attribute is equal to or less than the + element's <span>maximum allowed value length</span>.</p> + + <p class="XXX"> ... <dfn title="attr-textarea-required"><code>required</code></dfn> <p class="XXX"> ... <dfn title="attr-textarea-accept"><code>accept</code></dfn> @@ -30553,7 +30548,38 @@ </div> + <h5>Limiting user input length</h5> + <p>A <dfn title="attr-fe-maxlength">form control <code + title="">maxlength</code> attribute</dfn>, controlled by a <var + title="">dirty value flag</var> declares a limit on the number of + characters a user can input.</p> + + <p>If an element has its <span title="attr-fe-maxlength">form + control <code title="">maxlength</code> attribute</span> specified, + the attribute's value must be a <span>valid non-negative + integer</span>. If the attribute is specified and applying the + <span>rules for parsing non-negative integers</span> to its value + results in a number, then that number is the element's <dfn>maximum + allowed value length</dfn>. If the attribute is omitted or parsing + its value results in an error, then there is no <span>maximum + allowed value length</span>.</p> + + <p><strong>Constraint validation:</strong> If an element has a + <span>maximum allowed value length</span>, and its <var + title="">dirty value flag</var> is false, and the <span>codepoint + length</span> of the element's <span + title="concept-fe-value">value</span> is greater than the element's + <span>maximum allowed value length</span>, then the element is + <span>suffering from being too long</span>.</p> + + <p>User agents may prevent the user from causing the element's <span + title="concept-fe-value">value</span> to be set to a value whose + <span>codepoint length</span> is greater than the element's + <span>maximum allowed value length</span>.</p> + + + <h4><dfn>Attributes for form submission</dfn></h4> <p class="XXX">... <dfn title="attr-fs-action">action</dfn> content attribute</p>