Skip to content

Commit

Permalink
[c] (0) Define authoring requirements for <meter> and <progress> in m…
Browse files Browse the repository at this point in the history
…ore detail; add v2 note for <credit>.

git-svn-id: http://svn.whatwg.org/webapps@2484 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Nov 30, 2008
1 parent 1040bdd commit 4729c36
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 31 deletions.
97 changes: 84 additions & 13 deletions index
Expand Up @@ -12626,7 +12626,7 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
have a value greater than zero. 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.</p>
attribute, if present, or 1, otherwise.</p>

<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
Expand Down Expand Up @@ -12795,19 +12795,90 @@ this specification: the &lt;abbr&gt;WHATWG&lt;/abbr&gt; and the
as two numbers (the higher number represents the maximum, the other
number the current value, and the minimum is assumed to be zero), or
as a percentage or similar (using one of the characters such as
"%"), or as a fraction.</p>
"%"), or as a fraction. However, it is also possible to use the
attributes to specify these values.</p>

<p>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>, <code title=attr-meter-low><a href=#attr-meter-low>low</a></code>, <code title=attr-meter-high><a href=#attr-meter-high>high</a></code>, <code title=attr-meter-max><a href=#attr-meter-max>max</a></code>, and <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</a></code> attributes are all
optional. When present, they must have values that are <a href=#valid-floating-point-number title="valid floating point number">valid floating point
numbers</a>, and their values must satisfy the following
inequalities:</p>
<p>One of the following conditions, along with all the requirements
that are listed with that condition, must be met:</p>

<ul class=brief><li><code title=attr-meter-min><a href=#attr-meter-min>min</a></code> &le; <code title=attr-meter-value><a href=#attr-meter-value>value</a></code> &le; <code title=attr-meter-max><a href=#attr-meter-max>max</a></code></li>
<li><code title=attr-meter-min><a href=#attr-meter-min>min</a></code> &le; <code title=attr-meter-low><a href=#attr-meter-low>low</a></code> &le; <code title=attr-meter-high><a href=#attr-meter-high>high</a></code> &le; <code title=attr-meter-max><a href=#attr-meter-max>max</a></code></li>
<li><code title=attr-meter-min><a href=#attr-meter-min>min</a></code> &le; <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</a></code> &le; <code title=attr-meter-max><a href=#attr-meter-max>max</a></code></li>
</ul><p>All <code><a href=#the-meter-element>meter</a></code> elements must have a value specified
somehow, either using the <code title=attr-meter-value><a href=#attr-meter-value>value</a></code> attribute or by including a
number in the contents of the element.</p>
<dl><dt>There are exactly two numbers 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>

<p>If specified, the <code title=attr-meter-low><a href=#attr-meter-low>low</a></code>,
<code title=attr-meter-high><a href=#attr-meter-high>high</a></code>, and <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</a></code> attributes must have
values greater than or equal to zero and less than or equal to the
bigger of the two numbers in the contents of the element.</p>

<p>If both the <code title=attr-meter-low><a href=#attr-meter-low>low</a></code> and <code title=attr-meter-high><a href=#attr-meter-high>high</a></code> attributes are specified, then
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>

</dd>

<dt>There is exactly one number 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> 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>

<p>If specified, the <code title=attr-meter-low><a href=#attr-meter-low>low</a></code>,
<code title=attr-meter-high><a href=#attr-meter-high>high</a></code>, and <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</a></code> attributes must have
values greater than or equal to zero and less than or equal to the
<a href=#values-associated-with-denominator-punctuation-characters title="values associated with denominator punctuation
characters">value associated with the denominator punctuation
character</a>.</p>

<p>If both the <code title=attr-meter-low><a href=#attr-meter-low>low</a></code> and <code title=attr-meter-high><a href=#attr-meter-high>high</a></code> attributes are specified, then
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>

</dd>

<dt>There is exactly one number in the contents of the element, and
the <code title=attr-meter-value><a href=#attr-meter-value>value</a></code> attribute is
omitted</dt>

<dt>There are no numbers in the contents of the element, and the
<code title=attr-meter-value><a href=#attr-meter-value>value</a></code> attribute is
specified.</dt>

<dd>

<p>If the <code title=attr-meter-min><a href=#attr-meter-min>min</a></code> attribute
attribute is specified, then the <var title="">minimum</var> is
that attribue's value; otherwise, it is 0.</p>

<p>If the <code title=attr-meter-max><a href=#attr-meter-max>max</a></code> attribute
attribute is specified, then the <var title="">maximum</var> is
that attribue'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>The following inequalities must hold, as applicable:</p>

<ul class=brief><li><var title="">minimum</var> &le; <var title="">value</var> &le; <var title="">maximum</var></li>
<li><var title="">minimum</var> &le; <code title=attr-meter-low><a href=#attr-meter-low>low</a></code> &le; <var title="">maximum</var> (if <code title=attr-meter-low><a href=#attr-meter-low>low</a></code> is specified)</li>
<li><var title="">minimum</var> &le; <code title=attr-meter-high><a href=#attr-meter-high>high</a></code> &le; <var title="">maximum</var> (if <code title=attr-meter-high><a href=#attr-meter-high>high</a></code> is specified)</li>
<li><var title="">minimum</var> &le; <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</a></code> &le; <var title="">maximum</var> (if <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</a></code> is specified)</li>
</ul><p>If both the <code title=attr-meter-low><a href=#attr-meter-low>low</a></code> and <code title=attr-meter-high><a href=#attr-meter-high>high</a></code> attributes are specified, then
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>

</dd>

</dl><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 with a single U+002E FULL STOP character
(.), and separated from other numbers by at least one character that
isn't any of those; interpreted as a base ten number.</p>

<p>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>, <code title=attr-meter-low><a href=#attr-meter-low>low</a></code>, <code title=attr-meter-high><a href=#attr-meter-high>high</a></code>, <code title=attr-meter-max><a href=#attr-meter-max>max</a></code>, and <code title=attr-meter-optimum><a href=#attr-meter-optimum>optimum</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>.</p>

<p class=note>If no minimum or maximum is specified, then the
range is assumed to be 0..1, and the value thus has to be within
Expand Down Expand Up @@ -14009,7 +14080,7 @@ brighter. A &lt;b&gt;rat&lt;/b&gt; scurries past the corner wall.&lt;/p&gt;</pre
<dd>None.</dd>
<dt>DOM interface:</dt>
<dd>Uses <code><a href=#htmlelement>HTMLElement</a></code>.</dd>
</dl><p>The <code><a href=#the-figure-element>figure</a></code> element represents some <a href=#flow-content-0>flow
</dl><!-- v2: Add a <credit> element for photo credits --><p>The <code><a href=#the-figure-element>figure</a></code> element represents some <a href=#flow-content-0>flow
content</a>, optionally with a caption, which can be moved away
from the main flow of the document without affecting the document's
meaning.</p>
Expand Down
125 changes: 107 additions & 18 deletions source
Expand Up @@ -13468,7 +13468,7 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the
title="attr-progress-value">value</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">max</code>
attribute, if present.</p>
attribute, if present, or 1, otherwise.</p>

<p class="note">The <code>progress</code> element is the wrong
element to use for something that is just a gauge, as opposed to
Expand Down Expand Up @@ -13655,29 +13655,116 @@ this specification: the &lt;abbr>WHATWG&lt;/abbr> and the
as two numbers (the higher number represents the maximum, the other
number the current value, and the minimum is assumed to be zero), or
as a percentage or similar (using one of the characters such as
"%"), or as a fraction.</p>
"%"), or as a fraction. However, it is also possible to use the
attributes to specify these values.</p>

<p>One of the following conditions, along with all the requirements
that are listed with that condition, must be met:</p>

<dl>

<dt>There are exactly two numbers in the contents of the element,
and the <code title="attr-meter-value">value</code>, <code
title="attr-meter-min">min</code>, and <code
title="attr-meter-max">max</code> attributes are all omitted</dt>

<dd>

<p>If specified, the <code title="attr-meter-low">low</code>,
<code title="attr-meter-high">high</code>, and <code
title="attr-meter-optimum">optimum</code> attributes must have
values greater than or equal to zero and less than or equal to the
bigger of the two numbers in the contents of the element.</p>

<p>If both the <code title="attr-meter-low">low</code> and <code
title="attr-meter-high">high</code> attributes are specified, then
the <code title="attr-meter-low">low</code> attribute's value must
be less than or equal to the value of the <code
title="attr-meter-high">high</code> attribute.</p>

</dd>

<dt>There is exactly one number followed by zero or more
<span>White_Space</span> characters and a <span>valid denominator
punctuation character</span> in the contents of the element, and
the <code title="attr-meter-value">value</code>, <code
title="attr-meter-min">min</code>, and <code
title="attr-meter-max">max</code> attributes are all omitted</dt>

<dd>

<p>If specified, the <code title="attr-meter-low">low</code>,
<code title="attr-meter-high">high</code>, and <code
title="attr-meter-optimum">optimum</code> attributes must have
values greater than or equal to zero and less than or equal to the
<span title="values associated with denominator punctuation
characters">value associated with the denominator punctuation
character</span>.</p>

<p>If both the <code title="attr-meter-low">low</code> and <code
title="attr-meter-high">high</code> attributes are specified, then
the <code title="attr-meter-low">low</code> attribute's value must
be less than or equal to the value of the <code
title="attr-meter-high">high</code> attribute.</p>

</dd>

<dt>There is exactly one number in the contents of the element, and
the <code title="attr-meter-value">value</code> attribute is
omitted</dt>

<dt>There are no numbers in the contents of the element, and the
<code title="attr-meter-value">value</code> attribute is
specified.</dt>

<dd>

<p>If the <code title="attr-meter-min">min</code> attribute
attribute is specified, then the <var title="">minimum</var> is
that attribue's value; otherwise, it is 0.</p>

<p>If the <code title="attr-meter-max">max</code> attribute
attribute is specified, then the <var title="">maximum</var> is
that attribue'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">value</code> attribute.</p>

<p>The following inequalities must hold, as applicable:</p>

<ul class="brief">
<li><var title="">minimum</var> &le; <var title="">value</var> &le; <var title="">maximum</var></li>
<li><var title="">minimum</var> &le; <code title="attr-meter-low">low</code> &le; <var title="">maximum</var> (if <code title="attr-meter-low">low</code> is specified)</li>
<li><var title="">minimum</var> &le; <code title="attr-meter-high">high</code> &le; <var title="">maximum</var> (if <code title="attr-meter-high">high</code> is specified)</li>
<li><var title="">minimum</var> &le; <code title="attr-meter-optimum">optimum</code> &le; <var title="">maximum</var> (if <code title="attr-meter-optimum">optimum</code> is specified)</li>
</ul>

<p>If both the <code title="attr-meter-low">low</code> and <code
title="attr-meter-high">high</code> attributes are specified, then
the <code title="attr-meter-low">low</code> attribute's value must
be less than or equal to the value of the <code
title="attr-meter-high">high</code> attribute.</p>

</dd>

</dl>

<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 with a single U+002E FULL STOP character
(.), and separated from other numbers by at least one character that
isn't any of those; interpreted as a base ten number.</p>

<p>The <code title="attr-meter-value">value</code>, <code
title="attr-meter-min">min</code>, <code
title="attr-meter-low">low</code>, <code
title="attr-meter-high">high</code>, <code
title="attr-meter-max">max</code>, and <code
title="attr-meter-optimum">optimum</code> attributes are all
optional. When present, they must have values that are <span
title="valid floating point number">valid floating point
numbers</span>, and their values must satisfy the following
inequalities:</p>

<ul class="brief">
<li><code title="attr-meter-min">min</code> &le; <code title="attr-meter-value">value</code> &le; <code title="attr-meter-max">max</code></li>
<li><code title="attr-meter-min">min</code> &le; <code title="attr-meter-low">low</code> &le; <code title="attr-meter-high">high</code> &le; <code title="attr-meter-max">max</code></li>
<li><code title="attr-meter-min">min</code> &le; <code title="attr-meter-optimum">optimum</code> &le; <code title="attr-meter-max">max</code></li>
</ul>

<p>All <code>meter</code> elements must have a value specified
somehow, either using the <code
title="attr-meter-value">value</code> attribute or by including a
number in the contents of the element.</p>
title="attr-meter-optimum">optimum</code> attributes, when present,
must have values that are <span title="valid floating point
number">valid floating point numbers</span>.</p>

<p class="note">If no minimum or maximum is specified, then the
range is assumed to be 0..1, and the value thus has to be within
Expand Down Expand Up @@ -14964,6 +15051,8 @@ brighter. A &lt;b>rat&lt;/b> scurries past the corner wall.&lt;/p></pre>
<dd>Uses <code>HTMLElement</code>.</dd>
</dl>

<!-- v2: Add a <credit> element for photo credits -->

<p>The <code>figure</code> element represents some <span>flow
content</span>, optionally with a caption, which can be moved away
from the main flow of the document without affecting the document's
Expand Down

0 comments on commit 4729c36

Please sign in to comment.