W3C home > Mailing lists > Public > public-css-commits@w3.org > December 2011

csswg/css3-lists Overview.html,1.121,1.122 Overview.src.html,1.168,1.169

From: Tab Atkins Jr.. via cvs-syncmail <cvsmail@w3.org>
Date: Tue, 06 Dec 2011 18:18:55 +0000
To: public-css-commits@w3.org
Message-Id: <E1RXzbT-000835-RJ@lionel-hutz.w3.org>
Update of /sources/public/csswg/css3-lists
In directory hutz:/tmp/cvs-serv30921

Modified Files:
	Overview.html Overview.src.html 
Log Message:
Fixed the way I handled negative counter values to be specific to the type.

Index: Overview.html
===================================================================
RCS file: /sources/public/csswg/css3-lists/Overview.html,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- Overview.html	5 Dec 2011 23:41:39 -0000	1.121
+++ Overview.html	6 Dec 2011 18:18:53 -0000	1.122
@@ -25,13 +25,13 @@
 
    <h1>CSS Lists and Counters Module Level 3</h1>
 
-   <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 5 December
+   <h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 6 December
     2011</h2>
 
    <dl>
     <dt>This version:
 
-    <dd><!--<a href="http://www.w3.org/TR/2011/WD-css3-lists-20111205">http://www.w3.org/TR/2011/WD-css3-lists-20111205</a></dd>-->
+    <dd><!--<a href="http://www.w3.org/TR/2011/WD-css3-lists-20111206">http://www.w3.org/TR/2011/WD-css3-lists-20111206</a></dd>-->
      <a
      href="http://dev.w3.org/csswg/css3-lists/">http://dev.w3.org/csswg/css3-lists/</a>
 
@@ -1436,10 +1436,6 @@
     title=generate-a-counter>generate a counter representation</i> using the
     counter style's fallback style and the same counter value.
 
-   <li>If the counter value is negative, set the <a
-    href="#descdef-negative"><var>negative</var></a> flag and run the rest of
-    this algorithm with the counter value set to its absolute value instead.
-
    <li>Using the counter value and the <a href="#algorithm"><i
     title=counter-algorithm>counter algorithm</i></a> for the counter style,
     generate an initial representation for the counter value.
@@ -1601,6 +1597,10 @@
    <li>If <var>value</var> is 0, append <var>symbol(0)</var> to <var>S</var>
     and return <var>S</var>.
 
+   <li>If <var>value</var> is negative, run the next step of this algorithm
+    with <var>value</var> being the absolute value of <var>value</var>
+    instead.
+
    <li>While <var>value</var> is not equal to 0:
     <ol>
      <li>Prepend <var>symbol( <var>value</var> mod <var>length</var> )</var>
@@ -1610,6 +1610,11 @@
       <var>length</var> )</code>.
     </ol>
 
+   <li>If <var>value</var> was originally negative, wrap <var>S</var> in the
+    counter style's <a href="#negative-sign"><i
+    title=counter-negative>negative sign</i></a>, as specified in the section
+    for the <a href="#counter-style-negative">negative descriptor</a>.
+
    <li>Return <var>S</var>.
   </ol>
 
@@ -1640,7 +1645,8 @@
   <p>If the type is <a href="#alphabetic">alphabetic</a>, the &lsquo;<a
    href="#descdef-symbols"><code class=property>symbols</code></a>&rsquo;
    descriptor must contain at least two <a href="#counter-symbol"><i>counter
-   symbol</i></a>s. This type is defined only over positive counter values.
+   symbol</i></a>s. This type is defined only over strictly positive counter
+   values.
 
   <p>The <i>alphabetic</i> counter type interprets the list of <i>counter
    symbols</i> as digits to an <em>alphabetic</em> numbering system, similar
@@ -1748,7 +1754,8 @@
   <p>If the type is <a href="#symbolic">symbolic</a>, the &lsquo;<a
    href="#descdef-symbols"><code class=property>symbols</code></a>&rsquo;
    descriptor must contain at least one <a href="#counter-symbol"><i>counter
-   symbol</i></a>. This type is defined only over positive counter values.
+   symbol</i></a>. This type is defined only over strictly positive counter
+   values.
 
   <p>The <i>symbolic</i> counter type cycles repeatedly through its provided
    symbols, doubling, tripling, etc. the symbols on each successive pass
@@ -1892,8 +1899,8 @@
    href="#descdef-additive-symbols"><code
    class=property>additive-symbols</code></a>&rsquo; descriptor must contain
    at least one <a href="#additive-tuple"><i>additive tuple</i></a>. This
-   type is nominally defined over all positive counter values (see algorithm,
-   below, for exact details)
+   type is nominally defined over all counter values (see algorithm, below,
+   for exact details)
 
   <p>The <i>additive</i> counter type takes as many of the largest symbols
    that it can, then as many of the next largest symbol, etc. until the sum
@@ -1902,39 +1909,51 @@
    of several languages which use different characters for the digits in
    differnt positions.
 
-  <p>To construct the representation, run this algorithm. let
+  <p>To construct the representation, run this algorithm. Let
    <var>value</var> initially be the counter value, <var>S</var> initially be
    the empty string, and <var>symbol list</var> initially be the list of <a
    href="#additive-tuple"><i>additive tuple</i></a>s.
 
-  <p>If <var>value</var> is initially 0, and there is an <a
-   href="#additive-tuple"><i>additive tuple</i></a> with a weight of 0,
-   append that tuple's <a href="#counter-symbol"><i>counter symbol</i></a> to
-   S and return S.
+  <ol>
+   <li>If <var>value</var> is initially 0, and there is an <a
+    href="#additive-tuple"><i>additive tuple</i></a> with a weight of 0,
+    append that tuple's <a href="#counter-symbol"><i>counter symbol</i></a>
+    to S and return S.
 
-  <p>Otherwise, while <var>value</var> is greater than 0 and there are
-   elements left in the <var>symbol list</var>:
+   <li>If <var>value</var> is negative, run the next step of this algorithm
+    with <var>value</var> being the absolute value of <var>value</var>
+    instead.
 
-  <ol>
-   <li>Pop the first <a href="#additive-tuple"><i>additive tuple</i></a> from
-    the <var>symbol list</var>. This is the <dfn id=current-tuple
-    title="current tuple|current tuple's">current tuple</dfn>.
+   <li>While <var>value</var> is greater than 0 and there are elements left
+    in the <var>symbol list</var>:
+    <ol>
+     <li>Pop the first <a href="#additive-tuple"><i>additive tuple</i></a>
+      from the <var>symbol list</var>. This is the <dfn id=current-tuple
+      title="current tuple|current tuple's">current tuple</dfn>.
 
-   <li>Append the <a href="#current-tuple"><i>current
-    tuple</i></a>&lsquo;<code class=css>s <a
-    href="#counter-symbol"><i>counter symbol</i></a> to <var>S</var>
-    <code>floor( <var>value</var> / <a href="#current-tuple"><var><i>current
-    tuple</i></var></a></code>&rsquo;s weight )</code> times (this may be 0).
+     <li>Append the <a href="#current-tuple"><i>current
+      tuple</i></a>&lsquo;<code class=css>s <a
+      href="#counter-symbol"><i>counter symbol</i></a> to <var>S</var>
+      <code>floor( <var>value</var> / <a
+      href="#current-tuple"><var><i>current
+      tuple</i></var></a></code>&rsquo;s weight )</code> times (this may be
+      0).
 
-   <li>Decrement <var>value</var> by the <var><a
-    href="#current-tuple"><i>current tuple's</i></a> weight multiplied by the
-    number of times the <a href="#current-tuple"><i>current tuple</i></a> was
-    appended to <var>S</var> in the previous step.</var>
-  </ol>
+     <li>Decrement <var>value</var> by the <var><a
+      href="#current-tuple"><i>current tuple's</i></a> weight multiplied by
+      the number of times the <a href="#current-tuple"><i>current
+      tuple</i></a> was appended to <var>S</var> in the previous step.</var>
+    </ol>
 
-  <p>If the loop ended because <var>value</var> is 0, return S. Otherwise,
-   the given counter value cannot be represented by this counter style, and
-   must instead be represented by the fallback counter style.
+   <li>If <var>value</var> was originally negative, wrap <var>S</var> in the
+    counter style's <a href="#negative-sign"><i
+    title=counter-negative>negative sign</i></a>, as specified in the section
+    for the <a href="#counter-style-negative">negative descriptor</a>.
+
+   <li>If the loop ended because <var>value</var> is 0, return S. Otherwise,
+    the given counter value cannot be represented by this counter style, and
+    must instead be represented by the fallback counter style.
+  </ol>
 
   <div class=example>
    <p>A "dice" counter style can be defined as:</p>
@@ -2097,12 +2116,12 @@
     <tr>
      <th>Value:
 
-     <td>[ &lt;integer> | infinite ]{2}
+     <td>[ &lt;integer> | infinite ]{2} | auto
 
     <tr>
      <th>Initial:
 
-     <td>infinite infinite
+     <td>auto
   </table>
 
   <p>The &lsquo;<a href="#descdef-range"><code
@@ -2111,13 +2130,29 @@
    represent a counter value outside of its range, the counter style instead
    drops down to its fallback counter style.
 
-  <p>The first value represents the lower bound of the range (with
-   &lsquo;<code class=property>infinite</code>&rsquo; representing negative
-   infinity), and the second value represents the upper bound of the range
-   (with &lsquo;<code class=property>infinite</code>&rsquo; representing
-   positive infinity). This is an inclusive range - it includes both the
-   lower and upper bound numbers. If the lower bound is higher than the
-   higher bound, the descriptor is invalid and must be ignored.
+  <p>If the value is not &lsquo;<code class=css>auto</code>&rsquo;, the first
+   value represents the lower bound of the range (with &lsquo;<code
+   class=property>infinite</code>&rsquo; representing negative infinity), and
+   the second value represents the upper bound of the range (with
+   &lsquo;<code class=property>infinite</code>&rsquo; representing positive
+   infinity). This is an inclusive range - it includes both the lower and
+   upper bound numbers. If the lower bound is higher than the higher bound,
+   the descriptor is invalid and must be ignored.
+
+  <p>If the value is &lsquo;<code class=css>auto</code>&rsquo;, the range
+   depends on the counter type. For &lsquo;<code
+   class=css>repeating</code>&rsquo;, &lsquo;<code
+   class=css>numeric</code>&rsquo;, and &lsquo;<code
+   class=css>non-repeating</code>&rsquo; types, it must be treated
+   identically to specifying &lsquo;<code class=css>infinite
+   infinite</code>&rsquo;. For &lsquo;<code
+   class=css>alphabetic</code>&rsquo; and &lsquo;<code
+   class=css>symbolic</code>&rsquo;, it must be treated identically to
+   &lsquo;<code class=css>1 infinite</code>&rsquo;. For &lsquo;<code
+   class=css>additive</code>&rsquo;, it must be treated identically to
+   &lsquo;<code class=css>0 infinite</code>&rsquo;. For &lsquo;<code
+   class=css>override</code>&rsquo;, it must be treated according to the type
+   of the counter style it is overriding.
 
   <p>Some counter style types have their own implicit ranges, specified above
    in the individual descriptions for each type. The explicit range given by

Index: Overview.src.html
===================================================================
RCS file: /sources/public/csswg/css3-lists/Overview.src.html,v
retrieving revision 1.168
retrieving revision 1.169
diff -u -d -r1.168 -r1.169
--- Overview.src.html	5 Dec 2011 23:41:39 -0000	1.168
+++ Overview.src.html	6 Dec 2011 18:18:53 -0000	1.169
@@ -869,9 +869,6 @@
 		style, exit this algorithm and instead <i title='generate-a-counter'>generate a counter representation</i>
 		using the counter style's fallback style and the same counter value.</li>
 
-		<li>If the counter value is negative, set the <var>negative</var> flag and
-		run the rest of this algorithm with the counter value set to its absolute value instead.</li>
-
 		<li>Using the counter value and the <i title='counter-algorithm'>counter algorithm</i> 
 		for the counter style, generate an initial representation for the counter value.</li>
 
@@ -994,6 +991,8 @@
 		<li>If <var>value</var> is 0, append <var>symbol(0)</var> to 
 		<var>S</var> and return <var>S</var>.</li>
 
+		<li>If <var>value</var> is negative, run the next step of this algorithm with <var>value</var> being the absolute value of <var>value</var> instead.</li>
+
 		<li>While <var>value</var> is not equal to 0:
 
 			<ol>
@@ -1004,6 +1003,8 @@
 			</ol>
 		</li>
 
+		<li>If <var>value</var> was originally negative, wrap <var>S</var> in the counter style's <i title='counter-negative'>negative sign</i>, as specified in the section for the <a href='#counter-style-negative'>negative descriptor</a>.</li>
+
 		<li>Return <var>S</var>.</li>
 	</ol>
 
@@ -1035,7 +1036,7 @@
 
 	<p>If the type is <a href=#alphabetic>alphabetic</a>, the 'symbols' descriptor must contain
 	at least two <i>counter symbol</i>s.  This type is defined only over
-	positive counter values.</p>
+	strictly positive counter values.</p>
 
 	<p>The <i>alphabetic</i> counter type interprets the list of <i>counter symbols</i>
 	as digits to an <em>alphabetic</em> numbering system, similar to the default
@@ -1133,7 +1134,7 @@
 symbolic</h4>
 
 	<p>If the type is <a href=#symbolic>symbolic</a>, the 'symbols' descriptor must contain at
-	least one <i>counter symbol</i>.  This type is defined only over positive
+	least one <i>counter symbol</i>.  This type is defined only over strictly positive
 	counter values.</p>
 
 	<p>The <i>symbolic</i> counter type cycles repeatedly through its provided symbols,
@@ -1258,8 +1259,7 @@
 
 	<p>If the type is <a href=#additive>additive</a>, the 'additive-symbols' descriptor must
 	contain at least one <i>additive tuple</i>.  This type is nominally
-	defined over all positive counter values (see algorithm, below, for
-	exact details)</p>
+	defined over all counter values (see algorithm, below, for exact details)</p>
 
 	<p>The <i>additive</i> counter type takes as many of the largest symbols that 
 	it can, then as many of the next largest symbol, etc. until the sum of all 
@@ -1268,33 +1268,35 @@
 	several languages which use different characters for the digits in differnt
 	positions.</p>
 
-	<p>To construct the representation, run this algorithm.  let <var>value</var> 
+	<p>To construct the representation, run this algorithm.  Let <var>value</var> 
 	initially be the counter value, <var>S</var> initially be the empty string, 
 	and <var>symbol list</var> initially be the list of <i>additive tuple</i>s.
 
-	<p>If <var>value</var> is initially 0, and there is an <i>additive tuple</i>
-	with a weight of 0, append that tuple's <i>counter symbol</i> to S
-	and return S.</p>
+	<ol>
+		<li>If <var>value</var> is initially 0, and there is an <i>additive tuple</i> with a weight of 0, append that tuple's <i>counter symbol</i> to S and return S.</li>
 
-	<p>Otherwise, while <var>value</var> is greater than 0 and there are elements
-	left in the <var>symbol list</var>:</p>
+		<li>If <var>value</var> is negative, run the next step of this algorithm with <var>value</var> being the absolute value of <var>value</var> instead.</li>
 
-	<ol>
-		<li>Pop the first <i>additive tuple</i> from the <var>symbol list</var>.
-		This is the <dfn title="current tuple|current tuple's">current tuple</dfn>.</li>
+		<li>While <var>value</var> is greater than 0 and there are elements left in the <var>symbol list</var>:
 
-		<li>Append the <i>current tuple</i>'s <i>counter symbol</i> to <var>S</var> 
-		<code>floor( <var>value</var> / <var><i>current tuple's</i> weight</var> )</code>
-		times (this may be 0).</li>
+			<ol>
+				<li>Pop the first <i>additive tuple</i> from the <var>symbol list</var>.
+				This is the <dfn title="current tuple|current tuple's">current tuple</dfn>.</li>
 
-		<li>Decrement <var>value</var> by the <var><i>current tuple's</i> weight multiplied
-		by the number of times the <i>current tuple</i> was appended to <var>S</var>
-		in the previous step.</li>
-	</ol>
+				<li>Append the <i>current tuple</i>'s <i>counter symbol</i> to <var>S</var> 
+				<code>floor( <var>value</var> / <var><i>current tuple's</i> weight</var> )</code>
+				times (this may be 0).</li>
 
-	<p>If the loop ended because <var>value</var> is 0, return S.  Otherwise, the 
-	given counter value cannot be represented by this counter style, and must
-	instead be represented by the fallback counter style.</p>
+				<li>Decrement <var>value</var> by the <var><i>current tuple's</i> weight multiplied
+				by the number of times the <i>current tuple</i> was appended to <var>S</var>
+				in the previous step.</li>
+			</ol>
+		</li>
+
+		<li>If <var>value</var> was originally negative, wrap <var>S</var> in the counter style's <i title='counter-negative'>negative sign</i>, as specified in the section for the <a href='#counter-style-negative'>negative descriptor</a>.</li>
+
+		<li>If the loop ended because <var>value</var> is 0, return S.  Otherwise, the given counter value cannot be represented by this counter style, and must instead be represented by the fallback counter style.</li>
+	</ol>
 
 	<div class=example>
 		<p>A "dice" counter style can be defined as:</p>
@@ -1424,23 +1426,25 @@
 			<td><dfn id="descdef-range">range</dfn>
 		<tr>
 			<th>Value:
-			<td>[ &lt;integer> | infinite ]{2}
+			<td>[ &lt;integer> | infinite ]{2} | auto
 		<tr>
 			<th>Initial:
-			<td>infinite infinite
+			<td>auto
 	</table>
 
 	<p>The 'range' descriptor defines the range over which the counter style is defined.
 	If a counter style is used to represent a counter value outside of its range,
 	the counter style instead drops down to its fallback counter style.</p>
 
-	<p>The first value represents the lower bound of the range (with 'infinite'
+	<p>If the value is not ''auto'', the first value represents the lower bound of the range (with 'infinite'
 	representing negative infinity), and the second value represents the upper bound
 	of the range (with 'infinite' representing positive infinity).  This is an inclusive
 	range - it includes both the lower and upper bound numbers.  If the lower
 	bound is higher than the higher bound, the descriptor is invalid and must
 	be ignored.</p>
 
+	<p>If the value is ''auto'', the range depends on the counter type.  For ''repeating'', ''numeric'', and ''non-repeating'' types, it must be treated identically to specifying ''infinite infinite''.  For ''alphabetic'' and ''symbolic'', it must be treated identically to ''1 infinite''.  For ''additive'', it must be treated identically to ''0 infinite''.  For ''override'', it must be treated according to the type of the counter style it is overriding.</p>
+
 	<p>Some counter style types have their own implicit ranges, specified above 
 	in the individual descriptions for each type.  The explicit range given
 	by the ‘<code class="css">range</code>’ descriptor applies at the same time 
Received on Tuesday, 6 December 2011 18:19:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:26:08 UTC