HTML Standard Tracker

Diff (omit for latest revision)
Filter

Short URL: http://html5.org/r/2731

File a bug

SVNBugCommentTime (UTC)
2731Floats: Allow '1e+0' syntax. Require it for serialising floating point numbers. Other editorial fixes.2009-02-01 08:31
Index: source
===================================================================
--- source	(revision 2730)
+++ source	(revision 2731)
@@ -1352,7 +1352,8 @@
      <li>Either a U+0065 LATIN SMALL LETTER E character or a U+0045
      LATIN CAPITAL LETTER E character.</li>
 
-     <li>Optionally, a U+002D HYPHEN-MINUS ("-") character.</li>
+     <li>Optionally, a U+002D HYPHEN-MINUS ("-") character or U+002B
+     PLUS SIGN ("+") character.</li>
 
      <li>A series of characters in the range U+0030 DIGIT ZERO (0) to
      U+0039 DIGIT NINE (9).</li>
@@ -1372,9 +1373,19 @@
   HYPHEN-MINUS ("-") character and the number is not zero), and where
   the exponent is the number after the E, if any (interpreted as a
   negative number if there is a U+002D HYPHEN-MINUS ("-") character
-  between the E and the number and the number is not zero). If there
-  is no E, then the exponent is treated as zero.</p>
+  between the E and the number and the number is not zero, or else
+  ignoring a U+002B PLUS SIGN ("+") character between the E and the
+  number if there is one). If there is no E, then the exponent is
+  treated as zero.</p>
 
+  <p class="note">The values &plusmn;Infinity and NaN are not <span
+  title="valid floating point number">valid floating point
+  numbers</span>.</p>
+
+  <p>The <dfn>best representation of the floating point number</dfn>
+  <var title="">n</var> is the string obtained from applying the
+  ECMAScript operator ToString to <var title="">n</var>.</p>
+
   <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
@@ -1504,6 +1515,21 @@
 
       </ol>
 
+      <p>Otherwise, if the character indicated by <var
+      title="">position</var> is a U+002B PLUS SIGN ("+")
+      character:</p>
+
+      <ol>
+
+       <li>Advance <var title="">position</var> to the next
+       character.</li>
+
+       <li><p>If <var title="">position</var> is past the end of <var
+       title="">input</var>, then return <var
+       title="">value</var>.</li>
+
+      </ol>
+
      </li>
 
      <li><p>If the character indicated by <var title="">position</var>
@@ -3582,7 +3608,7 @@
     the element</i>, as defined by the XML Base specification, with
     <i>the base URI of the document entity</i> being defined as the
     <span>document base URL</span> of the <code>Document</code> that
-    owns the element.</p>
+    owns the element. <a href="#refsXMLBASE">[XMLBASE]</a></p>
 
     <p>For the purposes of the XML Base specification, user agents
     must act as if all <code>Document</code> objects represented XML
@@ -5056,11 +5082,14 @@
   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 shortest possible string
-  representing the number as a <span>valid floating point
-  number</span> in base ten and then that string must be used as the
-  new content attribute value.</p>
+  the given value must be converted to the <span>best representation
+  of the floating point number</span> and then that string must be
+  used as the new content attribute value.</p>
 
+  <p class="note">The values &plusmn;Infinity and NaN throw an
+  exception on setting, as defined by WebIDL. <a
+  href="#refsWEBIDL">[WEBIDL]</a></p>
+
   <p>If a reflecting DOM attribute is of the type
   <code>DOMTokenList</code>, then on getting it must return a
   <code>DOMTokenList</code> object whose underlying string is the
@@ -29441,9 +29470,9 @@
   set the <span title="concept-fe-value">value</span> to a string that
   is not a <span>valid floating point number</span>. If the user agent
   provides a user interface for selecting a number, then the <span
-  title="concept-fe-value">value</span> must be set to a <span>valid
-  floating point number</span> representing the user's selection. User
-  agents should allow the user to set the <span
+  title="concept-fe-value">value</span> must be set to the <span>best
+  representation of the floating point number</span> representing the
+  user's selection. User agents should allow the user to set the <span
   title="concept-fe-value">value</span> to the empty string.</p>
 
   <p>The <code title="attr-input-value">value</code> attribute, if
@@ -29565,10 +29594,10 @@
   set the <span title="concept-fe-value">value</span> to a string that
   is not a <span>valid floating point number</span>. If the user agent
   provides a user interface for selecting a number, then the <span
-  title="concept-fe-value">value</span> must be set to a <span>valid
-  floating point number</span> representing the user's selection. User
-  agents must not allow the user to set the <span
-  title="concept-fe-value">value</span> to the empty string.</p>
+  title="concept-fe-value">value</span> must be set to a <span>best
+  representation of the floating point number</span> representing the
+  user's selection. User agents must not allow the user to set the
+  <span title="concept-fe-value">value</span> to the empty string.</p>
 
   <p>The <code title="attr-input-value">value</code> attribute, if
   specified, must have a value that is a <span>valid floating point

|