Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[acgiow] (1) Allow omission of the number before the period in a floa…
…ting point number.

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

git-svn-id: http://svn.whatwg.org/webapps@6635 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Oct 5, 2011
1 parent fb88781 commit b13c08b
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 36 deletions.
32 changes: 20 additions & 12 deletions complete.html
Expand Up @@ -4700,15 +4700,19 @@ <h5 id=floating-point-numbers><span class=secno>2.5.4.3 </span>Floating-point nu

<ol class=brief><li>Optionally, a U+002D HYPHEN-MINUS character (-).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>
<li>One or both of the following, in the given order:

<li>Optionally:
<ol><li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

<ol><li>A single U+002E FULL STOP character (.).</li>
<li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>
<ol><li>A single U+002E FULL STOP character (.).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

</ol></li>

</ol></li>

Expand Down Expand Up @@ -4798,23 +4802,27 @@ <h5 id=floating-point-numbers><span class=secno>2.5.4.3 </span>Floating-point nu

</ol></li>

<li><p>If the character indicated by <var title="">position</var>
is a U+002E FULL STOP (.), and that is not the last character in
<var title="">input</var>, and the character after the character
indicated by <var title="">position</var> is one of U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9), then set <var title="">value</var> to zero and jump to the step labeled
<i>fraction</i>.</p> <!-- we have to check there's a number so that
".e1" fails to parse but ".0" does not -->

<li><p>If the character indicated by <var title="">position</var>
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
return an error.</li>

<!-- Ok. At this point we know we have a number. It might have
trailing garbage which we'll ignore, but it's a number, and we
won't return an error unless it's out of range. -->

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
resulting sequence as a base-ten integer. Multiply <var title="">value</var> by that integer.</li>

<li>If <var title="">position</var> is past the end of <var title="">input</var>, jump to the step labeled
<i>conversion</i>.</li>

<li><p>If the character indicated by <var title="">position</var>
is a U+002E FULL STOP (.), run these substeps:</p>
<li><p><i>Fraction</i>: If the character indicated by <var title="">position</var> is a U+002E FULL STOP (.), run these
substeps:</p>

<ol><li><p>Advance <var title="">position</var> to the next
character.</li>
Expand Down
32 changes: 20 additions & 12 deletions index
Expand Up @@ -4700,15 +4700,19 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<ol class=brief><li>Optionally, a U+002D HYPHEN-MINUS character (-).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>
<li>One or both of the following, in the given order:

<li>Optionally:
<ol><li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

<ol><li>A single U+002E FULL STOP character (.).</li>
<li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>
<ol><li>A single U+002E FULL STOP character (.).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

</ol></li>

</ol></li>

Expand Down Expand Up @@ -4798,23 +4802,27 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

</ol></li>

<li><p>If the character indicated by <var title="">position</var>
is a U+002E FULL STOP (.), and that is not the last character in
<var title="">input</var>, and the character after the character
indicated by <var title="">position</var> is one of U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9), then set <var title="">value</var> to zero and jump to the step labeled
<i>fraction</i>.</p> <!-- we have to check there's a number so that
".e1" fails to parse but ".0" does not -->

<li><p>If the character indicated by <var title="">position</var>
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
return an error.</li>

<!-- Ok. At this point we know we have a number. It might have
trailing garbage which we'll ignore, but it's a number, and we
won't return an error unless it's out of range. -->

<li><p><a href=#collect-a-sequence-of-characters>Collect a sequence of characters</a> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
resulting sequence as a base-ten integer. Multiply <var title="">value</var> by that integer.</li>

<li>If <var title="">position</var> is past the end of <var title="">input</var>, jump to the step labeled
<i>conversion</i>.</li>

<li><p>If the character indicated by <var title="">position</var>
is a U+002E FULL STOP (.), run these substeps:</p>
<li><p><i>Fraction</i>: If the character indicated by <var title="">position</var> is a U+002E FULL STOP (.), run these
substeps:</p>

<ol><li><p>Advance <var title="">position</var> to the next
character.</li>
Expand Down
38 changes: 26 additions & 12 deletions source
Expand Up @@ -3811,18 +3811,26 @@ is conforming depends on which specs apply, and leaves it at that. -->

<li>Optionally, a U+002D HYPHEN-MINUS character (-).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

<li>Optionally:
<li>One or both of the following, in the given order:

<ol>

<li>A single U+002E FULL STOP character (.).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

<li>

<ol>

<li>A single U+002E FULL STOP character (.).</li>

<li>A series of one or more characters in the range U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9).</li>

</ol>

</li>

</ol>

</li>
Expand Down Expand Up @@ -3937,14 +3945,19 @@ is conforming depends on which specs apply, and leaves it at that. -->

</li>

<li><p>If the character indicated by <var title="">position</var>
is a U+002E FULL STOP (.), and that is not the last character in
<var title="">input</var>, and the character after the character
indicated by <var title="">position</var> is one of U+0030 DIGIT
ZERO (0) to U+0039 DIGIT NINE (9), then set <var
title="">value</var> to zero and jump to the step labeled
<i>fraction</i>.</p> <!-- we have to check there's a number so that
".e1" fails to parse but ".0" does not -->

<li><p>If the character indicated by <var title="">position</var>
is not one of U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), then
return an error.</p></li>

<!-- Ok. At this point we know we have a number. It might have
trailing garbage which we'll ignore, but it's a number, and we
won't return an error unless it's out of range. -->

<li><p><span>Collect a sequence of characters</span> in the range
U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), and interpret the
resulting sequence as a base-ten integer. Multiply <var
Expand All @@ -3954,8 +3967,9 @@ is conforming depends on which specs apply, and leaves it at that. -->
title="">input</var>, jump to the step labeled
<i>conversion</i>.</li>

<li><p>If the character indicated by <var title="">position</var>
is a U+002E FULL STOP (.), run these substeps:</p>
<li><p><i>Fraction</i>: If the character indicated by <var
title="">position</var> is a U+002E FULL STOP (.), run these
substeps:</p>

<ol>

Expand Down

0 comments on commit b13c08b

Please sign in to comment.