[html5] r2247 - [] (0) WF2: stepUp/stepDown shouldn't go out of range. Allow rounding of datetim [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Sep 29 21:10:55 PDT 2008


Author: ianh
Date: 2008-09-29 21:10:52 -0700 (Mon, 29 Sep 2008)
New Revision: 2247

Modified:
   index
   source
Log:
[] (0) WF2: stepUp/stepDown shouldn't go out of range. Allow rounding of datetime controls.

Modified: index
===================================================================
--- index	2008-09-30 03:37:13 UTC (rev 2246)
+++ index	2008-09-30 04:10:52 UTC (rev 2247)
@@ -30080,9 +30080,14 @@
    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 -->
+   is 60 seconds.
 
+  <p>When the element is <a href="#suffering3">suffering from a step
+   mismatch</a>, the user agent may round the element's <span
+   title=concept-input-value>value</span> to the nearest date and time for
+   which the element would not <a href="#suffering3" title="suffering from a
+   step mismatch">suffer from a step mismatch</a>.
+
   <hr>
 
   <p><strong>The <a href="#algorithm5"
@@ -30247,7 +30252,8 @@
    the <a href="#range1" title=attr-input-type-range>Range</a> state, the
    rules in this section apply.
 
-  <p class=big-issue>...
+  <p class=big-issue>...</p>
+  <!-- XXX default min/max, calling valueAsNumber with out-of-range values -->
 
   <h6 id=checkbox><span class=secno>4.10.4.1.13. </span><dfn id=checkbox1
    title=attr-input-type-checkbox>Checkbox</dfn> state</h6>
@@ -30543,37 +30549,61 @@
    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="#algorithm5"
-   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="#value12"
-   title=concept-fe-value>value</a> is a number, and the result of applying
+  <p>If the element has a <code title=attr-input-min><a
+   href="#min2">min</a></code> attribute, and the result of applying the <a
+   href="#algorithm5" 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 a a
+   number, then that number is the element's <dfn id=minimum
+   title=concept-input-min>minimum</dfn>. (Otherwise, the element has no <a
+   href="#minimum" title=concept-input-min>minimum</a>.)
+
+  <p><strong>Constraint validation:</strong> When the element has a <a
+   href="#min2" title=attr-input-min>minimum</a>, and the result of applying
    the <a href="#algorithm5"
    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="#algorithm5"
-   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="#value12"
-   title=concept-fe-value>value</a> is a number, and the result of applying
-   the <a href="#algorithm5"
-   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>.
+   title=concept-fe-value>value</a> is a number, and the number obtained from
+   that algorithm is less than the <a href="#min2"
+   title=attr-input-min>minimum</a>, the element is <a
+   href="#suffering1">suffering from an underflow</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>.
 
+  <p>If the element has a <code title=attr-input-max><a
+   href="#max4">max</a></code> attribute, and the result of applying the <a
+   href="#algorithm5" 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 a a
+   number, then that number is the element's <dfn id=maximum0
+   title=concept-input-max>maximum</dfn>. (Otherwise, the element has no <a
+   href="#maximum0" title=concept-input-max>maximum</a>.)
+
+  <p><strong>Constraint validation:</strong> When the element has a <a
+   href="#max4" title=attr-input-max>maximum</a>, and the result of applying
+   the <a href="#algorithm5"
+   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="#value12"
+   title=concept-fe-value>value</a> is a number, and the number obtained from
+   that algorithm is more than the <a href="#max4"
+   title=attr-input-max>maximum</a>, the element is <a
+   href="#suffering2">suffering from an overflow</a>.
+
+  <p>The <code title=attr-input-max><a href="#max4">max</a></code>
+   attribute's value (the <a href="#maximum0"
+   title=concept-input-max>maximum</a>) must not be less than the <code
+   title=attr-input-min><a href="#min2">min</a></code> attribute's value (its
+   <a href="#minimum" title=concept-input-min>minimum</a>).
+
+  <p class=note>If an element has a <a href="#max4"
+   title=attr-input-max>maximum</a> that is less than its <a href="#min2"
+   title=attr-input-min>minimum</a>, then so long as the element has a <a
+   href="#value12" title=concept-fe-value>value</a>, it will either be <a
+   href="#suffering1">suffering from an underflow</a> or <a
+   href="#suffering2">suffering from an overflow</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>
 
@@ -30740,7 +30770,7 @@
 
    <li>
     <p>If the element has no <a href="#allowed"
-     title=concept-input-step>allowed value step</a>, then throw a
+     title=concept-input-step>allowed value step</a>, then throw an
      <code>INVALID_ACCESS_ERR</code> exception, and abort these steps.
 
    <li>
@@ -30763,13 +30793,30 @@
      title="">value</var>.
 
    <li>
-    <p>Run the <a href="#algorithm6"
-     title=concept-input-value-number-string>algorithm to convert a number to
-     a string</a>, as defined for the <code><a
+    <p>Let <var title="">value as string</var> be the result of running the
+     <a href="#algorithm6" title=concept-input-value-number-string>algorithm
+     to convert a number to a string</a>, 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 <a href="#value12"
-     title=concept-fe-value>value</a> of the element to the resulting string.
+     title="">value</var>.
+
+   <li>
+    <p>If the element has a <a href="#minimum"
+     title=concept-input-min>minimum</a>, and the <var title="">value</var>
+     is less than that <a href="#minimum"
+     title=concept-input-min>minimum</a>, then throw a
+     <code>INVALID_ACCESS_ERR</code> exception.
+
+   <li>
+    <p>If the element has a <a href="#maximum0"
+     title=concept-input-max>maximum</a>, and the <var title="">value</var>
+     is greater than that <a href="#maximum0"
+     title=concept-input-max>maximum</a>, then throw a
+     <code>INVALID_ACCESS_ERR</code> exception.
+
+   <li>
+    <p>Set the <a href="#value12" title=concept-fe-value>value</a> of the
+     element to <var title="">value as string</var>.
   </ol>
 
   <h6 id=others...><span class=secno>4.10.4.3.2. </span>Others...</h6>

Modified: source
===================================================================
--- source	2008-09-30 03:37:13 UTC (rev 2246)
+++ source	2008-09-30 04:10:52 UTC (rev 2247)
@@ -26561,7 +26561,11 @@
   algorithms). The <span title="concept-input-step-default">default
   step</span> is 60 seconds.</p>
 
-  <!-- XXX allow rounding -->
+  <p>When the element is <span>suffering from a step mismatch</span>,
+  the user agent may round the element's <span
+  title="concept-input-value">value</span> to the nearest date and
+  time for which the element would not <span title="suffering from a
+  step mismatch">suffer from a step mismatch</span>.</p>
 
   <hr>
 
@@ -26733,8 +26737,10 @@
 
   <p class="big-issue">...</p>
 
+  <!-- XXX default min/max, calling valueAsNumber with out-of-range values -->
 
 
+
   <h6><dfn title="attr-input-type-checkbox">Checkbox</dfn> state</h6>
 
   <p>When an <code>input</code> element's <code
@@ -27038,39 +27044,61 @@
   <p>Their syntax is defined by the section that defines the <code
   title="attr-input-type">type</code> attribute's current state.</p>
 
+  <p>If 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 value of the <code
+  title="attr-input-min">min</code> attribute is a a number, then that
+  number is the element's <dfn
+  title="concept-input-min">minimum</dfn>. (Otherwise, the element has
+  no <span title="concept-input-min">minimum</span>.)</p>
+
   <p><strong>Constraint validation:</strong> When the element has a
-  <code title="attr-input-min">min</code> attribute, and the result of
+  <span title="attr-input-min">minimum</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-fe-value">value</span> is a number, and the result
-  of applying the <span
+  title="concept-fe-value">value</span> is a number, and the number
+  obtained from that algorithm is less than the <span
+  title="attr-input-min">minimum</span>, the element is
+  <span>suffering from an underflow</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>
+
+  <p>If 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 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>
+  title="attr-input-max">max</code> attribute is a a number, then that
+  number is the element's <dfn
+  title="concept-input-max">maximum</dfn>. (Otherwise, the element has
+  no <span title="concept-input-max">maximum</span>.)</p>
 
   <p><strong>Constraint validation:</strong> When the element has a
-  <code title="attr-input-max">max</code> attribute, and the result of
+  <span title="attr-input-max">maximum</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-fe-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
+  title="concept-fe-value">value</span> is a number, and the number
+  obtained from that algorithm is more than the <span
+  title="attr-input-max">maximum</span>, the element is
+  <span>suffering from an overflow</span>.</p>
+
+  <p>The <code title="attr-input-max">max</code> attribute's value
+  (the <span title="concept-input-max">maximum</span>) must not be
+  less than the <code title="attr-input-min">min</code> attribute's
+  value (its <span title="concept-input-min">minimum</span>).</p>
+
+  <p class="note">If an element has a <span
+  title="attr-input-max">maximum</span> that is less than its <span
+  title="attr-input-min">minimum</span>, then so long as the element
+  has a <span title="concept-fe-value">value</span>, it will either be
+  <span>suffering from an underflow</span> or <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>
@@ -27239,7 +27267,7 @@
    steps.</p></li>
 
    <li><p>If the element has no <span
-   title="concept-input-step">allowed value step</span>, then throw a
+   title="concept-input-step">allowed value step</span>, then throw an
    <code>INVALID_ACCESS_ERR</code> exception, and abort these
    steps.</p></li>
 
@@ -27259,14 +27287,28 @@
    <span title="concept-input-step">allowed value step</span> to <var
    title="">value</var>.</p></li>
 
-   <li><p>Run the <span
+   <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
    number to a string</span>, 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-fe-value">value</span> of the element to the
-   resulting string.</p></li>
+   current state, on <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>INVALID_ACCESS_ERR</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>INVALID_ACCESS_ERR</code> exception.</p></li>
+
+   <li><p>Set the <span title="concept-fe-value">value</span> of the
+   element to <var title="">value as string</var>.</p></li>
+
   </ol>
 
 




More information about the Commit-Watchers mailing list