[html5] r2311 - [] (0) WF2: <textarea maxlength>; also, factoring out common stuff for this from [...]
whatwg at whatwg.org
whatwg at whatwg.org
Thu Oct 9 16:57:10 PDT 2008
Author: ianh
Date: 2008-10-09 16:57:09 -0700 (Thu, 09 Oct 2008)
New Revision: 2311
Modified:
index
source
Log:
[] (0) WF2: <textarea maxlength>; also, factoring out common stuff for this from <input> to reduce duplication.
Modified: index
===================================================================
--- index 2008-10-09 20:32:34 UTC (rev 2310)
+++ index 2008-10-09 23:57:09 UTC (rev 2311)
@@ -521,8 +521,7 @@
<li><a href=#submit-button-state><span class=secno>4.10.4.1.17 </span>Submit Button state</a></li>
<li><a href=#image-button-state><span class=secno>4.10.4.1.18 </span>Image Button state</a></li>
<li><a href=#reset-button-state><span class=secno>4.10.4.1.19 </span>Reset Button state</a></li>
- <li><a href=#button-state><span class=secno>4.10.4.1.20 </span>Button state</a></li>
- <li><a href=#common-algorithms><span class=secno>4.10.4.1.21 </span>Common algorithms</a></ol></li>
+ <li><a href=#button-state><span class=secno>4.10.4.1.20 </span>Button state</a></ol></li>
<li><a href=#common-input-element-attributes><span class=secno>4.10.4.2 </span>Common <code>input</code> element attributes</a>
<ol>
<li><a href=#the-autocomplete-attribute><span class=secno>4.10.4.2.1 </span>The <code title=attr-input-autocomplete>autocomplete</code> attribute</a></li>
@@ -549,7 +548,8 @@
<li><a href=#naming-form-controls><span class=secno>4.10.13.1 </span>Naming form controls</a></li>
<li><a href=#enabling-and-disabling-form-controls><span class=secno>4.10.13.2 </span>Enabling and disabling form controls</a></li>
<li><a href="#a-form-control's-value"><span class=secno>4.10.13.3 </span>A form control's value</a></li>
- <li><a href=#autofocusing-a-form-control><span class=secno>4.10.13.4 </span>Autofocusing a form control</a></ol></li>
+ <li><a href=#autofocusing-a-form-control><span class=secno>4.10.13.4 </span>Autofocusing a form control</a></li>
+ <li><a href=#limiting-user-input-length><span class=secno>4.10.13.5 </span>Limiting user input length</a></ol></li>
<li><a href=#attributes-for-form-submission><span class=secno>4.10.14 </span>Attributes for form submission</a></li>
<li><a href=#constraints><span class=secno>4.10.15 </span>Constraints</a>
<ol>
@@ -1955,6 +1955,7 @@
such.</p>
+
<h4 id=common-parser-idioms><span class=secno>2.4.1 </span>Common parser idioms</h4>
<p>The <dfn id=space-character title="space character">space characters</dfn>, for the
@@ -1993,7 +1994,15 @@
<a href=#white_space>White_Space</a> characters. In both cases, the collected
characters are not used. <a href=#refsUNICODE>[UNICODE]</a></p>
+ <p>When a user agent is to <dfn id=strip-line-breaks>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 id=codepoint-length>codepoint length</dfn> of a string is the number of
+ Unicode codepoints in that string.</p>
+
+
+
<h4 id=boolean-attributes><span class=secno>2.4.2 </span>Boolean attributes</h4>
<p>A number of attributes in HTML5 are <dfn id=boolean-attribute title="boolean
@@ -23974,7 +23983,7 @@
element's <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
- follows:</strong> <a href=#strip-line-breaks-from-the-value>Strip line breaks from the value</a>.</p>
+ follows:</strong> <a href=#strip-line-breaks>Strip line breaks</a> from the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<div class=bookkeeping>
@@ -24038,7 +24047,7 @@
U+000D CARRIAGE RETURN (CR) characters into the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
- follows:</strong> <a href=#strip-line-breaks-from-the-value>Strip line breaks from the value</a>.</p>
+ follows:</strong> <a href=#strip-line-breaks>Strip line breaks</a> from the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<p><strong>Constraint validation:</strong> While the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element does not match
the <code>addr-spec</code> token defined in RFC 2822 section 3.4.1,
@@ -24110,7 +24119,7 @@
U+000D CARRIAGE RETURN (CR) characters into the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
- follows:</strong> <a href=#strip-line-breaks-from-the-value>Strip line breaks from the value</a>.</p>
+ follows:</strong> <a href=#strip-line-breaks>Strip line breaks</a> from the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<p><strong>Constraint validation:</strong> While the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element is not a
<a href=#valid-url>valid URL</a>, the element is <a href=#suffering-from-a-type-mismatch>suffering from a type
@@ -24176,7 +24185,7 @@
FEED (LF) or U+000D CARRIAGE RETURN (CR) characters into the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as
- follows:</strong> <a href=#strip-line-breaks-from-the-value>Strip line breaks from the value</a>.</p>
+ follows:</strong> <a href=#strip-line-breaks>Strip line breaks</a> from the <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
<div class=bookkeeping>
@@ -25748,14 +25757,7 @@
- <h6 id=common-algorithms><span class=secno>4.10.4.1.21 </span>Common algorithms</h6>
- <p>When a user agent is to <dfn id=strip-line-breaks-from-the-value>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 <a href=#concept-fe-value title=concept-fe-value>value</a>.</p>
-
-
-
<h5 id=common-input-element-attributes><span class=secno>4.10.4.2 </span>Common <code><a href=#the-input-element>input</a></code> element attributes</h5>
<p>These attributes only apply to an <code><a href=#the-input-element>input</a></code> element if
@@ -25925,39 +25927,19 @@
<h6 id=the-maxlength-attribute><span class=secno>4.10.4.2.6 </span>The <code title=attr-input-maxlength><a href=#attr-input-maxlength>maxlength</a></code> attribute</h6>
- <p>The <dfn id=attr-input-maxlength title=attr-input-maxlength><code>maxlength</code></dfn> attribute
- allows authors to specify the maximum length allowed for user
- input.</p>
+ <p>The <dfn id=attr-input-maxlength title=attr-input-maxlength><code>maxlength</code></dfn> attribute,
+ when it applies, is a <a href=#attr-fe-maxlength title=attr-fe-maxlength>form control
+ <code title="">maxlength</code> attribute</a> controlled by the
+ <code><a href=#the-input-element>input</a></code> element's <a href=#concept-input-value-dirty-flag title=concept-input-value-dirty-flag>dirty value flag</a>.</p>
- <p>The <dfn id=codepoint-length>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
- <a href=#valid-non-negative-integer>valid non-negative integer</a>. If the attribute is
- specified and applying the <a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative
- integers</a> to its value results in a number, then that number
- is the element's <dfn id=maximum-allowed-value-length>maximum allowed value length</dfn>. If the
- attribute is omitted or parsing its value results in an error, then
- there is no <a href=#maximum-allowed-value-length>maximum allowed value length</a>.</p>
-
<p>If the <code><a href=#the-input-element>input</a></code> element has a <a href=#maximum-allowed-value-length>maximum allowed
value length</a>, then the <a href=#codepoint-length>codepoint length</a> of the
value of the element's <code title=attr-input-value><a href=#attr-input-value>value</a></code>
attribute must be equal to or less than the element's <a href=#maximum-allowed-value-length>maximum
allowed value length</a>.</p>
- <p><strong>Constraint validation:</strong> If an <code><a href=#the-input-element>input</a></code>
- element has a <a href=#maximum-allowed-value-length>maximum allowed value length</a>, its <a href=#concept-input-value-dirty-flag title=concept-input-value-dirty-flag>dirty value flag</a> is
- false, and the <a href=#codepoint-length>codepoint length</a> of the element's <a href=#concept-fe-value title=concept-fe-value>value</a> is greater than the element's
- <a href=#maximum-allowed-value-length>maximum allowed value length</a>, then the element is
- <a href=#suffering-from-being-too-long>suffering from being too long</a>.</p>
- <p>User agents may prevent the user from setting the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to a value whose
- <a href=#codepoint-length>codepoint length</a> is greater than the element's
- <a href=#maximum-allowed-value-length>maximum allowed value length</a>.</p>
-
-
<h6 id=the-pattern-attribute><span class=secno>4.10.4.2.7 </span>The <code title=attr-input-pattern><a href=#attr-input-pattern>pattern</a></code> attribute</h6>
<p>The <dfn id=attr-input-pattern title=attr-input-pattern><code>pattern</code></dfn>
@@ -26970,8 +26952,17 @@
U+000D CARRIAGE RETURN - U+000A LINE FEED (CRLF) character
pairs.</li>
- </ol><p class=XXX> ... <dfn id=attr-textarea-maxlength title=attr-textarea-maxlength><code>maxlength</code></dfn>
+ </ol><p>The <dfn id=attr-textarea-maxlength title=attr-textarea-maxlength><code>maxlength</code></dfn>
+ attribute is a <a href=#attr-fe-maxlength title=attr-fe-maxlength>form control <code title="">maxlength</code> attribute</a> controlled by the
+ <code><a href=#the-textarea-element>textarea</a></code> element's <a href=#concept-textarea-dirty title=concept-textarea-dirty>dirty value flag</a>.</p>
+ <p>If the <code><a href=#the-textarea-element>textarea</a></code> element has a <a href=#maximum-allowed-value-length>maximum allowed
+ value length</a>, then the element's children must be such that
+ the <a href=#codepoint-length>codepoint length</a> of the value of the element's
+ <code><a href=#textcontent>textContent</a></code> DOM attribute is equal to or less than the
+ element's <a href=#maximum-allowed-value-length>maximum allowed value length</a>.</p>
+
+
<p class=XXX> ... <dfn id=attr-textarea-required title=attr-textarea-required><code>required</code></dfn>
<p class=XXX> ... <dfn id=attr-textarea-accept title=attr-textarea-accept><code>accept</code></dfn>
@@ -27230,7 +27221,33 @@
</div>
+ <h5 id=limiting-user-input-length><span class=secno>4.10.13.5 </span>Limiting user input length</h5>
+ <p>A <dfn id=attr-fe-maxlength 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 <a href=#attr-fe-maxlength title=attr-fe-maxlength>form
+ control <code title="">maxlength</code> attribute</a> specified,
+ the attribute's value must be a <a href=#valid-non-negative-integer>valid non-negative
+ integer</a>. If the attribute is specified and applying the
+ <a href=#rules-for-parsing-non-negative-integers>rules for parsing non-negative integers</a> to its value
+ results in a number, then that number is the element's <dfn id=maximum-allowed-value-length>maximum
+ allowed value length</dfn>. If the attribute is omitted or parsing
+ its value results in an error, then there is no <a href=#maximum-allowed-value-length>maximum
+ allowed value length</a>.</p>
+
+ <p><strong>Constraint validation:</strong> If an element has a
+ <a href=#maximum-allowed-value-length>maximum allowed value length</a>, and its <var title="">dirty value flag</var> is false, and the <a href=#codepoint-length>codepoint
+ length</a> of the element's <a href=#concept-fe-value title=concept-fe-value>value</a> is greater than the element's
+ <a href=#maximum-allowed-value-length>maximum allowed value length</a>, then the element is
+ <a href=#suffering-from-being-too-long>suffering from being too long</a>.</p>
+
+ <p>User agents may prevent the user from causing the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to be set to a value whose
+ <a href=#codepoint-length>codepoint length</a> is greater than the element's
+ <a href=#maximum-allowed-value-length>maximum allowed value length</a>.</p>
+
+
+
<h4 id=attributes-for-form-submission><span class=secno>4.10.14 </span><dfn>Attributes for form submission</dfn></h4>
<p class=XXX>... <dfn id=attr-fs-action title=attr-fs-action>action</dfn> content attribute</p>
Modified: source
===================================================================
--- source 2008-10-09 20:32:34 UTC (rev 2310)
+++ source 2008-10-09 23:57:09 UTC (rev 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>
More information about the Commit-Watchers
mailing list