Skip to content

Commit

Permalink
[e] (0) Clean up some vague parts of the spec relating to form contro…
Browse files Browse the repository at this point in the history
…ls' numeric values to use the right algorithms

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=13154
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@8439 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 30, 2014
1 parent dba20e6 commit 1c473c8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 46 deletions.
29 changes: 14 additions & 15 deletions complete.html
Expand Up @@ -41935,9 +41935,9 @@ <h6 id="range-state-(type=range)"><span class=secno>4.10.5.1.14 </span><dfn titl

<div class=impl>

<!-- XXXX -->
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as follows</strong>: If the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element is not a <a href=#valid-floating-point-number>valid floating-point
number</a>, then set it to a <a href=#valid-floating-point-number>valid floating-point number</a> that represents the <a href=#concept-input-value-default-range title=concept-input-value-default-range>default value</a>.</p>
number</a>, then set it to the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation of the number as a
floating-point number">best representation, as a floating-point number</a>, of the <a href=#concept-input-value-default-range title=concept-input-value-default-range>default value</a>.</p>

</div>

Expand All @@ -41946,10 +41946,10 @@ <h6 id="range-state-(type=range)"><span class=secno>4.10.5.1.14 </span><dfn titl

<div class=impl>

<!-- XXXX -->
<p>When the element is <a href=#suffering-from-an-underflow>suffering from an underflow</a>, the user agent must set the
element's <a href=#concept-fe-value title=concept-fe-value>value</a> to a <a href=#valid-floating-point-number>valid floating-point
number</a> that represents the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>
element's <a href=#concept-fe-value title=concept-fe-value>value</a> to the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation
of the number as a floating-point number">best representation, as a floating-point
number</a>, of the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>

<p>When the element is <a href=#suffering-from-an-overflow>suffering from an overflow</a>, if the <a href=#concept-input-max title=concept-input-max>maximum</a> is not less than the <a href=#concept-input-min title=concept-input-min>minimum</a>, the user agent must set the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to a <a href=#valid-floating-point-number>valid floating-point number</a> that
represents the <a href=#concept-input-max title=concept-input-max>maximum</a>.</p>
Expand Down Expand Up @@ -42102,11 +42102,11 @@ <h6 id="range-state-(type=range)"><span class=secno>4.10.5.1.14 </span><dfn titl

<div class=impl>

<!-- XXXX -->
<p>When the element is <a href=#suffering-from-an-underflow>suffering from an underflow</a>, the user agent must set either
of the element's <a href=#concept-fe-values title=concept-fe-values>values</a> that represent values less than
the <a href=#concept-input-min title=concept-input-min>minimum</a> to a <a href=#valid-floating-point-number>valid floating-point
number</a> that represents the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>
the <a href=#concept-input-min title=concept-input-min>minimum</a> to the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation of
the number as a floating-point number">best representation, as a floating-point number</a>,
of the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>

<p>When the element is <a href=#suffering-from-an-overflow>suffering from an overflow</a>, if the <a href=#concept-input-max title=concept-input-max>maximum</a> is not less than the <a href=#concept-input-min title=concept-input-min>minimum</a>, the user agent must set either of the element's <a href=#concept-fe-values title=concept-fe-values>values</a> that represent values greater than the <a href=#concept-input-max title=concept-input-max>maximum</a> to a <a href=#valid-floating-point-number>valid floating-point number</a> that
represents the <a href=#concept-input-max title=concept-input-max>maximum</a>.</p>
Expand Down Expand Up @@ -42172,10 +42172,9 @@ <h6 id="range-state-(type=range)"><span class=secno>4.10.5.1.14 </span><dfn titl
<a href=#rules-for-parsing-floating-point-number-values>rules for parsing floating-point number values</a> to <var title="">input</var> results
in an error, then return an error; otherwise, return the resulting number.</p>

<!-- XXXX -->
<p><strong>The <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a number to a
string</a>, given a number <var title="">input</var>, is as follows</strong>: Return a
<a href=#valid-floating-point-number>valid floating-point number</a> that represents <var title="">input</var>.</p>
string</a>, given a number <var title="">input</var>, is as follows</strong>: Return the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation of the number as a floating-point number">best representation, as a
floating-point number</a>, of <var title="">input</var>.</p>

</div>

Expand Down Expand Up @@ -43854,11 +43853,11 @@ <h6 id=the-step-attribute><span class=secno>4.10.5.3.8 </span>The <code title=at

<li><p><a href=#split-a-string-on-commas title="split a string on commas">Split on commas</a> the value of the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content attribute.</li>

<li><p>If the result of the previous step was not exactly two values, both of which are <a href=#valid-floating-point-number title="valid floating-point number">valid floating-point numbers</a>, then skip these
substeps.</li>
<li><p>If the result of the previous step was not exactly two values, or if either gets an
error when you apply the <a href=#concept-input-value-string-number title=concept-input-value-string-number>algorithm to convert
a string to a number</a>, then skip these substeps.</li>

<!--XXXX-->
<li><p>Return the number represented by the lower of the two values, and abort these
<li><p>Return the lower of the two numbers obtained in teh previous step, and abort these
steps.</li>

</ol></li>
Expand Down
29 changes: 14 additions & 15 deletions index
Expand Up @@ -41935,9 +41935,9 @@ ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#se

<div class=impl>

<!-- XXXX -->
<p><strong>The <a href=#value-sanitization-algorithm>value sanitization algorithm</a> is as follows</strong>: If the <a href=#concept-fe-value title=concept-fe-value>value</a> of the element is not a <a href=#valid-floating-point-number>valid floating-point
number</a>, then set it to a <a href=#valid-floating-point-number>valid floating-point number</a> that represents the <a href=#concept-input-value-default-range title=concept-input-value-default-range>default value</a>.</p>
number</a>, then set it to the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation of the number as a
floating-point number">best representation, as a floating-point number</a>, of the <a href=#concept-input-value-default-range title=concept-input-value-default-range>default value</a>.</p>

</div>

Expand All @@ -41946,10 +41946,10 @@ ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#se

<div class=impl>

<!-- XXXX -->
<p>When the element is <a href=#suffering-from-an-underflow>suffering from an underflow</a>, the user agent must set the
element's <a href=#concept-fe-value title=concept-fe-value>value</a> to a <a href=#valid-floating-point-number>valid floating-point
number</a> that represents the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>
element's <a href=#concept-fe-value title=concept-fe-value>value</a> to the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation
of the number as a floating-point number">best representation, as a floating-point
number</a>, of the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>

<p>When the element is <a href=#suffering-from-an-overflow>suffering from an overflow</a>, if the <a href=#concept-input-max title=concept-input-max>maximum</a> is not less than the <a href=#concept-input-min title=concept-input-min>minimum</a>, the user agent must set the element's <a href=#concept-fe-value title=concept-fe-value>value</a> to a <a href=#valid-floating-point-number>valid floating-point number</a> that
represents the <a href=#concept-input-max title=concept-input-max>maximum</a>.</p>
Expand Down Expand Up @@ -42102,11 +42102,11 @@ ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#se

<div class=impl>

<!-- XXXX -->
<p>When the element is <a href=#suffering-from-an-underflow>suffering from an underflow</a>, the user agent must set either
of the element's <a href=#concept-fe-values title=concept-fe-values>values</a> that represent values less than
the <a href=#concept-input-min title=concept-input-min>minimum</a> to a <a href=#valid-floating-point-number>valid floating-point
number</a> that represents the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>
the <a href=#concept-input-min title=concept-input-min>minimum</a> to the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation of
the number as a floating-point number">best representation, as a floating-point number</a>,
of the <a href=#concept-input-min title=concept-input-min>minimum</a>.</p>

<p>When the element is <a href=#suffering-from-an-overflow>suffering from an overflow</a>, if the <a href=#concept-input-max title=concept-input-max>maximum</a> is not less than the <a href=#concept-input-min title=concept-input-min>minimum</a>, the user agent must set either of the element's <a href=#concept-fe-values title=concept-fe-values>values</a> that represent values greater than the <a href=#concept-input-max title=concept-input-max>maximum</a> to a <a href=#valid-floating-point-number>valid floating-point number</a> that
represents the <a href=#concept-input-max title=concept-input-max>maximum</a>.</p>
Expand Down Expand Up @@ -42172,10 +42172,9 @@ ldh-str = &lt; as defined in <a href=http://tools.ietf.org/html/rfc1034#se
<a href=#rules-for-parsing-floating-point-number-values>rules for parsing floating-point number values</a> to <var title="">input</var> results
in an error, then return an error; otherwise, return the resulting number.</p>

<!-- XXXX -->
<p><strong>The <a href=#concept-input-value-number-string title=concept-input-value-number-string>algorithm to convert a number to a
string</a>, given a number <var title="">input</var>, is as follows</strong>: Return a
<a href=#valid-floating-point-number>valid floating-point number</a> that represents <var title="">input</var>.</p>
string</a>, given a number <var title="">input</var>, is as follows</strong>: Return the <a href=#best-representation-of-the-number-as-a-floating-point-number title="best representation of the number as a floating-point number">best representation, as a
floating-point number</a>, of <var title="">input</var>.</p>

</div>

Expand Down Expand Up @@ -43854,11 +43853,11 @@ You cannot submit this form when the field is incorrect.</samp></pre>

<li><p><a href=#split-a-string-on-commas title="split a string on commas">Split on commas</a> the value of the <code title=attr-input-value><a href=#attr-input-value>value</a></code> content attribute.</li>

<li><p>If the result of the previous step was not exactly two values, both of which are <a href=#valid-floating-point-number title="valid floating-point number">valid floating-point numbers</a>, then skip these
substeps.</li>
<li><p>If the result of the previous step was not exactly two values, or if either gets an
error when you apply the <a href=#concept-input-value-string-number title=concept-input-value-string-number>algorithm to convert
a string to a number</a>, then skip these substeps.</li>

<!--XXXX-->
<li><p>Return the number represented by the lower of the two values, and abort these
<li><p>Return the lower of the two numbers obtained in teh previous step, and abort these
steps.</li>

</ol></li>
Expand Down
31 changes: 15 additions & 16 deletions source
Expand Up @@ -45783,10 +45783,10 @@ ldh-str = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#s

<div class="impl">

<!-- XXXX -->
<p><strong>The <span>value sanitization algorithm</span> is as follows</strong>: If the <span
data-x="concept-fe-value">value</span> of the element is not a <span>valid floating-point
number</span>, then set it to a <span>valid floating-point number</span> that represents the <span
number</span>, then set it to the <span data-x="best representation of the number as a
floating-point number">best representation, as a floating-point number</span>, of the <span
data-x="concept-input-value-default-range">default value</span>.</p>

</div>
Expand All @@ -45801,10 +45801,10 @@ ldh-str = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#s

<div class="impl">

<!-- XXXX -->
<p>When the element is <span>suffering from an underflow</span>, the user agent must set the
element's <span data-x="concept-fe-value">value</span> to a <span>valid floating-point
number</span> that represents the <span data-x="concept-input-min">minimum</span>.</p>
element's <span data-x="concept-fe-value">value</span> to the <span data-x="best representation
of the number as a floating-point number">best representation, as a floating-point
number</span>, of the <span data-x="concept-input-min">minimum</span>.</p>

<p>When the element is <span>suffering from an overflow</span>, if the <span
data-x="concept-input-max">maximum</span> is not less than the <span
Expand Down Expand Up @@ -45976,11 +45976,11 @@ ldh-str = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#s

<div class="impl">

<!-- XXXX -->
<p>When the element is <span>suffering from an underflow</span>, the user agent must set either
of the element's <span data-x="concept-fe-values">values</span> that represent values less than
the <span data-x="concept-input-min">minimum</span> to a <span>valid floating-point
number</span> that represents the <span data-x="concept-input-min">minimum</span>.</p>
the <span data-x="concept-input-min">minimum</span> to the <span data-x="best representation of
the number as a floating-point number">best representation, as a floating-point number</span>,
of the <span data-x="concept-input-min">minimum</span>.</p>

<p>When the element is <span>suffering from an overflow</span>, if the <span
data-x="concept-input-max">maximum</span> is not less than the <span
Expand Down Expand Up @@ -46060,10 +46060,10 @@ ldh-str = &lt; as defined in <a href="http://tools.ietf.org/html/rfc1034#s
<span>rules for parsing floating-point number values</span> to <var data-x="">input</var> results
in an error, then return an error; otherwise, return the resulting number.</p>

<!-- XXXX -->
<p><strong>The <span data-x="concept-input-value-number-string">algorithm to convert a number to a
string</span>, given a number <var data-x="">input</var>, is as follows</strong>: Return a
<span>valid floating-point number</span> that represents <var data-x="">input</var>.</p>
string</span>, given a number <var data-x="">input</var>, is as follows</strong>: Return the <span
data-x="best representation of the number as a floating-point number">best representation, as a
floating-point number</span>, of <var data-x="">input</var>.</p>

</div>

Expand Down Expand Up @@ -47974,12 +47974,11 @@ You cannot submit this form when the field is incorrect.</samp></pre>
<li><p><span data-x="split a string on commas">Split on commas</span> the value of the <code
data-x="attr-input-value">value</code> content attribute.</p></li>

<li><p>If the result of the previous step was not exactly two values, both of which are <span
data-x="valid floating-point number">valid floating-point numbers</span>, then skip these
substeps.</p></li>
<li><p>If the result of the previous step was not exactly two values, or if either gets an
error when you apply the <span data-x="concept-input-value-string-number">algorithm to convert
a string to a number</span>, then skip these substeps.</p></li>

<!--XXXX-->
<li><p>Return the number represented by the lower of the two values, and abort these
<li><p>Return the lower of the two numbers obtained in teh previous step, and abort these
steps.</p></li>

</ol>
Expand Down

0 comments on commit 1c473c8

Please sign in to comment.