- From: poot <cvsmail@w3.org>
- Date: Thu, 20 Oct 2011 18:17:55 -0400
- To: public-html-diffs@w3.org
hixie: Simplification in the microsyntax parsing rules, which makes non-
negative integers accept leading - and + characters (- only for -0 of
course). (whatwg r6717)
http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.5384&r2=1.5385&f=h
http://html5.org/tools/web-apps-tracker?from=6716&to=6717
===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.5384
retrieving revision 1.5385
diff -u -d -r1.5384 -r1.5385
--- Overview.html 20 Oct 2011 21:47:32 -0000 1.5384
+++ Overview.html 20 Oct 2011 22:17:32 -0000 1.5385
@@ -527,8 +527,8 @@
<li><a href="#keywords-and-enumerated-attributes"><span class="secno">2.5.3 </span>Keywords and enumerated attributes</a></li>
<li><a href="#numbers"><span class="secno">2.5.4 </span>Numbers</a>
<ol>
- <li><a href="#non-negative-integers"><span class="secno">2.5.4.1 </span>Non-negative integers</a></li>
- <li><a href="#signed-integers"><span class="secno">2.5.4.2 </span>Signed integers</a></li>
+ <li><a href="#signed-integers"><span class="secno">2.5.4.1 </span>Signed integers</a></li>
+ <li><a href="#non-negative-integers"><span class="secno">2.5.4.2 </span>Non-negative integers</a></li>
<li><a href="#floating-point-numbers"><span class="secno">2.5.4.3 </span>Floating-point numbers</a></li>
<li><a href="#percentages-and-dimensions"><span class="secno">2.5.4.4 </span>Percentages and lengths</a></li>
<li><a href="#lists-of-integers"><span class="secno">2.5.4.5 </span>Lists of integers</a></li>
@@ -3809,44 +3809,7 @@
be ignored.<p>When the attribute is <em>not</em> specified, if there is a
<i>missing value default</i> state defined, then that is the state
represented by the (missing) attribute. Otherwise, the absence of
- the attribute means that there is no state represented.<p class="note">The empty string can be a valid keyword.<h4 id="numbers"><span class="secno">2.5.4 </span>Numbers</h4><h5 id="non-negative-integers"><span class="secno">2.5.4.1 </span>Non-negative integers</h5><p>A string is a <dfn id="valid-non-negative-integer">valid non-negative integer</dfn> if it
- consists of one or more characters in the range U+0030 DIGIT ZERO
- (0) to U+0039 DIGIT NINE (9).<p>A <a href="#valid-non-negative-integer">valid non-negative integer</a> represents the number
- that is represented in base ten by that string of digits.<div class="impl">
-
- <p>The <dfn id="rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</dfn> are as
- given in the following algorithm. When invoked, the steps must be
- followed in the order given, aborting at the first step that returns
- a value. This algorithm will return either zero, a positive integer,
- or an error.</p>
-
- <ol><li><p>Let <var title="">input</var> be the string being
- parsed.</li>
-
- <li><p>Let <var title="">position</var> be a pointer into <var title="">input</var>, initially pointing at the start of the
- string.</li>
-
- <li><p><a href="#skip-whitespace">Skip whitespace</a>.</li>
-
- <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
-
- <li><p>If the character indicated by <var title="">position</var>
- is a U+002B PLUS SIGN character (+), advance <var title="">position</var> to the next character. (The "<code title="">+</code>" is ignored, but it is not conforming.)</li>
-
- <li><p>If <var title="">position</var> is past the end of <var title="">input</var>, return an error.</li>
-
- <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>
-
-
- <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. Let <var title="">value</var> be that integer.</li>
-
- <li><p>Return <var title="">value</var>.</li>
-
- </ol></div><h5 id="signed-integers"><span class="secno">2.5.4.2 </span>Signed integers</h5><p>A string is a <dfn id="valid-integer">valid integer</dfn> if it consists of one or
+ the attribute means that there is no state represented.<p class="note">The empty string can be a valid keyword.<h4 id="numbers"><span class="secno">2.5.4 </span>Numbers</h4><h5 id="signed-integers"><span class="secno">2.5.4.1 </span>Signed integers</h5><p>A string is a <dfn id="valid-integer">valid integer</dfn> if it consists of one or
more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT
NINE (9), optionally prefixed with a U+002D HYPHEN-MINUS character
(-).<p>A <a href="#valid-integer">valid integer</a> without a U+002D HYPHEN-MINUS (-)
@@ -3856,11 +3819,9 @@
base ten by the string of digits that follows the U+002D
HYPHEN-MINUS, subtracted from zero.<div class="impl">
- <p>The <dfn id="rules-for-parsing-integers">rules for parsing integers</dfn> are similar to the
- <a href="#rules-for-parsing-non-negative-integers" title="rules for parsing non-negative integers">rules for
- non-negative integers</a>, and are as given in the following
- algorithm. When invoked, the steps must be followed in the order
- given, aborting at the first step that returns a value. This
+ <p>The <dfn id="rules-for-parsing-integers">rules for parsing integers</dfn> are as given in the
+ following algorithm. When invoked, the steps must be followed in the
+ order given, aborting at the first step that returns a value. This
algorithm will return either an integer or an error.</p>
<ol><li><p>Let <var title="">input</var> be the string being
@@ -3911,6 +3872,31 @@
<li><p>If <var title="">sign</var> is "positive", return <var title="">value</var>, otherwise return the result of subtracting
<var title="">value</var> from zero.</li>
+ </ol></div><h5 id="non-negative-integers"><span class="secno">2.5.4.2 </span>Non-negative integers</h5><p>A string is a <dfn id="valid-non-negative-integer">valid non-negative integer</dfn> if it
+ consists of one or more characters in the range U+0030 DIGIT ZERO
+ (0) to U+0039 DIGIT NINE (9).<p>A <a href="#valid-non-negative-integer">valid non-negative integer</a> represents the number
+ that is represented in base ten by that string of digits.<div class="impl">
+
+ <p>The <dfn id="rules-for-parsing-non-negative-integers">rules for parsing non-negative integers</dfn> are as
+ given in the following algorithm. When invoked, the steps must be
+ followed in the order given, aborting at the first step that returns
+ a value. This algorithm will return either zero, a positive integer,
+ or an error.</p>
+
+ <ol><li><p>Let <var title="">input</var> be the string being
+ parsed.</li>
+
+ <li><p>Let <var title="">value</var> be the result of parsing <var title="">input</var> using the <a href="#rules-for-parsing-integers">rules for parsing
+ integers</a>.</li>
+
+ <li><p>If <var title="">value</var> is an error, return an
+ error.</li>
+
+ <li><p>If <var title="">value</var> is less than zero, return an
+ error.</li>
+
+ <li><p>Return <var title="">value</var>.</li>
+
</ol></div><h5 id="floating-point-numbers"><span class="secno">2.5.4.3 </span>Floating-point numbers</h5><p>A string is a <dfn id="valid-floating-point-number">valid floating point number</dfn> if it
consists of:<ol class="brief"><li>Optionally, a U+002D HYPHEN-MINUS character (-).</li>
Received on Thursday, 20 October 2011 22:18:02 UTC