[html5] r7518 - [giow] (1) Make stepUp/stepDown more useful; provide a way to detect when the us [...]

whatwg at whatwg.org whatwg at whatwg.org
Tue Nov 20 14:52:10 PST 2012


Author: ianh
Date: 2012-11-20 14:52:09 -0800 (Tue, 20 Nov 2012)
New Revision: 7518

Modified:
   complete.html
   index
   source
Log:
[giow] (1) Make stepUp/stepDown more useful; provide a way to detect when the user's input is something the UA isn't allowed to set the the control's value to.
Affected topics: DOM APIs, HTML

Modified: complete.html
===================================================================
--- complete.html	2012-11-20 19:49:21 UTC (rev 7517)
+++ complete.html	2012-11-20 22:52:09 UTC (rev 7518)
@@ -49128,6 +49128,10 @@
     <a href=#concept-fe-value title=concept-fe-value>value</a> to IDN in the display
     and vice versa.</p>
 
+    <p><strong>Constraint validation</strong>: While the user interface is representing input that
+    the user agent cannot convert to punycode, the control is <a href=#suffering-from-bad-input>suffering from bad
+    input</a>.</p>
+
     </div>
 
     <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
@@ -49185,6 +49189,10 @@
     <a href=#concept-fe-value title=concept-fe-value>value</a> to IDN in the display
     and vice versa.</p>
 
+    <p><strong>Constraint validation</strong>: While the user interface describes a situation where
+    an individual value contains a U+002C COMMA (,) or is representing input that the user agent
+    cannot convert to punycode, the control is <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
     <p>Whenever the user changes the element's <a href=#concept-fe-value title=concept-fe-value>value<em>s</em></a>, the user agent
     must run the following steps:</p>
 
@@ -49466,6 +49474,10 @@
   normalized forced-UTC global date and time string</a> representing the
   user's selection. User agents should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-normalized-forced-utc-global-date-and-time-string>valid normalized forced-UTC global date and time string</a>,
+  the control is <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
   </div>
 
   <p class=note>See the <a href=#input-author-notes>introduction
@@ -49671,6 +49683,10 @@
   date string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-date-string>valid date string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
   </div>
 
   <p class=note>See the <a href=#input-author-notes>introduction
@@ -49829,14 +49845,18 @@
   month string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-month-string>valid month string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-month-string>valid
   month string</a>.</p> <!-- ok to set out-of-range value, we never
@@ -49986,14 +50006,18 @@
   week string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-week-string>valid week string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-week-string>valid
   week string</a>.</p> <!-- ok to set out-of-range value, we never
@@ -50147,14 +50171,18 @@
   time string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-time-string>valid time string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-time-string>valid
   time string</a>.</p> <!-- ok to set out-of-range value, we never
@@ -50305,14 +50333,18 @@
   string</a> representing the user's selection. User agents should
   allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-normalized-local-date-and-time-string>valid normalized local date and time string</a>, the control is
+  <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-local-date-and-time-string>valid
   local date and time string</a>.</p> <!-- ok to set out-of-range
@@ -50485,6 +50517,10 @@
   representing the user's selection as a floating-point number</a>.
   User agents should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-floating-point-number>valid floating-point number</a>, the control is <a href=#suffering-from-bad-input>suffering
+  from bad input</a>.</p>
+
   </div>
 
   <p class=note>This specification does not define what user
@@ -50657,6 +50693,10 @@
   selection as a floating-point number</a>. User agents must not
   allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-floating-point-number>valid floating-point number</a>, the control is <a href=#suffering-from-bad-input>suffering
+  from bad input</a>.</p>
+
   </div>
 
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
@@ -50885,6 +50925,10 @@
   the user's selection. User agents must not allow the user to set the
   <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-lowercase-simple-color>valid lowercase simple color</a>, the control is
+  <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
   </div>
 
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
@@ -52784,10 +52828,9 @@
     <var title="">n</var>. The default value for <var title="">n</var>
     is 1.</p>
 
-    <p>Throws <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the control
-    is neither date- or time-based nor numeric, if the <code title=attr-input-step><a href=#attr-input-step>step</a></code> attribute's value is "<code title="">any</code>", if the current <a href=#concept-fe-value title=concept-fe-value>value</a> could not be parsed, or if
-    stepping in the given direction by the given amount would take the
-    value out of range.</p>
+    <p>Throws <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the control is neither date- or time-based
+    nor numeric, or if the <code title=attr-input-step><a href=#attr-input-step>step</a></code> attribute's value is "<code title="">any</code>". Does nothing if it would take the control's value out of range or if the
+    control currently has no value.</p>
 
    </dd>
 
@@ -52944,12 +52987,16 @@
    <code><a href=#invalidstateerror>InvalidStateError</a></code> exception, and abort these
    steps.</li>
 
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a> and a <a href=#concept-input-max title=concept-input-max>maximum</a> and the <a href=#concept-input-min title=concept-input-min>minimum</a>
+   is greater than the <a href=#concept-input-max title=concept-input-max>maximum</a>, then abort these steps.</p>
+
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a> and a <a href=#concept-input-max title=concept-input-max>maximum</a> and there is no value greater than or equal to the
+   element's <a href=#concept-input-min title=concept-input-min>minimum</a> and less than or equal to the element's
+   <a href=#concept-input-max title=concept-input-max>maximum</a> that, when subtracted from the <a href=#concept-input-min-zero title=concept-input-min-zero>step base</a>, is an integral multiple of the <a href=#concept-input-step title=concept-input-step>allowed value step</a>, then abort these steps.</p>
+
    <li><p>If applying the <a href=#concept-input-value-string-number title=concept-input-value-string-number>algorithm to convert a
-   string to a number</a> to the string given by the element's
-   <a href=#concept-fe-value title=concept-fe-value>value</a> results in an error,
-   then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception, and abort
-   these steps; otherwise, let <var title="">value</var> be the result
-   of that algorithm.</li>
+   string to a number</a> to the string given by the element's <a href=#concept-fe-value title=concept-fe-value>value</a> results in an error, then abort these steps; otherwise, let
+   <var title="">value</var> be the result of that algorithm.</li>
 
    <li><p>Let <var title="">n</var> be the argument, or 1 if the
    argument was omitted.</li>
@@ -52960,12 +53007,23 @@
    <li><p>If the method invoked was the <code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> method, negate <var title="">delta</var>.</li>
 
    <li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
-   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a>, and the <var title="">value</var> is less than that <a href=#concept-input-min title=concept-input-min>minimum</a>, then throw a
-   <code><a href=#invalidstateerror>InvalidStateError</a></code> exception.</li>
 
-   <li><p>If the element has a <a href=#concept-input-max title=concept-input-max>maximum</a>, and the <var title="">value</var> is greater than that <a href=#concept-input-max title=concept-input-max>maximum</a>, then throw a
-   <code><a href=#invalidstateerror>InvalidStateError</a></code> exception.</li>
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a>, and the <var title="">value</var> is less than that <a href=#concept-input-min title=concept-input-min>minimum</a>, then set
+   <var title="">value</var> to <a href=#concept-input-min title=concept-input-min>minimum</a>.</li>
 
+   <li><p>If the element has a <a href=#concept-input-max title=concept-input-max>maximum</a>, and the <var title="">value</var> is greater than that <a href=#concept-input-max title=concept-input-max>maximum</a>, then
+   set <var title="">value</var> to <a href=#concept-input-max title=concept-input-max>maximum</a>.</li>
+
+   <li><p>If <var title="">value</var> subtracted from the <a href=#concept-input-min-zero title=concept-input-min-zero>step
+   base</a> is not an integral multiple of the <a href=#concept-input-step title=concept-input-step>allowed value
+   step</a>, then set <var title="">value</var> to the nearest value that is greater than or
+   equal to the element's <a href=#concept-input-min title=concept-input-min>minimum</a>, if any, and less than or
+   equal to the element's <a href=#concept-input-max title=concept-input-max>maximum</a>, if any, that, when
+   subtracted from the <a href=#concept-input-min-zero title=concept-input-min-zero>step base</a>, is an integral
+   multiple of the <a href=#concept-input-step title=concept-input-step>allowed value step</a>, rounding down if the
+   method invoked was the <code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> and rounding up
+   otherwise.</li>
+
    <li><p>Let <var title="">value as string</var> be the result of
    running the <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
    number to a string</a>, as defined for the <code><a href=#the-input-element>input</a></code>
@@ -57524,6 +57582,11 @@
    given by the <code title=attr-input-step><a href=#attr-input-step>step</a></code>
    attribute.</dd>
 
+   <dt> <dfn id=suffering-from-bad-input>Suffering from bad input</dfn> </dt>
+
+   <dd> <p>When a control has incomplete input and the user agent does not think the user ought to
+   be able to submit the form in its current state.</dd>
+
    <dt> <dfn id=suffering-from-a-custom-error>Suffering from a custom error</dfn> </dt>
 
    <dd> <p>When a control's <a href=#custom-validity-error-message>custom validity error
@@ -57708,6 +57771,14 @@
 
    </dd>
 
+   <dt><var title="">element</var> . <code title=dom-cva-validity><a href=#dom-cva-validity>validity</a></code> . <code title=dom-validitystate-badInput><a href=#dom-validitystate-badinput>badInput</a></code></dt>
+
+   <dd>
+
+    <p>Returns true if the user has provided input in the user interface that the user agent is unable to convert to a value; false otherwise.</p>
+
+   </dd>
+
    <dt><var title="">element</var> . <code title=dom-cva-validity><a href=#dom-cva-validity>validity</a></code> . <code title=dom-validitystate-customError><a href=#dom-validitystate-customerror>customError</a></code></dt>
 
    <dd>
@@ -57798,6 +57869,7 @@
   readonly attribute boolean <a href=#dom-validitystate-rangeunderflow title=dom-ValidityState-rangeUnderflow>rangeUnderflow</a>;
   readonly attribute boolean <a href=#dom-validitystate-rangeoverflow title=dom-ValidityState-rangeOverflow>rangeOverflow</a>;
   readonly attribute boolean <a href=#dom-validitystate-stepmismatch title=dom-ValidityState-stepMismatch>stepMismatch</a>;
+  readonly attribute boolean <a href=#dom-validitystate-badinput title=dom-ValidityState-badInput>badInput</a>;
   readonly attribute boolean <a href=#dom-validitystate-customerror title=dom-ValidityState-customError>customError</a>;
   readonly attribute boolean <a href=#dom-validitystate-valid title=dom-ValidityState-valid>valid</a>;
 };</pre>
@@ -57828,6 +57900,9 @@
    <dt><dfn id=dom-validitystate-stepmismatch title=dom-ValidityState-stepMismatch><code>stepMismatch</code></dfn></dt>
    <dd> <p>The control is <a href=#suffering-from-a-step-mismatch>suffering from a step mismatch</a>.</p> </dd>
 
+   <dt><dfn id=dom-validitystate-badinput title=dom-ValidityState-badInput><code>badInput</code></dfn></dt>
+   <dd> <p>The control is <a href=#suffering-from-bad-input>suffering from bad input</a>.</p> </dd>
+
    <dt><dfn id=dom-validitystate-customerror title=dom-ValidityState-customError><code>customError</code></dfn></dt>
    <dd> <p>The control is <a href=#suffering-from-a-custom-error>suffering from a custom error</a>.</p> </dd>
 

Modified: index
===================================================================
--- index	2012-11-20 19:49:21 UTC (rev 7517)
+++ index	2012-11-20 22:52:09 UTC (rev 7518)
@@ -49128,6 +49128,10 @@
     <a href=#concept-fe-value title=concept-fe-value>value</a> to IDN in the display
     and vice versa.</p>
 
+    <p><strong>Constraint validation</strong>: While the user interface is representing input that
+    the user agent cannot convert to punycode, the control is <a href=#suffering-from-bad-input>suffering from bad
+    input</a>.</p>
+
     </div>
 
     <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
@@ -49185,6 +49189,10 @@
     <a href=#concept-fe-value title=concept-fe-value>value</a> to IDN in the display
     and vice versa.</p>
 
+    <p><strong>Constraint validation</strong>: While the user interface describes a situation where
+    an individual value contains a U+002C COMMA (,) or is representing input that the user agent
+    cannot convert to punycode, the control is <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
     <p>Whenever the user changes the element's <a href=#concept-fe-value title=concept-fe-value>value<em>s</em></a>, the user agent
     must run the following steps:</p>
 
@@ -49466,6 +49474,10 @@
   normalized forced-UTC global date and time string</a> representing the
   user's selection. User agents should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-normalized-forced-utc-global-date-and-time-string>valid normalized forced-UTC global date and time string</a>,
+  the control is <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
   </div>
 
   <p class=note>See the <a href=#input-author-notes>introduction
@@ -49671,6 +49683,10 @@
   date string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-date-string>valid date string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
   </div>
 
   <p class=note>See the <a href=#input-author-notes>introduction
@@ -49829,14 +49845,18 @@
   month string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-month-string>valid month string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-month-string>valid
   month string</a>.</p> <!-- ok to set out-of-range value, we never
@@ -49986,14 +50006,18 @@
   week string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-week-string>valid week string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-week-string>valid
   week string</a>.</p> <!-- ok to set out-of-range value, we never
@@ -50147,14 +50171,18 @@
   time string</a> representing the user's selection. User agents
   should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-time-string>valid time string</a>, the control is <a href=#suffering-from-bad-input>suffering from bad
+  input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-time-string>valid
   time string</a>.</p> <!-- ok to set out-of-range value, we never
@@ -50305,14 +50333,18 @@
   string</a> representing the user's selection. User agents should
   allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-normalized-local-date-and-time-string>valid normalized local date and time string</a>, the control is
+  <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
+  </div>
+
   <p class=note>See the <a href=#input-author-notes>introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
   controls<span class=impl>, and the <a href=#input-impl-notes>implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
   specified and not empty, must have a value that is a <a href=#valid-local-date-and-time-string>valid
   local date and time string</a>.</p> <!-- ok to set out-of-range
@@ -50485,6 +50517,10 @@
   representing the user's selection as a floating-point number</a>.
   User agents should allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-floating-point-number>valid floating-point number</a>, the control is <a href=#suffering-from-bad-input>suffering
+  from bad input</a>.</p>
+
   </div>
 
   <p class=note>This specification does not define what user
@@ -50657,6 +50693,10 @@
   selection as a floating-point number</a>. User agents must not
   allow the user to set the <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-floating-point-number>valid floating-point number</a>, the control is <a href=#suffering-from-bad-input>suffering
+  from bad input</a>.</p>
+
   </div>
 
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
@@ -50885,6 +50925,10 @@
   the user's selection. User agents must not allow the user to set the
   <a href=#concept-fe-value title=concept-fe-value>value</a> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <a href=#valid-lowercase-simple-color>valid lowercase simple color</a>, the control is
+  <a href=#suffering-from-bad-input>suffering from bad input</a>.</p>
+
   </div>
 
   <p>The <code title=attr-input-value><a href=#attr-input-value>value</a></code> attribute, if
@@ -52784,10 +52828,9 @@
     <var title="">n</var>. The default value for <var title="">n</var>
     is 1.</p>
 
-    <p>Throws <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the control
-    is neither date- or time-based nor numeric, if the <code title=attr-input-step><a href=#attr-input-step>step</a></code> attribute's value is "<code title="">any</code>", if the current <a href=#concept-fe-value title=concept-fe-value>value</a> could not be parsed, or if
-    stepping in the given direction by the given amount would take the
-    value out of range.</p>
+    <p>Throws <code><a href=#invalidstateerror>InvalidStateError</a></code> exception if the control is neither date- or time-based
+    nor numeric, or if the <code title=attr-input-step><a href=#attr-input-step>step</a></code> attribute's value is "<code title="">any</code>". Does nothing if it would take the control's value out of range or if the
+    control currently has no value.</p>
 
    </dd>
 
@@ -52944,12 +52987,16 @@
    <code><a href=#invalidstateerror>InvalidStateError</a></code> exception, and abort these
    steps.</li>
 
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a> and a <a href=#concept-input-max title=concept-input-max>maximum</a> and the <a href=#concept-input-min title=concept-input-min>minimum</a>
+   is greater than the <a href=#concept-input-max title=concept-input-max>maximum</a>, then abort these steps.</p>
+
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a> and a <a href=#concept-input-max title=concept-input-max>maximum</a> and there is no value greater than or equal to the
+   element's <a href=#concept-input-min title=concept-input-min>minimum</a> and less than or equal to the element's
+   <a href=#concept-input-max title=concept-input-max>maximum</a> that, when subtracted from the <a href=#concept-input-min-zero title=concept-input-min-zero>step base</a>, is an integral multiple of the <a href=#concept-input-step title=concept-input-step>allowed value step</a>, then abort these steps.</p>
+
    <li><p>If applying the <a href=#concept-input-value-string-number title=concept-input-value-string-number>algorithm to convert a
-   string to a number</a> to the string given by the element's
-   <a href=#concept-fe-value title=concept-fe-value>value</a> results in an error,
-   then throw an <code><a href=#invalidstateerror>InvalidStateError</a></code> exception, and abort
-   these steps; otherwise, let <var title="">value</var> be the result
-   of that algorithm.</li>
+   string to a number</a> to the string given by the element's <a href=#concept-fe-value title=concept-fe-value>value</a> results in an error, then abort these steps; otherwise, let
+   <var title="">value</var> be the result of that algorithm.</li>
 
    <li><p>Let <var title="">n</var> be the argument, or 1 if the
    argument was omitted.</li>
@@ -52960,12 +53007,23 @@
    <li><p>If the method invoked was the <code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> method, negate <var title="">delta</var>.</li>
 
    <li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
-   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a>, and the <var title="">value</var> is less than that <a href=#concept-input-min title=concept-input-min>minimum</a>, then throw a
-   <code><a href=#invalidstateerror>InvalidStateError</a></code> exception.</li>
 
-   <li><p>If the element has a <a href=#concept-input-max title=concept-input-max>maximum</a>, and the <var title="">value</var> is greater than that <a href=#concept-input-max title=concept-input-max>maximum</a>, then throw a
-   <code><a href=#invalidstateerror>InvalidStateError</a></code> exception.</li>
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a>, and the <var title="">value</var> is less than that <a href=#concept-input-min title=concept-input-min>minimum</a>, then set
+   <var title="">value</var> to <a href=#concept-input-min title=concept-input-min>minimum</a>.</li>
 
+   <li><p>If the element has a <a href=#concept-input-max title=concept-input-max>maximum</a>, and the <var title="">value</var> is greater than that <a href=#concept-input-max title=concept-input-max>maximum</a>, then
+   set <var title="">value</var> to <a href=#concept-input-max title=concept-input-max>maximum</a>.</li>
+
+   <li><p>If <var title="">value</var> subtracted from the <a href=#concept-input-min-zero title=concept-input-min-zero>step
+   base</a> is not an integral multiple of the <a href=#concept-input-step title=concept-input-step>allowed value
+   step</a>, then set <var title="">value</var> to the nearest value that is greater than or
+   equal to the element's <a href=#concept-input-min title=concept-input-min>minimum</a>, if any, and less than or
+   equal to the element's <a href=#concept-input-max title=concept-input-max>maximum</a>, if any, that, when
+   subtracted from the <a href=#concept-input-min-zero title=concept-input-min-zero>step base</a>, is an integral
+   multiple of the <a href=#concept-input-step title=concept-input-step>allowed value step</a>, rounding down if the
+   method invoked was the <code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> and rounding up
+   otherwise.</li>
+
    <li><p>Let <var title="">value as string</var> be the result of
    running the <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a
    number to a string</a>, as defined for the <code><a href=#the-input-element>input</a></code>
@@ -57524,6 +57582,11 @@
    given by the <code title=attr-input-step><a href=#attr-input-step>step</a></code>
    attribute.</dd>
 
+   <dt> <dfn id=suffering-from-bad-input>Suffering from bad input</dfn> </dt>
+
+   <dd> <p>When a control has incomplete input and the user agent does not think the user ought to
+   be able to submit the form in its current state.</dd>
+
    <dt> <dfn id=suffering-from-a-custom-error>Suffering from a custom error</dfn> </dt>
 
    <dd> <p>When a control's <a href=#custom-validity-error-message>custom validity error
@@ -57708,6 +57771,14 @@
 
    </dd>
 
+   <dt><var title="">element</var> . <code title=dom-cva-validity><a href=#dom-cva-validity>validity</a></code> . <code title=dom-validitystate-badInput><a href=#dom-validitystate-badinput>badInput</a></code></dt>
+
+   <dd>
+
+    <p>Returns true if the user has provided input in the user interface that the user agent is unable to convert to a value; false otherwise.</p>
+
+   </dd>
+
    <dt><var title="">element</var> . <code title=dom-cva-validity><a href=#dom-cva-validity>validity</a></code> . <code title=dom-validitystate-customError><a href=#dom-validitystate-customerror>customError</a></code></dt>
 
    <dd>
@@ -57798,6 +57869,7 @@
   readonly attribute boolean <a href=#dom-validitystate-rangeunderflow title=dom-ValidityState-rangeUnderflow>rangeUnderflow</a>;
   readonly attribute boolean <a href=#dom-validitystate-rangeoverflow title=dom-ValidityState-rangeOverflow>rangeOverflow</a>;
   readonly attribute boolean <a href=#dom-validitystate-stepmismatch title=dom-ValidityState-stepMismatch>stepMismatch</a>;
+  readonly attribute boolean <a href=#dom-validitystate-badinput title=dom-ValidityState-badInput>badInput</a>;
   readonly attribute boolean <a href=#dom-validitystate-customerror title=dom-ValidityState-customError>customError</a>;
   readonly attribute boolean <a href=#dom-validitystate-valid title=dom-ValidityState-valid>valid</a>;
 };</pre>
@@ -57828,6 +57900,9 @@
    <dt><dfn id=dom-validitystate-stepmismatch title=dom-ValidityState-stepMismatch><code>stepMismatch</code></dfn></dt>
    <dd> <p>The control is <a href=#suffering-from-a-step-mismatch>suffering from a step mismatch</a>.</p> </dd>
 
+   <dt><dfn id=dom-validitystate-badinput title=dom-ValidityState-badInput><code>badInput</code></dfn></dt>
+   <dd> <p>The control is <a href=#suffering-from-bad-input>suffering from bad input</a>.</p> </dd>
+
    <dt><dfn id=dom-validitystate-customerror title=dom-ValidityState-customError><code>customError</code></dfn></dt>
    <dd> <p>The control is <a href=#suffering-from-a-custom-error>suffering from a custom error</a>.</p> </dd>
 

Modified: source
===================================================================
--- source	2012-11-20 19:49:21 UTC (rev 7517)
+++ source	2012-11-20 22:52:09 UTC (rev 7518)
@@ -57602,6 +57602,10 @@
     <span title="concept-fe-value">value</span> to IDN in the display
     and vice versa.</p>
 
+    <p><strong>Constraint validation</strong>: While the user interface is representing input that
+    the user agent cannot convert to punycode, the control is <span>suffering from bad
+    input</span>.</p>
+
     </div>
 
     <p>The <code title="attr-input-value">value</code> attribute, if
@@ -57668,6 +57672,10 @@
     <span title="concept-fe-value">value</span> to IDN in the display
     and vice versa.</p>
 
+    <p><strong>Constraint validation</strong>: While the user interface describes a situation where
+    an individual value contains a U+002C COMMA (,) or is representing input that the user agent
+    cannot convert to punycode, the control is <span>suffering from bad input</span>.</p>
+
     <p>Whenever the user changes the element's <span
     title="concept-fe-value">value<em>s</em></span>, the user agent
     must run the following steps:</p>
@@ -57985,6 +57993,10 @@
   user's selection. User agents should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid normalized forced-UTC global date and time string</span>,
+  the control is <span>suffering from bad input</span>.</p>
+
   </div>
 
   <p class="note">See the <a href="#input-author-notes">introduction
@@ -58222,6 +58234,10 @@
   should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid date string</span>, the control is <span>suffering from bad
+  input</span>.</p>
+
   </div>
 
   <p class="note">See the <a href="#input-author-notes">introduction
@@ -58405,6 +58421,12 @@
   should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid month string</span>, the control is <span>suffering from bad
+  input</span>.</p>
+
+  </div>
+
   <p class="note">See the <a href="#input-author-notes">introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
@@ -58412,8 +58434,6 @@
   href="#input-impl-notes">implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title="attr-input-value">value</code> attribute, if
   specified and not empty, must have a value that is a <span>valid
   month string</span>.</p> <!-- ok to set out-of-range value, we never
@@ -58585,6 +58605,12 @@
   should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid week string</span>, the control is <span>suffering from bad
+  input</span>.</p>
+
+  </div>
+
   <p class="note">See the <a href="#input-author-notes">introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
@@ -58592,8 +58618,6 @@
   href="#input-impl-notes">implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title="attr-input-value">value</code> attribute, if
   specified and not empty, must have a value that is a <span>valid
   week string</span>.</p> <!-- ok to set out-of-range value, we never
@@ -58771,6 +58795,12 @@
   should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid time string</span>, the control is <span>suffering from bad
+  input</span>.</p>
+
+  </div>
+
   <p class="note">See the <a href="#input-author-notes">introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
@@ -58778,8 +58808,6 @@
   href="#input-impl-notes">implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title="attr-input-value">value</code> attribute, if
   specified and not empty, must have a value that is a <span>valid
   time string</span>.</p> <!-- ok to set out-of-range value, we never
@@ -58948,6 +58976,12 @@
   allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid normalized local date and time string</span>, the control is
+  <span>suffering from bad input</span>.</p>
+
+  </div>
+
   <p class="note">See the <a href="#input-author-notes">introduction
   section</a> for a discussion of the difference between the input
   format and submission format for date, time, and number form
@@ -58955,8 +58989,6 @@
   href="#input-impl-notes">implementation notes</a> regarding
   localization of form controls</span>.</p>
 
-  </div>
-
   <p>The <code title="attr-input-value">value</code> attribute, if
   specified and not empty, must have a value that is a <span>valid
   local date and time string</span>.</p> <!-- ok to set out-of-range
@@ -59145,6 +59177,10 @@
   User agents should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid floating-point number</span>, the control is <span>suffering
+  from bad input</span>.</p>
+
   </div>
 
   <p class="note">This specification does not define what user
@@ -59331,6 +59367,10 @@
   allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid floating-point number</span>, the control is <span>suffering
+  from bad input</span>.</p>
+
   </div>
 
   <p>The <code title="attr-input-value">value</code> attribute, if
@@ -59584,6 +59624,10 @@
   the user's selection. User agents must not allow the user to set the
   <span title="concept-fe-value">value</span> to the empty string.</p>
 
+  <p><strong>Constraint validation</strong>: While the user interface describes input that the user
+  agent cannot convert to a <span>valid lowercase simple color</span>, the control is
+  <span>suffering from bad input</span>.</p>
+
   </div>
 
   <p>The <code title="attr-input-value">value</code> attribute, if
@@ -61737,13 +61781,10 @@
     <var title="">n</var>. The default value for <var title="">n</var>
     is 1.</p>
 
-    <p>Throws <code>InvalidStateError</code> exception if the control
-    is neither date- or time-based nor numeric, if the <code
-    title="attr-input-step">step</code> attribute's value is "<code
-    title="">any</code>", if the current <span
-    title="concept-fe-value">value</span> could not be parsed, or if
-    stepping in the given direction by the given amount would take the
-    value out of range.</p>
+    <p>Throws <code>InvalidStateError</code> exception if the control is neither date- or time-based
+    nor numeric, or if the <code title="attr-input-step">step</code> attribute's value is "<code
+    title="">any</code>". Does nothing if it would take the control's value out of range or if the
+    control currently has no value.</p>
 
    </dd>
 
@@ -61959,14 +62000,22 @@
    <code>InvalidStateError</code> exception, and abort these
    steps.</p></li>
 
-   <li><p>If applying the <span
-   title="concept-input-value-string-number">algorithm to convert a
-   string to a number</span> to the string given by the element's
-   <span title="concept-fe-value">value</span> results in an error,
-   then throw an <code>InvalidStateError</code> exception, and abort
-   these steps; otherwise, let <var title="">value</var> be the result
-   of that algorithm.</p></li>
+   <li><p>If the element has a <span title="concept-input-min">minimum</span> and a <span
+   title="concept-input-max">maximum</span> and the <span title="concept-input-min">minimum</span>
+   is greater than the <span title="concept-input-max">maximum</span>, then abort these steps.</p>
 
+   <li><p>If the element has a <span title="concept-input-min">minimum</span> and a <span
+   title="concept-input-max">maximum</span> and there is no value greater than or equal to the
+   element's <span title="concept-input-min">minimum</span> and less than or equal to the element's
+   <span title="concept-input-max">maximum</span> that, when subtracted from the <span
+   title="concept-input-min-zero">step base</span>, is an integral multiple of the <span
+   title="concept-input-step">allowed value step</span>, then abort these steps.</p>
+
+   <li><p>If applying the <span title="concept-input-value-string-number">algorithm to convert a
+   string to a number</span> to the string given by the element's <span
+   title="concept-fe-value">value</span> results in an error, then abort these steps; otherwise, let
+   <var title="">value</var> be the result of that algorithm.</p></li>
+
    <li><p>Let <var title="">n</var> be the argument, or 1 if the
    argument was omitted.</p></li>
 
@@ -61980,18 +62029,25 @@
 
    <li><p>Let <var title="">value</var> be the result of adding <var
    title="">delta</var> to <var title="">value</var>.</p></li>
-   <li><p>If the element has a <span
-   title="concept-input-min">minimum</span>, and the <var
-   title="">value</var> is less than that <span
-   title="concept-input-min">minimum</span>, then throw a
-   <code>InvalidStateError</code> exception.</p></li>
 
-   <li><p>If the element has a <span
-   title="concept-input-max">maximum</span>, and the <var
-   title="">value</var> is greater than that <span
-   title="concept-input-max">maximum</span>, then throw a
-   <code>InvalidStateError</code> exception.</p></li>
+   <li><p>If the element has a <span title="concept-input-min">minimum</span>, and the <var
+   title="">value</var> is less than that <span title="concept-input-min">minimum</span>, then set
+   <var title="">value</var> to <span title="concept-input-min">minimum</span>.</p></li>
 
+   <li><p>If the element has a <span title="concept-input-max">maximum</span>, and the <var
+   title="">value</var> is greater than that <span title="concept-input-max">maximum</span>, then
+   set <var title="">value</var> to <span title="concept-input-max">maximum</span>.</p></li>
+
+   <li><p>If <var title="">value</var> subtracted from the <span title="concept-input-min-zero">step
+   base</span> is not an integral multiple of the <span title="concept-input-step">allowed value
+   step</span>, then set <var title="">value</var> to the nearest value that is greater than or
+   equal to the element's <span title="concept-input-min">minimum</span>, if any, and less than or
+   equal to the element's <span title="concept-input-max">maximum</span>, if any, that, when
+   subtracted from the <span title="concept-input-min-zero">step base</span>, is an integral
+   multiple of the <span title="concept-input-step">allowed value step</span>, rounding down if the
+   method invoked was the <code title="dom-input-stepDown">stepDown()</code> and rounding up
+   otherwise.</p></li>
+
    <li><p>Let <var title="">value as string</var> be the result of
    running the <span
    title="concept-input-value-number-string">algorithm to convert a
@@ -67462,6 +67518,11 @@
    given by the <code title="attr-input-step">step</code>
    attribute.</p></dd>
 
+   <dt> <dfn>Suffering from bad input</dfn> </dt>
+
+   <dd> <p>When a control has incomplete input and the user agent does not think the user ought to
+   be able to submit the form in its current state.</p></dd>
+
    <dt> <dfn>Suffering from a custom error</dfn> </dt>
 
    <dd> <p>When a control's <span>custom validity error
@@ -67680,6 +67741,14 @@
 
    </dd>
 
+   <dt><var title="">element</var> . <code title="dom-cva-validity">validity</code> . <code title="dom-validitystate-badInput">badInput</code></dt>
+
+   <dd>
+
+    <p>Returns true if the user has provided input in the user interface that the user agent is unable to convert to a value; false otherwise.</p>
+
+   </dd>
+
    <dt><var title="">element</var> . <code title="dom-cva-validity">validity</code> . <code title="dom-validitystate-customError">customError</code></dt>
 
    <dd>
@@ -67778,6 +67847,7 @@
   readonly attribute boolean <span title="dom-ValidityState-rangeUnderflow">rangeUnderflow</span>;
   readonly attribute boolean <span title="dom-ValidityState-rangeOverflow">rangeOverflow</span>;
   readonly attribute boolean <span title="dom-ValidityState-stepMismatch">stepMismatch</span>;
+  readonly attribute boolean <span title="dom-ValidityState-badInput">badInput</span>;
   readonly attribute boolean <span title="dom-ValidityState-customError">customError</span>;
   readonly attribute boolean <span title="dom-ValidityState-valid">valid</span>;
 };</pre>
@@ -67809,6 +67879,9 @@
    <dt><dfn title="dom-ValidityState-stepMismatch"><code>stepMismatch</code></dfn></dt>
    <dd> <p>The control is <span>suffering from a step mismatch</span>.</p> </dd>
 
+   <dt><dfn title="dom-ValidityState-badInput"><code>badInput</code></dfn></dt>
+   <dd> <p>The control is <span>suffering from bad input</span>.</p> </dd>
+
    <dt><dfn title="dom-ValidityState-customError"><code>customError</code></dfn></dt>
    <dd> <p>The control is <span>suffering from a custom error</span>.</p> </dd>
 




More information about the Commit-Watchers mailing list