[html5] r7639 - [giow] (2) Change stepUp/stepDown algorithm to be more like typical UIs. Affecte [...]

whatwg at whatwg.org whatwg at whatwg.org
Mon Jan 7 16:47:23 PST 2013


Author: ianh
Date: 2013-01-07 16:47:21 -0800 (Mon, 07 Jan 2013)
New Revision: 7639

Modified:
   complete.html
   index
   source
Log:
[giow] (2) Change stepUp/stepDown algorithm to be more like typical UIs.
Affected topics: DOM APIs

Modified: complete.html
===================================================================
--- complete.html	2013-01-07 23:45:50 UTC (rev 7638)
+++ complete.html	2013-01-08 00:47:21 UTC (rev 7639)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 7 January 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 8 January 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -51834,32 +51834,34 @@
    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>
+   <li>
 
-   <li><p>Let <var title="">delta</var> be the <a href=#concept-input-step title=concept-input-step>allowed value step</a> multiplied by
-   <var title="">n</var>.</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, 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>, and that is less than <var title="">value</var> if the method invoked was the <code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> and more than <var title="">value</var>
+    otherwise.</p>
 
-   <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>
+    <p>Otherwise (<var title="">value</var> 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>), run the following substeps:</p>
 
-   <li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
+    <ol><li><p>Let <var title="">n</var> be the argument, or 1 if the argument was omitted.</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>Let <var title="">delta</var> be the <a href=#concept-input-step title=concept-input-step>allowed value
+     step</a> multiplied by <var title="">n</var>.</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 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>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</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
 
+    </ol></li>
+
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a>, and <var title="">value</var> is less than that <a href=#concept-input-min title=concept-input-min>minimum</a>, then abort
+   these steps.</li>
+
+   <li><p>If the element has a <a href=#concept-input-max title=concept-input-max>maximum</a>, and <var title="">value</var> is greater than that <a href=#concept-input-max title=concept-input-max>maximum</a>, then
+   abort these steps.</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>

Modified: index
===================================================================
--- index	2013-01-07 23:45:50 UTC (rev 7638)
+++ index	2013-01-08 00:47:21 UTC (rev 7639)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 7 January 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 8 January 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -51834,32 +51834,34 @@
    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>
+   <li>
 
-   <li><p>Let <var title="">delta</var> be the <a href=#concept-input-step title=concept-input-step>allowed value step</a> multiplied by
-   <var title="">n</var>.</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, 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>, and that is less than <var title="">value</var> if the method invoked was the <code title=dom-input-stepDown><a href=#dom-input-stepdown>stepDown()</a></code> and more than <var title="">value</var>
+    otherwise.</p>
 
-   <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>
+    <p>Otherwise (<var title="">value</var> 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>), run the following substeps:</p>
 
-   <li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
+    <ol><li><p>Let <var title="">n</var> be the argument, or 1 if the argument was omitted.</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>Let <var title="">delta</var> be the <a href=#concept-input-step title=concept-input-step>allowed value
+     step</a> multiplied by <var title="">n</var>.</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 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>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</var> be the result of adding <var title="">delta</var> to <var title="">value</var>.</li>
 
+    </ol></li>
+
+   <li><p>If the element has a <a href=#concept-input-min title=concept-input-min>minimum</a>, and <var title="">value</var> is less than that <a href=#concept-input-min title=concept-input-min>minimum</a>, then abort
+   these steps.</li>
+
+   <li><p>If the element has a <a href=#concept-input-max title=concept-input-max>maximum</a>, and <var title="">value</var> is greater than that <a href=#concept-input-max title=concept-input-max>maximum</a>, then
+   abort these steps.</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>

Modified: source
===================================================================
--- source	2013-01-07 23:45:50 UTC (rev 7638)
+++ source	2013-01-08 00:47:21 UTC (rev 7639)
@@ -60454,38 +60454,46 @@
    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>
+   <li>
 
-   <li><p>Let <var title="">delta</var> be the <span
-   title="concept-input-step">allowed value step</span> multiplied by
-   <var title="">n</var>.</p></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, 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>, and that is less than <var
+    title="">value</var> if the method invoked was the <code
+    title="dom-input-stepDown">stepDown()</code> and more than <var title="">value</var>
+    otherwise.</p>
 
-   <li><p>If the method invoked was the <code
-   title="dom-input-stepDown">stepDown()</code> method, negate <var
-   title="">delta</var>.</p></li>
+    <p>Otherwise (<var title="">value</var> 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>), run the following substeps:</p>
 
-   <li><p>Let <var title="">value</var> be the result of adding <var
-   title="">delta</var> to <var title="">value</var>.</p></li>
+    <ol>
 
-   <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>Let <var title="">n</var> be the argument, or 1 if the argument was omitted.</p></li>
 
-   <li><p>If the element has a <span title="concept-input-max">maximum</span>, and the <var
+     <li><p>Let <var title="">delta</var> be the <span title="concept-input-step">allowed value
+     step</span> multiplied by <var title="">n</var>.</p></li>
+
+     <li><p>If the method invoked was the <code title="dom-input-stepDown">stepDown()</code> method,
+     negate <var title="">delta</var>.</p></li>
+
+     <li><p>Let <var title="">value</var> be the result of adding <var title="">delta</var> to <var
+     title="">value</var>.</p></li>
+
+    </ol>
+
+   </li>
+
+   <li><p>If the element has a <span title="concept-input-min">minimum</span>, and <var
+   title="">value</var> is less than that <span title="concept-input-min">minimum</span>, then abort
+   these steps.</p></li>
+
+   <li><p>If the element has a <span title="concept-input-max">maximum</span>, and <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>
+   abort these steps.</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




More information about the Commit-Watchers mailing list