[html5] r2243 - [] (0) WF2: Revamp min/max/step, valueAsDate, valueAsNumber, stepUp, stepDown, a [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Sep 29 20:14:27 PDT 2008


Author: ianh
Date: 2008-09-29 20:14:23 -0700 (Mon, 29 Sep 2008)
New Revision: 2243

Modified:
   index
   source
Log:
[] (0) WF2: Revamp min/max/step, valueAsDate, valueAsNumber, stepUp, stepDown, and type=datetime.

Modified: index
===================================================================
--- index	2008-09-26 08:59:40 UTC (rev 2242)
+++ index	2008-09-30 03:14:23 UTC (rev 2243)
@@ -29,7 +29,7 @@
 
    <h1 id=html-5>HTML 5</h1>
 
-   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 26
+   <h2 class="no-num no-toc" id=draft>Draft Recommendation — 30
     September 2008</h2>
 
    <p>You can take part in this work. <a
@@ -1141,8 +1141,12 @@
             </span>The <code title=attr-input-readonly>readonly</code>
             attribute</a>
 
-           <li><a href="#other0"><span class=secno>4.10.4.2.4. </span>Other
-            attributes</a>
+           <li><a href="#the-min"><span class=secno>4.10.4.2.4. </span>The
+            <code title=attr-input-min>min</code> and <code
+            title=attr-input-max>max</code> attributes</a>
+
+           <li><a href="#the-step"><span class=secno>4.10.4.2.5. </span>The
+            <code title=attr-input-step>step</code> attribute</a>
           </ul>
 
          <li><a href="#common5"><span class=secno>4.10.4.3. </span>Common
@@ -1764,7 +1768,7 @@
             </span>Link type "<code>prev</code>"</a>
           </ul>
 
-         <li><a href="#other1"><span class=secno>5.11.3.20. </span>Other link
+         <li><a href="#other0"><span class=secno>5.11.3.20. </span>Other link
           types</a>
         </ul>
       </ul>
@@ -3496,7 +3500,7 @@
   <p>The <dfn id=rules1>rules for parsing floating point number values</dfn>
    are as given in the following algorithm. As with the previous algorithms,
    when this one is invoked, the steps must be followed in the order given,
-   aborting at the first step that returns a value. This algorithm will
+   aborting at the first step that returns something. This algorithm will
    either return a number or an error. Leading spaces are ignored. Trailing
    spaces and garbage characters are ignored.
 
@@ -3553,8 +3557,7 @@
      title="">value</var> by that integer.
 
    <li>If <var title="">position</var> is past the end of <var
-    title="">input</var>, return <var title="">value</var> and abort these
-    steps.
+    title="">input</var>, return <var title="">value</var>.
 
    <li>
     <p>If the character indicated by <var title="">position</var> is a U+002E
@@ -3568,8 +3571,7 @@
       <p>If <var title="">position</var> is past the end of <var
        title="">input</var>, or if the character indicated by <var
        title="">position</var> is not one of U+0030 DIGIT ZERO (0) .. U+0039
-       DIGIT NINE (9), then return <var title="">value</var> and abort these
-       steps.
+       DIGIT NINE (9), then return <var title="">value</var>.
 
      <li>
       <p><i>Fraction loop</i>: Multiply <var title="">divisor</var> by ten.
@@ -3583,8 +3585,7 @@
 
      <li>
       <p>If <var title="">position</var> is past the end of <var
-       title="">input</var>, then return <var title="">value</var> and abort
-       these steps.
+       title="">input</var>, then return <var title="">value</var>.
 
      <li>
       <p>If the character indicated by <var title="">position</var> is one of
@@ -3603,8 +3604,7 @@
 
      <li>
       <p>If <var title="">position</var> is past the end of <var
-       title="">input</var>, then return <var title="">value</var> and abort
-       these steps.
+       title="">input</var>, then return <var title="">value</var>.
 
      <li>
       <p>If the character indicated by <var title="">position</var> is a
@@ -3617,14 +3617,13 @@
 
        <li>
         <p>If <var title="">position</var> is past the end of <var
-         title="">input</var>, then return <var title="">value</var> and
-         abort these steps.
+         title="">input</var>, then return <var title="">value</var>.
       </ol>
 
      <li>
       <p>If the character indicated by <var title="">position</var> is not
        one of U+0030 DIGIT ZERO (0) .. U+0039 DIGIT NINE (9), then return
-       <var title="">value</var> and abort these steps.
+       <var title="">value</var>.
 
      <li>
       <p><a href="#collect">Collect a sequence of characters</a> in the range
@@ -29627,7 +29626,23 @@
   <p>Each <code><a href="#input0">input</a></code> element has a <a
    href="#value12" title=concept-fe-value>value</a>, which is exposed by the
    <code title=dom-input-value><a href="#value10">value</a></code> DOM
-   attribute.
+   attribute. Some states define an <dfn id=algorithm5
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</dfn>, an <dfn id=algorithm6
+   title=concept-input-value-number-string>algorithm to convert a number to a
+   string</dfn>, an <dfn id=algorithm7
+   title=concept-input-value-string-date>algorithm to convert a string to a
+   <code>Date</code> object</dfn>, and an <dfn id=algorithm8
+   title=concept-input-value-date-string>algorithm to convert a
+   <code>Date</code> object to a string</dfn>, which are used by <code
+   title=attr-input-max><a href="#max4">max</a></code>, <code
+   title=attr-input-min><a href="#min2">min</a></code>, <code
+   title=attr-input-step><a href="#step0">step</a></code>, <code
+   title=dom-input-valueAsDate><a href="#valueasdate">valueAsDate</a></code>,
+   <code title=dom-input-valueAsNumber><a
+   href="#valueasnumber">valueAsNumber</a></code>, <code
+   title=dom-input-stepUp><a href="#stepup">stepUp()</a></code>, and <code
+   title=dom-input-stepDown><a href="#stepdown">stepDown()</a></code>.
 
   <p>Each <code><a href="#input0">input</a></code> element has a boolean <dfn
    id=mutability title=concept-input-mutability>mutability flag</dfn>. When
@@ -30052,61 +30067,75 @@
    href="#valid6">valid UTC date and time</a>, then set it to the empty
    string instead.
 
-  <p>The <dfn id=selected title=concept-input-value-datetime>selected UTC
-   date and time</dfn> is the result of <a href="#parse0" title="parse a UTC
-   date and time">parsing a UTC date and time</a> from the element's <a
-   href="#value12" title=concept-fe-value>value</a>, unless that fails, in
-   which case there is no <a href="#selected"
-   title=concept-input-value-datetime>selected UTC date and time</a>.
+  <p><strong>The <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a>, given a string <var title="">input</var></strong>, is as
+   follows:
 
-  <p class=big-issue><strong>The <a href="#valueasdate1"><code
-   title=dom-input-valueAsDate>valueAsDate</code> setter algorithm</a> is as
-   follows:</strong> ...
+  <ol>
+   <li>
+    <p><a href="#parse0">Parse a UTC date and time</a> from <var
+     title="">input</var>.
 
-  <p class=big-issue><strong>The <a href="#valueasnumber1"><code
-   title=dom-input-valueAsNumber>valueAsNumber</code> setter algorithm</a> is
-   as follows:</strong> ...
+   <li>
+    <p>If that results in an error, return an error and abort these steps.
 
-  <p>The <code title=attr-input-min><a href="#min2">min</a></code> attribute,
-   if specified, must have a value that is a <a href="#valid6">valid UTC date
-   and time</a>. The <dfn id=minimum title=concept-input-min-datetime>minimum
-   UTC date and time</dfn> is the result of <a href="#parse0" title="parse a
-   UTC date and time">parsing a UTC date and time</a> from the element's
-   <code title=attr-input-min><a href="#min2">min</a></code> attribute,
-   unless that fails, in which case there is no <a href="#minimum"
-   title=concept-input-min-datetime>minimum UTC date and time</a>.
+   <li>
+    <p>Otherwise, return the number of milliseconds elapsed from midnight UTC
+     on the morning of 1970-01-01 (the time represented by the value "<code
+     title="">1970-01-01T00:00:00.0Z</code>") to the parsed date and time,
+     ignoring leap seconds.
+  </ol>
 
-  <p><strong>Constraint validation:</strong> When there is both a <a
-   href="#selected" title=concept-input-value-datetime>selected UTC date and
-   time</a> and a <a href="#minimum" title=concept-input-min-datetime>minimum
-   UTC date and time</a>, if the former is earlier than the latter, the
-   element is <a href="#suffering1">suffering from an underflow</a>.
+  <p><strong>The <a href="#algorithm13"
+   title=concept-input-value-number-string>algorithm to convert a number to a
+   string</a>, given a number <var title="">input</var></strong>, consists of
+   returning a <a href="#valid6">valid UTC date and time</a> that represents
+   the date and time in UTC that is <var title="">input</var> milliseconds
+   afer midnight UTC on the morning of 1970-01-01 (the time represented by
+   the value "<code title="">1970-01-01T00:00:00.0Z</code>").
 
-  <p>The <code title=attr-input-max><a href="#max4">max</a></code> attribute,
+  <p><strong>The <a href="#algorithm9"
+   title=concept-input-value-string-date>algorithm to convert a string to a
+   <code>Date</code> object</a>, given a string <var
+   title="">input</var></strong>, is as follows:
+
+  <ol>
+   <li>
+    <p><a href="#parse0">Parse a UTC date and time</a> from <var
+     title="">input</var>.
+
+   <li>
+    <p>If that results in an error, return an error and abort these steps.
+
+   <li>
+    <p>Otherwise, return a <code>Date</code> object representing the parsed
+     date and time.
+  </ol>
+
+  <p><strong>The <a href="#algorithm10"
+   title=concept-input-value-date-string>algorithm to convert a
+   <code>Date</code> object to a string</a>, given a <code>Date</code> object
+   <var title="">input</var></strong>, consists of returning a <a
+   href="#valid6">valid UTC date and time</a> that represents the date and
+   time in UTC that is represented by <var title="">input</var>.</p>
+  <!-- MIN AND MAX: -->
+
+  <p>The <code title=attr-input-min><a href="#min2">min</a></code> attribute,
    if specified, must have a value that is a <a href="#valid6">valid UTC date
-   and time</a>. The <dfn id=maximum title=concept-input-max-datetime>maximum
-   UTC date and time</dfn> is the result of <a href="#parse0" title="parse a
-   UTC date and time">parsing a UTC date and time</a> from the element's
-   <code title=attr-input-max><a href="#max4">max</a></code> attribute,
-   unless that fails, in which case there is no <a href="#maximum"
-   title=concept-input-max-datetime>maximum UTC date and time</a>.
+   and time</a>. The <code title=attr-input-max><a
+   href="#max4">max</a></code> attribute, if specified, must have a value
+   that is a <a href="#valid6">valid UTC date and time</a>.</p>
+  <!-- STEP: -->
 
-  <p><strong>Constraint validation:</strong> When there is both a <a
-   href="#selected" title=concept-input-value-datetime>selected UTC date and
-   time</a> and a <a href="#maximum" title=concept-input-max-datetime>maximum
-   UTC date and time</a>, if the former is later than the latter, the element
-   is <a href="#suffering2">suffering from an overflow</a>.
+  <p>The <code title=attr-input-step><a href="#step0">step</a></code>
+   attribute is expressed in seconds. The <a href="#step-"
+   title=concept-input-step-scale>step scale factor</a> is 1000 (which
+   converts the seconds to milliseconds, as used in the other algorithms).
+   The <a href="#default2" title=concept-input-step-default>default step</a>
+   is 60 seconds.</p>
+  <!-- XXX allow rounding -->
 
-  <p class=big-issue>The <code title=attr-input-step><a
-   href="#step0">step</a></code> attribute, if specified, must have a value
-   that is a ...</p>
-  <!-- values: positive non-zero floating point, or "any" -->
-  <!-- units: seconds -->
-  <!-- default: 60 -->
-  <!-- zero point: min, or 1970-01-01T00:00:00.0Z -->
-  <!-- allow rounding -->
-  <!-- <span>suffering from a step mismatch</span> -->
-
   <p>The following common <code><a href="#input0">input</a></code> element
    content attributes, DOM attributes, and methods apply to the element:
    <code title=attr-input-autocomplete><a
@@ -30283,7 +30312,7 @@
    matches for any of the other values (i.e. duplicates are not allowed).</p>
   <!-- XXX the selected file(s) must either have the given types or be of the given category -->
 
-  <p class=big-issue>... list of <dfn id=selected0
+  <p class=big-issue>... list of <dfn id=selected
    title=concept-input-type-file-selected>selected files</dfn>
 
   <h6 id=hidden><span class=secno>4.10.4.1.16. </span><dfn id=hidden1
@@ -30325,7 +30354,7 @@
 
   <p class=big-issue>...
 
-  <p class=big-issue>... image: <dfn id=selected1
+  <p class=big-issue>... image: <dfn id=selected0
    title=concept-input-type-image-coordinate>selected coordinate</dfn>
 
   <h6 id=reset><span class=secno>4.10.4.1.19. </span><dfn id=reset2
@@ -30458,30 +30487,30 @@
    href="#valid">valid non-negative integer</a>. If the attribute is
    specified and applying the <a href="#rules">rules for parsing non-negative
    integers</a> to its value results in a number, then that number is the
-   element's <dfn id=maximum0>maximum allowed value length</dfn>. If the
+   element's <dfn id=maximum>maximum allowed value length</dfn>. If the
    attribute is omitted or parsing its value results in an error, then there
-   is no <a href="#maximum0">maximum allowed value length</a>.
+   is no <a href="#maximum">maximum allowed value length</a>.
 
   <p>If the <code><a href="#input0">input</a></code> element has a <a
-   href="#maximum0">maximum allowed value length</a>, then the <a
+   href="#maximum">maximum allowed value length</a>, then the <a
    href="#codepoint">codepoint length</a> of the value of the element's <code
    title=attr-input-value><a href="#value9">value</a></code> attribute must
-   be equal to or less than the element's <a href="#maximum0">maximum allowed
+   be equal to or less than the element's <a href="#maximum">maximum allowed
    value length</a>.
 
   <p><strong>Constraint validation:</strong> If an <code><a
-   href="#input0">input</a></code> element has a <a href="#maximum0">maximum
+   href="#input0">input</a></code> element has a <a href="#maximum">maximum
    allowed value length</a>, and it is not <a href="#dirty0"
    title=concept-input-dirty>dirty</a>, and the <a
    href="#codepoint">codepoint length</a> of the element's <a href="#value12"
    title=concept-fe-value>value</a> is greater than the element's <a
-   href="#maximum0">maximum allowed value length</a>, then the element is <a
+   href="#maximum">maximum allowed value length</a>, then the element is <a
    href="#suffering0">suffering from being too long</a>.
 
   <p>User agents may prevent the user from setting the element's <a
    href="#value12" title=concept-fe-value>value</a> to a value whose <a
    href="#codepoint">codepoint length</a> is greater than the element's <a
-   href="#maximum0">maximum allowed value length</a>.
+   href="#maximum">maximum allowed value length</a>.
 
   <h6 id=the-readonly><span class=secno>4.10.4.2.3. </span>The <code
    title=attr-input-readonly><a href="#readonly0">readonly</a></code>
@@ -30498,19 +30527,121 @@
    element, the element is <a href="#barred">barred from constraint
    validation</a>.
 
-  <h6 id=other0><span class=secno>4.10.4.2.4. </span>Other attributes</h6>
+  <h6 id=the-min><span class=secno>4.10.4.2.4. </span>The <code
+   title=attr-input-min><a href="#min2">min</a></code> and <code
+   title=attr-input-max><a href="#max4">max</a></code> attributes</h6>
 
   <p>The <dfn id=min2 title=attr-input-min><code>min</code></dfn> and <dfn
-   id=max4 title=attr-input-max><code>max</code></dfn> attributes define a
-   range constraint on the value.
+   id=max4 title=attr-input-max><code>max</code></dfn> attributes indicate
+   the allowed range of values for the element.
 
+  <p>Their syntax is defined by the section that defines the <code
+   title=attr-input-type><a href="#type14">type</a></code> attribute's
+   current state.
+
+  <p><strong>Constraint validation:</strong> When the element has a <code
+   title=attr-input-min><a href="#min2">min</a></code> attribute, and the
+   result of applying the <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a> to the string given by the element's <span
+   title=concept-input-value>value</span> is a number, and the result of
+   applying the <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a> to the value of the <code title=attr-input-min><a
+   href="#min2">min</a></code> attribute is also a number, and the number
+   obtained from the former is less than the number obtained from the latter,
+   the element is <a href="#suffering1">suffering from an underflow</a>.
+
+  <p><strong>Constraint validation:</strong> When the element has a <code
+   title=attr-input-max><a href="#max4">max</a></code> attribute, and the
+   result of applying the <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a> to the string given by the element's <span
+   title=concept-input-value>value</span> is a number, and the result of
+   applying the <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a> to the value of the <code title=attr-input-max><a
+   href="#max4">max</a></code> attribute is also a number, and the number
+   obtained from the former is greater than the number obtained from the
+   latter, the element is <a href="#suffering2">suffering from an
+   overflow</a>.
+
+  <p>The <code title=attr-input-min><a href="#min2">min</a></code> attribute
+   also defines the <a href="#step-base" title=concept-input-min-zero>step
+   base</a>.
+
+  <h6 id=the-step><span class=secno>4.10.4.2.5. </span>The <code
+   title=attr-input-step><a href="#step0">step</a></code> attribute</h6>
+
   <p>The <dfn id=step0 title=attr-input-step><code>step</code></dfn>
-   attribute defines the increments between allowed values.
+   attribute indicates the granularity that is expected (and required) of the
+   <span title=concept-input-value>value</span>, by limiting the allowed
+   values. The section that defines the <code title=attr-input-type><a
+   href="#type14">type</a></code> attribute's current state also defines the
+   <dfn id=default2 title=concept-input-step-default>default step</dfn> and
+   the <dfn id=step- title=concept-input-step-scale>step scale factor</dfn>,
+   which are used in processing the attribute as described below.
 
-  <p>These attributes apply for a number of different states, but as their
-   behavior varies from state to state, they are not defined here but instead
-   in the states' own sections.
+  <p>The <code title=attr-input-step><a href="#step0">step</a></code>
+   attribute, if specified, must either have a value that is a <a
+   href="#valid1">valid floating point number</a> that <a href="#rules1"
+   title="rules for parsing floating point number values">parses</a> to a
+   number that is greater than zero, or must have a value that is an <a
+   href="#ascii">ASCII case-insensitive</a> match for the string "<code
+   title="">any</code>".
 
+  <p>The attribute provides the <dfn id=allowed
+   title=concept-input-step>allowed value step</dfn> for the element, as
+   follows:
+
+  <ol>
+   <li>If the attribute is absent, then the <a href="#allowed"
+    title=concept-input-step>allowed value step</a> is the <a
+    href="#default2" title=concept-input-step-default>default step</a>
+    multiplied by the <a href="#step-" title=concept-input-step-scale>step
+    scale factor</a>.
+
+   <li>Otherwise, if the attribute's value is an <a href="#ascii">ASCII
+    case-insensitive</a> match for the string "<code title="">any</code>",
+    then there is no <a href="#allowed" title=concept-input-step>allowed
+    value step</a>.
+
+   <li>Otherwise, if the <a href="#rules1">rules for parsing floating point
+    number values</a>, when they are applied to the attribute's value, return
+    an error, zero, or a number less than zero, then the <a href="#allowed"
+    title=concept-input-step>allowed value step</a> is the <a
+    href="#default2" title=concept-input-step-default>default step</a>
+    multiplied by the <a href="#step-" title=concept-input-step-scale>step
+    scale factor</a>.
+
+   <li>Otherwise, the <a href="#allowed" title=concept-input-step>allowed
+    value step</a> is the number returned by the <a href="#rules1">rules for
+    parsing floating point number values</a> when they are applied to the
+    attribute's value, multiplied by the <a href="#step-"
+    title=concept-input-step-scale>step scale factor</a>.
+  </ol>
+
+  <p>The <dfn id=step-base title=concept-input-min-zero>step base</dfn> is
+   the result of applying the <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a> to the value of the <code title=attr-input-min><a
+   href="#min2">min</a></code> attribute, unless the element does not have a
+   <code title=attr-input-min><a href="#min2">min</a></code> attribute
+   specified or the result of applying that algorithm is an error, in which
+   case the <a href="#step-base" title=concept-input-min-zero>step base</a>
+   is zero.
+
+  <p><strong>Constraint validation:</strong> When the element has an <a
+   href="#allowed" title=concept-input-step>allowed value step</a>, and the
+   result of applying the <a href="#algorithm11"
+   title=concept-input-value-string-number>algorithm to convert a string to a
+   number</a> to the string given by the element's <span
+   title=concept-input-value>value</span> is a number, and that number
+   subtracted from the <a href="#step-base" title=concept-input-min-zero>step
+   base</a> is not an integral multiple of the <a href="#allowed"
+   title=concept-input-step>allowed value step</a>, the element is <a
+   href="#suffering3">suffering from a step mismatch</a>.
+
   <h5 id=common5><span class=secno>4.10.4.3. </span>Common <code><a
    href="#input0">input</a></code> element APIs</h5>
 
@@ -30535,20 +30666,27 @@
    element, interpreted as a date.
 
   <p>On getting, if the <code title=dom-input-valueAsDate><a
-   href="#valueasdate">valueAsDate</a></code> attribute applies, as defined
-   for the <code><a href="#input0">input</a></code> element's <code
+   href="#valueasdate">valueAsDate</a></code> attribute does not apply, as
+   defined for the <code><a href="#input0">input</a></code> element's <code
    title=attr-input-type><a href="#type14">type</a></code> attribute's
-   current state, then run the <dfn id=valueasdate0><code
-   title=dom-input-valueAsDate>valueAsDate</code> getter algorithm</dfn>
-   defined for that state. Otherwise, return a Not-a-Number (NaN) value.
+   current state, then return null. Otherwise, run the <dfn id=algorithm9
+   title=concept-input-value-string-date>algorithm to convert a string to a
+   <code>Date</code> object</dfn> defined for that state; if the algorithm
+   returned a <code>Date</code> object, then return it, otherwise, return
+   null.
 
   <p>On setting, if the <code title=dom-input-valueAsDate><a
-   href="#valueasdate">valueAsDate</a></code> attribute applies, as defined
-   for the <code><a href="#input0">input</a></code> element's <code
+   href="#valueasdate">valueAsDate</a></code> attribute does not apply, as
+   defined for the <code><a href="#input0">input</a></code> element's <code
    title=attr-input-type><a href="#type14">type</a></code> attribute's
-   current state, then run the <dfn id=valueasdate1><code
-   title=dom-input-valueAsDate>valueAsDate</code> setter algorithm</dfn>
-   defined for that state. Otherwise, do nothing.
+   current state, then throw an <code>INVALID_ACCESS_ERR</code> exception;
+   otherwise, if the new value is null, then set the <span
+   title=concept-input-value>value</span> of the element to the empty string;
+   otherwise, run the <dfn id=algorithm10
+   title=concept-input-value-date-string>algorithm to convert a
+   <code>Date</code> object to a string</dfn>, as defined for that state, on
+   the new value, and set the <span title=concept-input-value>value</span> of
+   the element to resulting string.
 
   <hr>
 
@@ -30558,26 +30696,78 @@
    title=concept-fe-value>value</a> of the element, interpreted as a number.
 
   <p>On getting, if the <code title=dom-input-valueAsNumber><a
-   href="#valueasnumber">valueAsNumber</a></code> attribute applies, as
-   defined for the <code><a href="#input0">input</a></code> element's <code
-   title=attr-input-type><a href="#type14">type</a></code> attribute's
-   current state, then run the <dfn id=valueasnumber0><code
-   title=dom-input-valueAsNumber>valueAsNumber</code> getter algorithm</dfn>
-   defined for that state. Otherwise, return the <a href="#value12"
-   title=concept-fe-value>value</a> of the element, cast to the type of the
-   DOM attribute.
+   href="#valueasnumber">valueAsNumber</a></code> attribute does not apply,
+   as defined for the <code><a href="#input0">input</a></code> element's
+   <code title=attr-input-type><a href="#type14">type</a></code> attribute's
+   current state, then return a Not-a-Number (NaN) value. Otherwise, run the
+   <dfn id=algorithm11 title=concept-input-value-string-number>algorithm to
+   convert a string to a number</dfn> defined for that state; if the
+   algorithm returned a number, then return it, otherwise, return a
+   Not-a-Number (NaN) value.
 
   <p>On setting, if the <code title=dom-input-valueAsNumber><a
-   href="#valueasnumber">valueAsNumber</a></code> attribute applies, as
-   defined for the <code><a href="#input0">input</a></code> element's <code
-   title=attr-input-type><a href="#type14">type</a></code> attribute's
-   current state, then run the <dfn id=valueasnumber1><code
-   title=dom-input-valueAsNumber>valueAsNumber</code> setter algorithm</dfn>
-   defined for that state. Otherwise, the <a href="#value12"
-   title=concept-fe-value>value</a> must be set to the shortest possible
-   representation of the given value that is a <a href="#valid1">valid
-   floating point number</a> in base ten.
+   href="#valueasnumber">valueAsNumber</a></code> attribute does not apply,
+   as defined for the <code><a href="#input0">input</a></code> element's
+   <code title=attr-input-type><a href="#type14">type</a></code> attribute's
+   current state, then throw an <code>INVALID_ACCESS_ERR</code> exception;
+   otherwise, run the <dfn id=algorithm12
+   title=concept-input-value-number-string>algorithm to convert a number to a
+   string</dfn>, as defined for that state, on the new value, and set the
+   <span title=concept-input-value>value</span> of the element to resulting
+   string.
 
+  <hr>
+
+  <p>The <dfn id=stepup title=dom-input-stepUp><code>stepUp()</code></dfn>
+   and <dfn id=stepdown
+   title=dom-input-stepDown><code>stepDown()</code></dfn> methods, when
+   invoked, must run the following algorithm:
+
+  <ol>
+   <li>
+    <p>If the <code title=dom-input-stepUp><a
+     href="#stepup">stepUp()</a></code> and <code title=dom-input-stepDown><a
+     href="#stepdown">stepDown()</a></code> methods do not apply, as defined
+     for the <code><a href="#input0">input</a></code> element's <code
+     title=attr-input-type><a href="#type14">type</a></code> attribute's
+     current state, then throw an <code>INVALID_ACCESS_ERR</code> exception,
+     and abort these steps.
+
+   <li>
+    <p>If the element has no <a href="#allowed"
+     title=concept-input-step>allowed value step</a>, then throw a
+     <code>INVALID_ACCESS_ERR</code> exception, and abort these steps.
+
+   <li>
+    <p>If applying the <a href="#algorithm11"
+     title=concept-input-value-string-number>algorithm to convert a string to
+     a number</a> to the string given by the element's <span
+     title=concept-input-value>value</span> results in an error, then throw
+     an <code>INVALID_ACCESS_ERR</code> exception, and abort these steps;
+     otherwise, let <var title="">value</var> be the result of that
+     algorithm.
+
+   <li>
+    <p>If the method invoked was the <code title=dom-input-stepDown><a
+     href="#stepdown">stepDown()</a></code> method, negate <var
+     title="">value</var>.
+
+   <li>
+    <p>Let <var title="">value</var> be the result of adding the <a
+     href="#allowed" title=concept-input-step>allowed value step</a> to <var
+     title="">value</var>.
+
+   <li>
+    <p>Run the <dfn id=algorithm13
+     title=concept-input-value-number-string>algorithm to convert a number to
+     a string</dfn>, as defined for the <code><a
+     href="#input0">input</a></code> element's <code title=attr-input-type><a
+     href="#type14">type</a></code> attribute's current state, on <var
+     title="">value</var>, and set the <span
+     title=concept-input-value>value</span> of the element to resulting
+     string.
+  </ol>
+
   <h6 id=others...><span class=secno>4.10.4.3.2. </span>Others...</h6>
 
   <p class=big-issue>... <dfn id=checked1
@@ -30589,12 +30779,6 @@
   <p class=big-issue>... <dfn id=selectedoption
    title=dom-input-selectedOption><code>selectedOption</code></dfn>
 
-  <p class=big-issue>... <dfn id=stepup
-   title=dom-input-stepUp><code>stepUp()</code></dfn>
-
-  <p class=big-issue>... <dfn id=stepdown
-   title=dom-input-stepDown><code>stepDown()</code></dfn>
-
   <h4 id=the-button><span class=secno>4.10.5 </span>The <dfn
    id=button2><code>button</code></dfn> element</h4>
 
@@ -30909,7 +31093,7 @@
 
   <p class=big-issue>...
 
-  <p class=big-issue>... <dfn id=selected2
+  <p class=big-issue>... <dfn id=selected1
    title=concept-option-selected>selected</dfn>
 
   <p class=big-issue>... <dfn id=value11
@@ -31620,7 +31804,7 @@
        <li>
         <p>The <var title="">field</var> element is <var
          title="">submitter</var>, and before this algorithm was invoked the
-         user <a href="#selected1"
+         user <a href="#selected0"
          title=concept-input-type-image-coordinate>indicated a
          coordinate</a>. Let <var title="">x</var> be the x-component of the
          coordindate selected by the user, and let <var title="">y</var> be
@@ -31664,7 +31848,7 @@
       <p>If the <var title="">field</var> element is a <code><a
        href="#select">select</a></code> element, then for each <code><a
        href="#option">option</a></code> element in the <code><a
-       href="#select">select</a></code> element that is <a href="#selected2"
+       href="#select">select</a></code> element that is <a href="#selected1"
        title=concept-option-selected>selected</a>, append an entry in the
        <var title="">form data set</var> with the <var title="">name</var> as
        the name and the <a href="#value11"
@@ -31676,7 +31860,7 @@
        href="#input0">input</a></code> element whose <code
        title=attr-input-type><a href="#type14">type</a></code> attribute is
        in the <span title=attr-input-type-file-state>File Upload</span>
-       state, then for each file <a href="#selected0"
+       state, then for each file <a href="#selected"
        title=concept-input-type-file-selected>selected</a> in the <code><a
        href="#input0">input</a></code> element, append an entry in the <var
        title="">form data set</var> with the <var title="">name</var> as the
@@ -34362,7 +34546,7 @@
     href="#radiogroup">radiogroup</a></code>
 
    <dd><code title=attr-command-default><a
-    href="#default2">default</a></code>
+    href="#default3">default</a></code>
 
    <dd>Also, the <code title=attr-command-title><a
     href="#title6">title</a></code> attribute has special semantics on this
@@ -34379,7 +34563,7 @@
            attribute boolean <a href="#disabled10" title=dom-command-disabled>disabled</a>;
            attribute boolean <a href="#checked4" title=dom-command-checked>checked</a>;
            attribute DOMString <a href="#radiogroup0" title=dom-command-radiogroup>radiogroup</a>;
-           attribute boolean <a href="#default3" title=dom-command-default>default</a>;
+           attribute boolean <a href="#default4" title=dom-command-default>default</a>;
  void <a href="#click" title=dom-command-click>click</a>(); // shadows <code><a href="#htmlelement">HTMLElement</a></code>.<code title=dom-click><a href="#click1">click()</a></code>
 };</pre>
 
@@ -34444,12 +34628,12 @@
 
   <p>If the <code><a href="#command0">command</a></code> element is used when
    <span title="menu generation">generating</span> a <span>context
-   menu</span>, then the <dfn id=default2
+   menu</span>, then the <dfn id=default3
    title=attr-command-default><code>default</code></dfn> attribute indicates,
    if present, that the command is the one that would have been invoked if
    the user had directly activated the menu's subject instead of using its
    context menu. The <code title=attr-command-default><a
-   href="#default2">default</a></code> attribute is a <a
+   href="#default3">default</a></code> attribute is a <a
    href="#boolean0">boolean attribute</a>.
 
   <div class=example>
@@ -34465,7 +34649,7 @@
    title=dom-command-disabled><code>disabled</code></dfn>, <dfn id=checked4
    title=dom-command-checked><code>checked</code></dfn>, <dfn id=radiogroup0
    title=dom-command-radiogroup><code>radiogroup</code></dfn>, and <dfn
-   id=default3 title=dom-command-default><code>default</code></dfn> DOM
+   id=default4 title=dom-command-default><code>default</code></dfn> DOM
    attributes must <a href="#reflect">reflect</a> the content attributes of
    the same name.
 
@@ -34947,7 +35131,7 @@
    this means for each facet -->.
     If the element is a <code><a href="#command0">command</a></code> element
     with a <code title=attr-command-default><a
-    href="#default2">default</a></code> attribute, mark the command as being
+    href="#default3">default</a></code> attribute, mark the command as being
     a default command.</dd>
    <!-- XXX if there's an
    Icon URL for the command, it should be <span
@@ -36680,9 +36864,9 @@
    data mining tools are likely to never instantiate browsing contexts.
 
   <p>The main <a href="#view">view</a> through which a user primarily
-   interacts with a user agent is the <dfn id=default4>default view</dfn>.
+   interacts with a user agent is the <dfn id=default5>default view</dfn>.
 
-  <p class=note>The <a href="#default4">default view</a> of a
+  <p class=note>The <a href="#default5">default view</a> of a
    <code>Document</code> is given by the <code title="">defaultView</code>
    attribute on the <code>Document</code> object's <code>DocumentView</code>
    interface. <a href="#refsDOM3VIEWS">[DOM3VIEWS]</a>
@@ -36880,7 +37064,7 @@
   <h4 id=security2><span class=secno>5.1.4 </span>Security</h4>
 
   <p>A <a href="#browsing1">browsing context</a> <var title="">A</var> is
-   <dfn id=allowed>allowed to navigate</dfn> a second <a
+   <dfn id=allowed0>allowed to navigate</dfn> a second <a
    href="#browsing1">browsing context</a> <var title="">B</var> if one of the
    following conditions is true:
 
@@ -36898,7 +37082,7 @@
 
    <li>The browsing context <var title="">B</var> is an <a
     href="#auxiliary0">auxiliary browsing context</a> and <var
-    title="">A</var> is <a href="#allowed">allowed to navigate</a> <var
+    title="">A</var> is <a href="#allowed0">allowed to navigate</a> <var
     title="">B</var>'s <a href="#opener">opener browsing context</a>, or
 
    <li>The browsing context <var title="">B</var> is not a <a
@@ -36993,7 +37177,7 @@
      and there exists a browsing context whose <a href="#browsing3"
      title="browsing context name">name</a> is the same as the given browsing
      context name, and the current browsing context is <a
-     href="#allowed">allowed to navigate</a> that browsing context, and the
+     href="#allowed0">allowed to navigate</a> that browsing context, and the
      user agent determines that the two browsing contexts are related enough
      that it is ok if they reach each other, then that browsing context must
      be the chosen one. If there are multiple matching browsing contexts, the
@@ -37067,7 +37251,7 @@
 
   <h3 id=the-default0><span class=secno>5.2 </span>The default view</h3>
 
-  <p>The <code>AbstractView</code> object of <a href="#default4"
+  <p>The <code>AbstractView</code> object of <a href="#default5"
    title="default view">default views</a> must also implement the <code><a
    href="#window">Window</a></code> and <code>EventTarget</code> interfaces.
 
@@ -37169,7 +37353,7 @@
    href="#browsing1">browsing context</a> has an associated <dfn
    id=list-of2>list of added properties</dfn> that, when a document is <a
    href="#active" title="active document">active</a>, are available on the
-   <code>Document</code>'s <a href="#default4">default view</a>'s <code><a
+   <code>Document</code>'s <a href="#default5">default view</a>'s <code><a
    href="#window">Window</a></code> object. A <code>Document</code> object's
    <a href="#list-of2">list of added properties</a> must be empty when the
    <code>Document</code> object is created.
@@ -41467,7 +41651,7 @@
   <ul>
    <li>The <code title=dom-location-href><a href="#href5">href</a></code>
     setter, if the script is running in a <a href="#browsing1">browsing
-    context</a> that is <a href="#allowed">allowed to navigate</a> the
+    context</a> that is <a href="#allowed0">allowed to navigate</a> the
     browsing context with which the <code><a
     href="#location2">Location</a></code> object is associated
   </ul>
@@ -44825,7 +45009,7 @@
    treat the keyword "<code title="">previous</code>" like the <code
    title=rel-prev><a href="#prev">prev</a></code> keyword.
 
-  <h5 id=other1><span class=secno>5.11.3.20. </span>Other link types</h5>
+  <h5 id=other0><span class=secno>5.11.3.20. </span>Other link types</h5>
 
   <p>Other than the types defined above, only types defined as extensions in
    the <a href="http://wiki.whatwg.org/wiki/RelExtensions">WHATWG Wiki
@@ -49461,7 +49645,7 @@
      the <code title=dom-MessageEvent-source><a
      href="#source3">source</a></code> attribute must be set to the <code><a
      href="#window">Window</a></code> object of the <a
-     href="#default4">default view</a> of the <a href="#browsing1">browsing
+     href="#default5">default view</a> of the <a href="#browsing1">browsing
      context</a> for which the <code>Document</code> object with which the
      script is associated is the <a href="#active">active
      document</a><!--, if there is one, or null
@@ -49542,7 +49726,7 @@
      the <code title=dom-MessageEvent-source><a
      href="#source3">source</a></code> attribute must be set to the <code><a
      href="#window">Window</a></code> object of the <a
-     href="#default4">default view</a> of the <a href="#browsing1">browsing
+     href="#default5">default view</a> of the <a href="#browsing1">browsing
      context</a> for which the <code>Document</code> object with which the
      script is associated is the <a href="#active">active
      document</a><!--, if there is one, or null

Modified: source
===================================================================
--- source	2008-09-26 08:59:40 UTC (rev 2242)
+++ source	2008-09-30 03:14:23 UTC (rev 2243)
@@ -1306,8 +1306,8 @@
   <p>The <dfn>rules for parsing floating point number values</dfn> are
   as given in the following algorithm. As with the previous
   algorithms, when this one is invoked, the steps must be followed in
-  the order given, aborting at the first step that returns a
-  value. This algorithm will either return a number or an
+  the order given, aborting at the first step that returns
+  something. This algorithm will either return a number or an
   error. Leading spaces are ignored. Trailing spaces and garbage
   characters are ignored.</p>
 
@@ -1365,8 +1365,7 @@
    title="">value</var> by that integer.</p></li>
 
    <li>If <var title="">position</var> is past the end of <var
-   title="">input</var>, return <var title="">value</var> and abort
-   these steps.</li>
+   title="">input</var>, return <var title="">value</var>.</li>
 
    <li><p>If the character indicated by <var title="">position</var>
    is a U+002E FULL STOP ("."), run these substeps:</p>
@@ -1379,8 +1378,7 @@
      <li><p>If <var title="">position</var> is past the end of <var
      title="">input</var>, or if the character indicated by <var
      title="">position</var> is not one of U+0030 DIGIT ZERO (0)
-     .. U+0039 DIGIT NINE (9), then return <var title="">value</var>
-     and abort these steps.</li>
+     .. U+0039 DIGIT NINE (9), then return <var title="">value</var>.</li>
 
      <li><p><i>Fraction loop</i>: Multiply <var title="">divisor</var>
      by ten.</p></li>
@@ -1393,8 +1391,7 @@
      character.</p></li>
 
      <li><p>If <var title="">position</var> is past the end of <var
-     title="">input</var>, then return <var title="">value</var> and
-     abort these steps.</li>
+     title="">input</var>, then return <var title="">value</var>.</li>
 
      <li><p>If the character indicated by <var title="">position</var>
      is one of U+0030 DIGIT ZERO (0) .. U+0039 DIGIT NINE (9), return
@@ -1415,8 +1412,7 @@
      character.</p></li>
 
      <li><p>If <var title="">position</var> is past the end of <var
-     title="">input</var>, then return <var title="">value</var> and
-     abort these steps.</li>
+     title="">input</var>, then return <var title="">value</var>.</li>
 
      <li>
 
@@ -1431,8 +1427,8 @@
        character.</li>
 
        <li><p>If <var title="">position</var> is past the end of <var
-       title="">input</var>, then return <var title="">value</var> and
-       abort these steps.</li>
+       title="">input</var>, then return <var
+       title="">value</var>.</li>
 
       </ol>
 
@@ -1440,7 +1436,7 @@
 
      <li><p>If the character indicated by <var title="">position</var>
      is not one of U+0030 DIGIT ZERO (0) .. U+0039 DIGIT NINE (9),
-     then return <var title="">value</var> and abort these steps.</li>
+     then return <var title="">value</var>.</li>
 
      <li><p><span>Collect a sequence of characters</span> in the range
      U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
@@ -26142,7 +26138,22 @@
 
   <p>Each <code>input</code> element has a <span
   title="concept-fe-value">value</span>, which is exposed by the <code
-  title="dom-input-value">value</code> DOM attribute.</p>
+  title="dom-input-value">value</code> DOM attribute. Some states
+  define an <dfn title="concept-input-value-string-number">algorithm
+  to convert a string to a number</dfn>, an <dfn
+  title="concept-input-value-number-string">algorithm to convert a
+  number to a string</dfn>, an <dfn
+  title="concept-input-value-string-date">algorithm to convert a
+  string to a <code>Date</code> object</dfn>, and an <dfn
+  title="concept-input-value-date-string">algorithm to convert a
+  <code>Date</code> object to a string</dfn>, which are used by
+  <code title="attr-input-max">max</code>,
+  <code title="attr-input-min">min</code>,
+  <code title="attr-input-step">step</code>,
+  <code title="dom-input-valueAsDate">valueAsDate</code>,
+  <code title="dom-input-valueAsNumber">valueAsNumber</code>,
+  <code title="dom-input-stepUp">stepUp()</code>, and
+  <code title="dom-input-stepDown">stepDown()</code>.</p>
 
   <p>Each <code>input</code> element has a boolean <dfn
   title="concept-input-mutability">mutability flag</dfn>. When it is
@@ -26533,62 +26544,79 @@
   of the element is not a <span>valid UTC date and time</span>, then
   set it to the empty string instead.</p>
 
-  <p>The <dfn title="concept-input-value-datetime">selected UTC date
-  and time</dfn> is the result of <span title="parse a UTC date and
-  time">parsing a UTC date and time</span> from the element's <span
-  title="concept-fe-value">value</span>, unless that fails, in which
-  case there is no <span title="concept-input-value-datetime">selected
-  UTC date and time</span>.</p>
+  <p><strong>The <span
+  title="concept-input-value-string-number">algorithm to convert a
+  string to a number</span>, given a string <var
+  title="">input</var></strong>, is as follows:</p>
 
-  <p class="big-issue"><strong>The <span><code
-  title="dom-input-valueAsDate">valueAsDate</code> setter
-  algorithm</span> is as follows:</strong> ...</p>
+  <ol>
 
-  <p class="big-issue"><strong>The <span><code
-  title="dom-input-valueAsNumber">valueAsNumber</code> setter
-  algorithm</span> is as follows:</strong> ...</p>
+   <li><p><span>Parse a UTC date and time</span> from <var
+   title="">input</var>.</p></li>
 
-  <p>The <code title="attr-input-min">min</code> attribute, if
-  specified, must have a value that is a <span>valid UTC date and
-  time</span>. The <dfn title="concept-input-min-datetime">minimum UTC
-  date and time</dfn> is the result of <span title="parse a UTC date
-  and time">parsing a UTC date and time</span> from the element's
-  <code title="attr-input-min">min</code> attribute, unless that
-  fails, in which case there is no <span
-  title="concept-input-min-datetime">minimum UTC date and
-  time</span>.</p>
+   <li><p>If that results in an error, return an error and abort these
+   steps.</p></li>
 
-  <p><strong>Constraint validation:</strong> When there is both a
-  <span title="concept-input-value-datetime">selected UTC date and
-  time</span> and a <span title="concept-input-min-datetime">minimum
-  UTC date and time</span>, if the former is earlier than the latter,
-  the element is <span>suffering from an underflow</span>.</p>
+   <li><p>Otherwise, return the number of milliseconds elapsed from
+   midnight UTC on the morning of 1970-01-01 (the time represented by
+   the value "<code title="">1970-01-01T00:00:00.0Z</code>") to the
+   parsed date and time, ignoring leap seconds.</p></li>
 
-  <p>The <code title="attr-input-max">max</code> attribute, if
+  </ol>
+
+  <p><strong>The <span
+  title="concept-input-value-number-string">algorithm to convert a
+  number to a string</span>, given a number <var
+  title="">input</var></strong>, consists of returning a <span>valid
+  UTC date and time</span> that represents the date and time in UTC
+  that is <var title="">input</var> milliseconds afer midnight UTC on
+  the morning of 1970-01-01 (the time represented by the value "<code
+  title="">1970-01-01T00:00:00.0Z</code>").</p>
+
+  <p><strong>The <span
+  title="concept-input-value-string-date">algorithm to convert a
+  string to a <code>Date</code> object</span>, given a string <var
+  title="">input</var></strong>, is as follows:</p>
+
+  <ol>
+
+   <li><p><span>Parse a UTC date and time</span> from <var
+   title="">input</var>.</p></li>
+
+   <li><p>If that results in an error, return an error and abort these
+   steps.</p></li>
+
+   <li><p>Otherwise, return a <code>Date</code> object representing
+   the parsed date and time.</p></li>
+
+  </ol>
+
+  <p><strong>The <span
+  title="concept-input-value-date-string">algorithm to convert a
+  <code>Date</code> object to a string</span>, given a
+  <code>Date</code> object <var title="">input</var></strong>,
+  consists of returning a <span>valid UTC date and time</span> that
+  represents the date and time in UTC that is represented by <var
+  title="">input</var>.</p>
+
+  <!-- MIN AND MAX: -->
+
+  <p>The <code title="attr-input-min">min</code> attribute, if
   specified, must have a value that is a <span>valid UTC date and
-  time</span>. The <dfn title="concept-input-max-datetime">maximum UTC
-  date and time</dfn> is the result of <span title="parse a UTC date
-  and time">parsing a UTC date and time</span> from the element's
-  <code title="attr-input-max">max</code> attribute, unless that
-  fails, in which case there is no <span
-  title="concept-input-max-datetime">maximum UTC date and
+  time</span>. The <code title="attr-input-max">max</code> attribute,
+  if specified, must have a value that is a <span>valid UTC date and
   time</span>.</p>
 
-  <p><strong>Constraint validation:</strong> When there is both a
-  <span title="concept-input-value-datetime">selected UTC date and
-  time</span> and a <span title="concept-input-max-datetime">maximum
-  UTC date and time</span>, if the former is later than the latter,
-  the element is <span>suffering from an overflow</span>.</p>
+  <!-- STEP: -->
 
-  <p class="big-issue">The <code title="attr-input-step">step</code>
-  attribute, if specified, must have a value that is a ...</p>
+  <p>The <code title="attr-input-step">step</code> attribute is
+  expressed in seconds. The <span
+  title="concept-input-step-scale">step scale factor</span> is 1000
+  (which converts the seconds to milliseconds, as used in the other
+  algorithms). The <span title="concept-input-step-default">default
+  step</span> is 60 seconds.</p>
 
-  <!-- values: positive non-zero floating point, or "any" -->
-  <!-- units: seconds -->
-  <!-- default: 60 -->
-  <!-- zero point: min, or 1970-01-01T00:00:00.0Z -->
-  <!-- allow rounding -->
-  <!-- <span>suffering from a step mismatch</span> -->
+  <!-- XXX allow rounding -->
 
   <p>The following common <code>input</code> element content
   attributes, DOM attributes, and methods apply to the element:
@@ -26996,21 +27024,126 @@
 
 
 
-  <h6>Other attributes</h6>
+  <h6>The <code title="attr-input-min">min</code> and <code
+  title="attr-input-max">max</code> attributes</h6>
 
   <p>The <dfn title="attr-input-min"><code>min</code></dfn> and <dfn
-  title="attr-input-max"><code>max</code></dfn> attributes define a
-  range constraint on the value.</p>
+  title="attr-input-max"><code>max</code></dfn> attributes indicate
+  the allowed range of values for the element.</p>
 
+  <p>Their syntax is defined by the section that defines the <code
+  title="attr-input-type">type</code> attribute's current state.</p>
+
+  <p><strong>Constraint validation:</strong> When the element has a
+  <code title="attr-input-min">min</code> attribute, and the result of
+  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-input-value">value</span> is a number, and the result
+  of applying the <span
+  title="concept-input-value-string-number">algorithm to convert a
+  string to a number</span> to the value of the <code
+  title="attr-input-min">min</code> attribute is also a number, and
+  the number obtained from the former is less than the number obtained
+  from the latter, the element is <span>suffering from an
+  underflow</span>.</p>
+
+  <p><strong>Constraint validation:</strong> When the element has a
+  <code title="attr-input-max">max</code> attribute, and the result of
+  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-input-value">value</span> is a number, and the result
+  of applying the <span
+  title="concept-input-value-string-number">algorithm to convert a
+  string to a number</span> to the value of the <code
+  title="attr-input-max">max</code> attribute is also a number, and
+  the number obtained from the former is greater than the number
+  obtained from the latter, the element is <span>suffering from an
+  overflow</span>.</p>
+
+  <p>The <code title="attr-input-min">min</code> attribute also
+  defines the <span title="concept-input-min-zero">step
+  base</span>.</p>
+
+
+  <h6>The <code title="attr-input-step">step</code> attribute</h6>
+
   <p>The <dfn title="attr-input-step"><code>step</code></dfn>
-  attribute defines the increments between allowed values.</p>
+  attribute indicates the granularity that is expected (and required)
+  of the <span title="concept-input-value">value</span>, by limiting
+  the allowed values. The section that defines the <code
+  title="attr-input-type">type</code> attribute's current state also
+  defines the <dfn title="concept-input-step-default">default
+  step</dfn> and the <dfn title="concept-input-step-scale">step
+  scale factor</dfn>, which are used in processing the attribute as
+  described below.</p>
 
-  <p>These attributes apply for a number of different states, but as
-  their behavior varies from state to state, they are not defined here
-  but instead in the states' own sections.</p>
+  <p>The <code title="attr-input-step">step</code> attribute, if
+  specified, must either have a value that is a <span>valid floating
+  point number</span> that <span title="rules for parsing floating
+  point number values">parses</span> to a number that is greater than
+  zero, or must have a value that is an <span>ASCII
+  case-insensitive</span> match for the string "<code
+  title="">any</code>".</p>
 
+  <p>The attribute provides the <dfn
+  title="concept-input-step">allowed value step</dfn> for the element,
+  as follows:</p>
 
+  <ol>
 
+   <li>If the attribute is absent, then the <span
+   title="concept-input-step">allowed value step</span> is the <span
+   title="concept-input-step-default">default step</span> multiplied
+   by the <span title="concept-input-step-scale">step scale
+   factor</span>.</li>
+
+   <li>Otherwise, if the attribute's value is an <span>ASCII
+   case-insensitive</span> match for the string "<code
+   title="">any</code>", then there is no <span
+   title="concept-input-step">allowed value step</span>.</li>
+
+   <li>Otherwise, if the <span>rules for parsing floating point number
+   values</span>, when they are applied to the attribute's value,
+   return an error, zero, or a number less than zero, then the <span
+   title="concept-input-step">allowed value step</span> is the <span
+   title="concept-input-step-default">default step</span> multiplied
+   by the <span title="concept-input-step-scale">step scale
+   factor</span>.</li>
+
+   <li>Otherwise, the <span title="concept-input-step">allowed value
+   step</span> is the number returned by the <span>rules for parsing
+   floating point number values</span> when they are applied to the
+   attribute's value, multiplied by the <span
+   title="concept-input-step-scale">step scale factor</span>.</li>
+
+  </ol>
+
+  <p>The <dfn title="concept-input-min-zero">step base</dfn> is the
+  result of applying the <span
+  title="concept-input-value-string-number">algorithm to convert a
+  string to a number</span> to the value of the <code
+  title="attr-input-min">min</code> attribute, unless the element does
+  not have a <code title="attr-input-min">min</code> attribute
+  specified or the result of applying that algorithm is an error, in
+  which case the <span title="concept-input-min-zero">step base</span>
+  is zero.</p>
+
+  <p><strong>Constraint validation:</strong> When the element has an
+  <span title="concept-input-step">allowed value step</span>, and the
+  result of 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-input-value">value</span> is a number, and that
+  number 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>, the element is
+  <span>suffering from a step mismatch</span>.</p>
+
+
+
+
   <h5>Common <code>input</code> element APIs</h5>
 
   <h6>Value manipulation</h6>
@@ -27035,59 +27168,109 @@
   as a date.</p>
 
   <p>On getting, if the <code
-  title="dom-input-valueAsDate">valueAsDate</code> attribute applies,
-  as defined for the <code>input</code> element's <code
+  title="dom-input-valueAsDate">valueAsDate</code> attribute does not
+  apply, as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
-  run the <dfn><code title="dom-input-valueAsDate">valueAsDate</code>
-  getter algorithm</dfn> defined for that state. Otherwise, return a
-  Not-a-Number (NaN) value.</p>
+  return null. Otherwise, run the <dfn
+  title="concept-input-value-string-date">algorithm to convert a
+  string to a <code>Date</code> object</dfn> defined for that state;
+  if the algorithm returned a <code>Date</code> object, then return
+  it, otherwise, return null.</p>
 
   <p>On setting, if the <code
-  title="dom-input-valueAsDate">valueAsDate</code> attribute applies,
-  as defined for the <code>input</code> element's <code
+  title="dom-input-valueAsDate">valueAsDate</code> attribute does not
+  apply, as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
-  run the <dfn><code title="dom-input-valueAsDate">valueAsDate</code>
-  setter algorithm</dfn> defined for that state. Otherwise, do
-  nothing.</p>
+  throw an <code>INVALID_ACCESS_ERR</code> exception; otherwise, if
+  the new value is null, then set the <span
+  title="concept-input-value">value</span> of the element to the empty
+  string; otherwise, run the <dfn
+  title="concept-input-value-date-string">algorithm to convert a
+  <code>Date</code> object to a string</dfn>, as defined for that
+  state, on the new value, and set the <span
+  title="concept-input-value">value</span> of the element to resulting
+  string.</p>
 
   <hr>
 
   <p>The <dfn
   title="dom-input-valueAsNumber"><code>valueAsNumber</code></dfn> DOM
-  attribute represents the <span
-  title="concept-fe-value">value</span> of the element, interpreted
-  as a number.</p>
+  attribute represents the <span title="concept-fe-value">value</span>
+  of the element, interpreted as a number.</p>
 
   <p>On getting, if the <code
-  title="dom-input-valueAsNumber">valueAsNumber</code> attribute
-  applies, as defined for the <code>input</code> element's <code
+  title="dom-input-valueAsNumber">valueAsNumber</code> attribute does
+  not apply, as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
-  run the <dfn><code
-  title="dom-input-valueAsNumber">valueAsNumber</code> getter
-  algorithm</dfn> defined for that state. Otherwise, return the <span
-  title="concept-fe-value">value</span> of the element, cast to the
-  type of the DOM attribute.</p>
+  return a Not-a-Number (NaN) value. Otherwise, run the <dfn
+  title="concept-input-value-string-number">algorithm to convert a
+  string to a number</dfn> defined for that state; if the algorithm
+  returned a number, then return it, otherwise, return a Not-a-Number
+  (NaN) value.</p>
 
   <p>On setting, if the <code
-  title="dom-input-valueAsNumber">valueAsNumber</code> attribute
-  applies, as defined for the <code>input</code> element's <code
+  title="dom-input-valueAsNumber">valueAsNumber</code> attribute does
+  not apply, as defined for the <code>input</code> element's <code
   title="attr-input-type">type</code> attribute's current state, then
-  run the <dfn><code
-  title="dom-input-valueAsNumber">valueAsNumber</code> setter
-  algorithm</dfn> defined for that state. Otherwise, the <span
-  title="concept-fe-value">value</span> must be set to the shortest
-  possible representation of the given value that is a <span>valid
-  floating point number</span> in base ten.</p>
+  throw an <code>INVALID_ACCESS_ERR</code> exception; otherwise, run
+  the <dfn title="concept-input-value-number-string">algorithm to
+  convert a number to a string</dfn>, as defined for that state, on
+  the new value, and set the <span
+  title="concept-input-value">value</span> of the element to resulting
+  string.</p>
 
+  <hr>
 
+  <p>The <dfn title="dom-input-stepUp"><code>stepUp()</code></dfn> and
+  <dfn title="dom-input-stepDown"><code>stepDown()</code></dfn>
+  methods, when invoked, must run the following algorithm:</p>
 
+  <ol>
+
+   <li><p>If the <code title="dom-input-stepUp">stepUp()</code> and
+   <code title="dom-input-stepDown">stepDown()</code> methods do not
+   apply, as defined for the <code>input</code> element's <code
+   title="attr-input-type">type</code> attribute's current state, then
+   throw an <code>INVALID_ACCESS_ERR</code> exception, and abort these
+   steps.</p></li>
+
+   <li><p>If the element has no <span
+   title="concept-input-step">allowed value step</span>, then throw a
+   <code>INVALID_ACCESS_ERR</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-input-value">value</span> results in an error,
+   then throw an <code>INVALID_ACCESS_ERR</code> exception, and abort
+   these steps; otherwise, let <var title="">value</var> be the result
+   of that algorithm.</p></li>
+
+   <li><p>If the method invoked was the <code
+   title="dom-input-stepDown">stepDown()</code> method, negate <var
+   title="">value</var>.</p></li>
+
+   <li><p>Let <var title="">value</var> be the result of adding the
+   <span title="concept-input-step">allowed value step</span> to <var
+   title="">value</var>.</p></li>
+
+   <li><p>Run the <dfn
+   title="concept-input-value-number-string">algorithm to convert a
+   number to a string</dfn>, as defined for the <code>input</code>
+   element's <code title="attr-input-type">type</code> attribute's
+   current state, on <var title="">value</var>, and set the <span
+   title="concept-input-value">value</span> of the element to
+   resulting string.</p></li>
+
+  </ol>
+
+
   <h6>Others...</h6>
 
   <p class="big-issue">... <dfn title="dom-input-checked"><code>checked</code></dfn></p>
   <p class="big-issue">... <dfn title="dom-input-list"><code>list</code></dfn></p>
   <p class="big-issue">... <dfn title="dom-input-selectedOption"><code>selectedOption</code></dfn></p>
-  <p class="big-issue">... <dfn title="dom-input-stepUp"><code>stepUp()</code></dfn></p>
-  <p class="big-issue">... <dfn title="dom-input-stepDown"><code>stepDown()</code></dfn></p>
 
 
 




More information about the Commit-Watchers mailing list