Skip to content

Commit

Permalink
[e] (0) Try to be more explicit about what happens with parsing strin…
Browse files Browse the repository at this point in the history
…gs into floats for out-of-range or over-precise values.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=8047

git-svn-id: http://svn.whatwg.org/webapps@4331 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 25, 2009
1 parent c30ed8a commit bcd5609
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 21 deletions.
15 changes: 8 additions & 7 deletions complete.html
Expand Up @@ -5558,13 +5558,14 @@ <h4 id=reflecting-content-attributes-in-idl-attributes><span class=secno>2.7.1 <
(<code>float</code>), then, on getting, the content attribute must
be parsed according to the <a href=#rules-for-parsing-floating-point-number-values>rules for parsing floating point
number values</a>, and if that is successful, and the value is in
the range of the IDL attribute's type, the resulting value must be
returned. If, on the other hand, it fails or returns an out of range
value, or if the attribute is absent, the default value must be
returned instead, or 0.0 if there is no default value. On setting,
the given value must be converted to the <a href=#best-representation-of-the-number-as-a-floating-point-number>best representation
of the number as a floating point number</a> and then that string
must be used as the new content attribute value.</p>
the range of the IDL attribute's type (excluding infinities), the
resulting value must be returned, truncating it if necessary. If, on
the other hand, it fails or returns an out of range value, or if the
attribute is absent, the default value must be returned instead, or
0.0 if there is no default value. On setting, the given value must
be converted to the <a href=#best-representation-of-the-number-as-a-floating-point-number>best representation of the number as a
floating point number</a> and then that string must be used as
the new content attribute value.</p>

<p class=note>The values Infinity and Not-a-Number (NaN) values
throw an exception on setting, as <a href=#float-nan>defined
Expand Down
15 changes: 8 additions & 7 deletions index
Expand Up @@ -5368,13 +5368,14 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
(<code>float</code>), then, on getting, the content attribute must
be parsed according to the <a href=#rules-for-parsing-floating-point-number-values>rules for parsing floating point
number values</a>, and if that is successful, and the value is in
the range of the IDL attribute's type, the resulting value must be
returned. If, on the other hand, it fails or returns an out of range
value, or if the attribute is absent, the default value must be
returned instead, or 0.0 if there is no default value. On setting,
the given value must be converted to the <a href=#best-representation-of-the-number-as-a-floating-point-number>best representation
of the number as a floating point number</a> and then that string
must be used as the new content attribute value.</p>
the range of the IDL attribute's type (excluding infinities), the
resulting value must be returned, truncating it if necessary. If, on
the other hand, it fails or returns an out of range value, or if the
attribute is absent, the default value must be returned instead, or
0.0 if there is no default value. On setting, the given value must
be converted to the <a href=#best-representation-of-the-number-as-a-floating-point-number>best representation of the number as a
floating point number</a> and then that string must be used as
the new content attribute value.</p>

<p class=note>The values Infinity and Not-a-Number (NaN) values
throw an exception on setting, as <a href=#float-nan>defined
Expand Down
15 changes: 8 additions & 7 deletions source
Expand Up @@ -5075,13 +5075,14 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
(<code>float</code>), then, on getting, the content attribute must
be parsed according to the <span>rules for parsing floating point
number values</span>, and if that is successful, and the value is in
the range of the IDL attribute's type, the resulting value must be
returned. If, on the other hand, it fails or returns an out of range
value, or if the attribute is absent, the default value must be
returned instead, or 0.0 if there is no default value. On setting,
the given value must be converted to the <span>best representation
of the number as a floating point number</span> and then that string
must be used as the new content attribute value.</p>
the range of the IDL attribute's type (excluding infinities), the
resulting value must be returned, truncating it if necessary. If, on
the other hand, it fails or returns an out of range value, or if the
attribute is absent, the default value must be returned instead, or
0.0 if there is no default value. On setting, the given value must
be converted to the <span>best representation of the number as a
floating point number</span> and then that string must be used as
the new content attribute value.</p>

<p class="note">The values Infinity and Not-a-Number (NaN) values
throw an exception on setting, as <a href="#float-nan">defined
Expand Down

0 comments on commit bcd5609

Please sign in to comment.