hixie: Update the requirements on <meter> and <progress> contents to fix reported problems. (whatwg r4163)

hixie: Update the requirements on <meter> and <progress> contents to fix
reported problems. (whatwg r4163)

http://dev.w3.org/cvsweb/html5/spec/Overview.html?r1=1.3309&r2=1.3310&f=h
http://html5.org/tools/web-apps-tracker?from=4162&to=4163

===================================================================
RCS file: /sources/public/html5/spec/Overview.html,v
retrieving revision 1.3309
retrieving revision 1.3310
diff -u -d -r1.3309 -r1.3310
--- Overview.html 18 Oct 2009 08:13:02 -0000 1.3309
+++ Overview.html 18 Oct 2009 09:07:09 -0000 1.3310
@@ -2668,10 +2668,10 @@
    DIGIT NINE (9), and assign this string of one or more characters to
    <var title="">string</var>.</li>
 
-   <li>If <var title="">string</var> consists of just a single U+002E
-   FULL STOP character or if it contains more than one U+002E FULL
-   STOP character then return an error condition and abort these
-   steps.</li>
+   <li>If the first character of <var title="">string</var> is a
+   U+002E FULL STOP character, or if <var title="">string</var>
+   contains more than one U+002E FULL STOP character, then return an
+   error condition and abort these steps.</li>
 
    <li>Parse <var title="">string</var> according to the <a href="#rules-for-parsing-floating-point-number-values">rules
    for parsing floating point number values</a>, to obtain <var title="">number</var>. This step cannot fail (<var title="">string</var> is guaranteed to be a <a href="#valid-floating-point-number">valid floating
@@ -14853,13 +14853,65 @@
    be called by some other code on the page to update the actual
    progress bar as the task progressed.)</p>
   </div><p><span class="impl"><strong>Author requirements</strong>:</span>
-  The <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> and <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attributes, when present,
-  must have values that are <a href="#valid-floating-point-number" title="valid floating point
-  number">valid floating point numbers</a>. The <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute, if present, must
-  have a value greater than zero. The <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute, if present, must
+  The <code><a href="#the-progress-element">progress</a></code> element must match one of the following
+  conditions.<ul><li>Neither the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code>
+   attribute nor the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>
+   attribute is specified, and the element's contents
+   contain no numbers.</li>
+
+   <li>Neither the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code>
+   attribute nor the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>
+   attribute is specified, and the element's contents contain one
+   number, optionally followed by a <a href="#valid-denominator-punctuation-character" title="valid denominator
+   punctuation character">denominator punctuation
+   character</a>.</li>
+
+   <li>Neither the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code>
+   attribute nor the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>
+   attribute is specified, and the element's contents contain two
+   numbers, neither followed by a <a href="#valid-denominator-punctuation-character" title="valid denominator
+   punctuation character">denominator punctuation
+   character</a>.</li>
+
+   <li>The <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute is
+   not specified but the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>
+   attribute is specified, and the element's contents
+   contain one number that is not followed by a <a href="#valid-denominator-punctuation-character" title="valid
+   denominator punctuation character">denominator punctuation
+   character</a>.</li>
+
+   <li>The <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute
+   and the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute are
+   both specified. (The contents of the element are ignored.)</li>
+
+  </ul><p>For the purposes of these requirements, a number is a sequence of
+  characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE
+  (9), optionally including a single U+002E FULL STOP character (.) in
+  some position after the first digit, interpreted as a base ten
+  number. Numbers must be separated from other numbers by at least one
+  character that isn't any of the aforementioned. In addition, if the
+  element is required to contain numbers, then the contents of the
+  element must not contain any U+002E FULL STOP characters (.) that
+  aren't part of numbers.<p>A number if said to be followed by a <a href="#valid-denominator-punctuation-character" title="valid
+  denominator punctuation character">denominator punctuation
+  character</a> if it is followed by zero or more
+  <a href="#white_space">White_Space</a> characters and a <a href="#valid-denominator-punctuation-character">valid denominator
+  punctuation character</a>.<p>The contents of the element consist of the concatenation of
+  the <a href="#text-node" title="text node">text nodes</a> of all the descendants
+  of the element, in <a href="#tree-order">tree order</a>.<p>The <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> and <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attributes, when present, must
+  have values that are <a href="#valid-floating-point-number" title="valid floating point number">valid
+  floating point numbers</a>. The <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute, if present, must
   have a value equal to or greater than zero, and less than or equal
   to the value of the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code>
-  attribute, if present, or 1, otherwise.<p class="note">The <code><a href="#the-progress-element">progress</a></code> element is the wrong
+  attribute, if present, or 1.0, otherwise. If the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute is not present,
+  but the element's contents contain a number, then the value of the
+  first number in the element's contents must be less than or equal to
+  the value of the second number in the element's contents, if any, or
+  the <a href="#values-associated-with-denominator-punctuation-characters" title="values associated with denominator punctuation
+  characters">value associated with the denominator punctuation
+  character</a> that follows the first number in the element's
+  contents, if any, or 1.0, otherwise. The <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute, if present, must
+  have a value greater than zero.<p class="note">The <code><a href="#the-progress-element">progress</a></code> element is the wrong
   element to use for something that is just a gauge, as opposed to
   task progress. For instance, indicating disk space usage using
   <code><a href="#the-progress-element">progress</a></code> would be inappropriate. Instead, the
@@ -14875,7 +14927,8 @@
   <code>textContent</code> of the <code><a href="#the-progress-element">progress</a></code> element in
   question using the <a href="#steps-for-finding-one-or-two-numbers-of-a-ratio-in-a-string">steps for finding one or two numbers of a
   ratio in a string</a>. These steps will return nothing, one
-  number, one number with a denominator punctuation character, or two
+  number, one number with a <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+  character">denominator punctuation character</a>, or two
   numbers.</p>
 
   <p>Using the results of this processing, user agents must determine
@@ -14903,8 +14956,8 @@
 
    <li>Otherwise, if neither attribute is included, then, if the
    <code>textContent</code> contained one number with an associated
-   denominator punctuation character, then the maximum value is the
-   <a href="#values-associated-with-denominator-punctuation-characters" title="values associated with denominator punctuation
+   <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation character">denominator
+   punctuation character</a>, then the maximum value is the <a href="#values-associated-with-denominator-punctuation-characters" title="values associated with denominator punctuation
    characters">value associated with that denominator punctuation
    character</a>; otherwise, if the <code>textContent</code>
    contained two numbers, the maximum value is the higher of the two
@@ -14919,7 +14972,8 @@
    <li>Otherwise if the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code>
    attribute is absent and the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute is present, then, if
    the <code>textContent</code> was parsed and found to contain just
-   one number, with no associated denominator punctuation character,
+   one number, with no associated <a href="#valid-denominator-punctuation-character" title="valid denominator
+   punctuation character">denominator punctuation character</a>,
    then the current value is that number. Otherwise, if the <code title="attr-progress-value"><a href="#attr-progress-value">value</a></code> attribute is absent and
    the <code title="attr-progress-max"><a href="#attr-progress-max">max</a></code> attribute is present
    then the current value is zero.</li>
@@ -15036,12 +15090,14 @@
     be less than or equal to the value of the <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code> attribute.</p>
 
     <p>The numbers in the contents of the element must not be followed
-    by denomination punctuation characters.</p>
+    by a <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+    character">denominator punctuation character</a>.</p>
 
    </dd>
 
-   <dt>There is exactly one number followed by a denomination
-   punctuation character in the contents of the element, and the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code>, <code title="attr-meter-min"><a href="#attr-meter-min">min</a></code>, and <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code> attributes are all omitted</dt>
+   <dt>There is exactly one number followed by a <a href="#valid-denominator-punctuation-character" title="valid
+   denominator punctuation character">denominator punctuation
+   character</a> in the contents of the element, and the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code>, <code title="attr-meter-min"><a href="#attr-meter-min">min</a></code>, and <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code> attributes are all omitted</dt>
 
    <dd>
 
@@ -15079,8 +15135,10 @@
     attribute is specified, then the <var title="">maximum</var> is
     that attribute's value; otherwise, it is 1.</p>
 
-    <p>If there is exactly one number in the contents of the element,
-    then <var title="">value</var> is that number; otherwise, <var title="">value</var> is the value of the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attribute.</p>
+    <p>If the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attribute is
+    specified, then the <var title="">value</var> is that attribute's
+    number; otherwise, there is exactly one number in the contents of
+    the element, and the <var title="">value</var> is that number.</p>
 
     <p>The following inequalities must hold, as applicable:</p>
 
@@ -15092,8 +15150,12 @@
     the <code title="attr-meter-low"><a href="#attr-meter-low">low</a></code> attribute's value must
     be less than or equal to the value of the <code title="attr-meter-high"><a href="#attr-meter-high">high</a></code> attribute.</p>
 
-    <p>If there is a number in the contents of the element, it must
-    not be followed by a denominator punctuation character.</p>
+    <p>If the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attribute is
+    not specified, the number in the contents of the element must not
+    be followed by a <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+    character">denominator punctuation character</a>. (Otherwise,
+    there is no restriction on what numbers can be in the contents of
+    the element.)</p>
 
    </dd>
 
@@ -15102,9 +15164,10 @@
   (9), optionally including a single U+002E FULL STOP character (.) in
   some position after the first digit, interpreted as a base ten
   number. Numbers must be separated from other numbers by at least one
-  character that isn't any of the aforementioned. In addition, the
-  contents of the element must not contain any U+002E FULL STOP
-  characters (.) that aren't part of numbers.<p>A number if said to be followed by a <a href="#valid-denominator-punctuation-character" title="valid
+  character that isn't any of the aforementioned. In addition, if the
+  element is required to contain numbers, then the contents of the
+  element must not contain any U+002E FULL STOP characters (.) that
+  aren't part of numbers.<p>A number if said to be followed by a <a href="#valid-denominator-punctuation-character" title="valid
   denominator punctuation character">denominator punctuation
   character</a> if it is followed by zero or more
   <a href="#white_space">White_Space</a> characters and a <a href="#valid-denominator-punctuation-character">valid denominator
@@ -15166,8 +15229,8 @@
   been omitted, the user agent must also process the
   <code>textContent</code> of the element according to the <a href="#steps-for-finding-one-or-two-numbers-of-a-ratio-in-a-string">steps
   for finding one or two numbers of a ratio in a string</a>. These
-  steps will return nothing, one number, one number with a denominator
-  punctuation character, or two numbers.</p>
+  steps will return nothing, one number, one number with a <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation character">denominator
+  punctuation character</a>, or two numbers.</p>
 
   <p>User agents must then use all these numbers to obtain values for
   six points on the gauge, as follows. (The order in which these are
@@ -15199,14 +15262,16 @@
     <code title="attr-meter-min"><a href="#attr-meter-min">min</a></code>, and <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code> attributes were
     specified. If the result of processing the
     <code>textContent</code> of the element was either nothing or just
-    one number with no denominator punctuation character, then the
+    one number with no <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+    character">denominator punctuation character</a>, then the
     maximum value is 1; if the result was one number but it had an
-    associated denominator punctuation character, then the maximum
-    value is the <a href="#values-associated-with-denominator-punctuation-characters" title="values associated with denominator
-    punctuation characters">value associated with that denominator
-    punctuation character</a>; and finally, if there were two
-    numbers parsed out of the <code>textContent</code>, then the
-    maximum is the higher of those two numbers.</p>
+    associated <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+    character">denominator punctuation character</a>, then the
+    maximum value is the <a href="#values-associated-with-denominator-punctuation-characters" title="values associated with
+    denominator punctuation characters">value associated with that
+    denominator punctuation character</a>; and finally, if there
+    were two numbers parsed out of the <code>textContent</code>, then
+    the maximum is the higher of those two numbers.</p>
 
     <p>If the above machinations result in a maximum value less than
     the minimum value, then the maximum value is actually the same as
@@ -15226,15 +15291,17 @@
     not specified but the <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code>
     attribute <em>is</em> specified and the result of processing the
     <code>textContent</code> of the element was one number with no
-    associated denominator punctuation character, then that number is
-    the actual value.</p>
+    associated <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+    character">denominator punctuation character</a>, then that
+    number is the actual value.</p>
 
     <p>If neither of the <code title="attr-meter-value"><a href="#attr-meter-value">value</a></code>
     and <code title="attr-meter-max"><a href="#attr-meter-max">max</a></code> attributes are
     specified, then, if the result of processing the
     <code>textContent</code> of the element was one number (with or
-    without an associated denominator punctuation character), then
-    that is the actual value, and if the result of processing the
+    without an associated <a href="#valid-denominator-punctuation-character" title="valid denominator punctuation
+    character">denominator punctuation character</a>), then that is
+    the actual value, and if the result of processing the
     <code>textContent</code> of the element was two numbers, then the
     actual value is the lower of the two numbers found.</p>

Received on Sunday, 18 October 2009 09:07:59 UTC