Skip to content

Commit 9e87880

Browse files
committed
[css3-lists] Rewrite one of the counter nesting examples to be visual rather than text-based.
--HG-- extra : rebase_source : 767f345f7d51049fbcee2928a78410eef98216f1
1 parent 26d7af2 commit 9e87880

2 files changed

Lines changed: 161 additions & 129 deletions

File tree

css3-lists/Overview.html

Lines changed: 89 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
<meta content="CSS Lists and Counters Module Level 3" name=dcterms.title>
1212
<meta content=text name=dcterms.type>
13-
<meta content=2012-11-29 name=dcterms.issued>
13+
<meta content=2012-11-30 name=dcterms.issued>
1414
<meta content="http://dev.w3.org/csswg/css3-lists/" name=dcterms.creator>
1515
<meta content=W3C name=dcterms.publisher>
16-
<meta content="http://www.w3.org/TR/2012/ED-css3-lists-20121129/"
16+
<meta content="http://www.w3.org/TR/2012/ED-css3-lists-20121130/"
1717
name=dcterms.identifier>
1818
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
1919
<link href="http://dev.w3.org/csswg/default.css" rel=stylesheet
@@ -36,13 +36,13 @@
3636

3737
<h1>CSS Lists and Counters Module Level 3</h1>
3838

39-
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 29 November
39+
<h2 class="no-num no-toc" id=longstatus-date>Editor's Draft 30 November
4040
2012</h2>
4141

4242
<dl>
4343
<dt>This version:
4444

45-
<dd><!--<a href="http://www.w3.org/TR/2012/WD-css3-lists-20121129">http://www.w3.org/TR/2012/WD-css3-lists-20121129</a>-->
45+
<dd><!--<a href="http://www.w3.org/TR/2012/WD-css3-lists-20121130">http://www.w3.org/TR/2012/WD-css3-lists-20121130</a>-->
4646
<a
4747
href="http://dev.w3.org/csswg/css3-lists/">http://dev.w3.org/csswg/css3-lists/</a>
4848

@@ -1479,9 +1479,9 @@ <h3 id=marker-side><span class=secno>7.2. </span> The ‘<a
14791479
<td style="border-right: thin solid">
14801480
<pre>
14811481
* english one
1482-
OWT WERBEH *
1482+
OWT WERBEH *
14831483
* english three
1484-
RUOF WERBEH *</pre>
1484+
RUOF WERBEH *</pre>
14851485

14861486
<td>
14871487
<pre>
@@ -1710,13 +1710,13 @@ <h3 id=counter-properties><span class=secno>8.1. </span> Manipulating
17101710

17111711
<pre>
17121712
H1:before {
1713-
content: "Chapter " counter(chapter) ". ";
1714-
counter-increment: chapter; /* Add 1 to chapter */
1715-
counter-reset: section; /* Set section to 0 */
1713+
content: "Chapter " counter(chapter) ". ";
1714+
counter-increment: chapter; /* Add 1 to chapter */
1715+
counter-reset: section; /* Set section to 0 */
17161716
}
17171717
H2:before {
1718-
content: counter(chapter) "." counter(section) " ";
1719-
counter-increment: section;
1718+
content: counter(chapter) "." counter(section) " ";
1719+
counter-increment: section;
17201720
}</pre>
17211721
</div>
17221722

@@ -1777,16 +1777,16 @@ <h3 id=creating-counters><span class=secno>8.2. </span> Creating and
17771777

17781778
<pre>
17791779
&lt;ul style='counter-reset: example 0;'>
1780-
<b
1780+
<b
17811781
class=foo>&lt;li id='foo' style='counter-increment: example;'></b>
1782-
foo
1783-
<b
1782+
foo
1783+
<b
17841784
class=bar>&lt;div id='bar' style='counter-increment: example;'>bar&lt;/div></b>
1785-
&lt;/li>
1786-
<b
1785+
&lt;/li>
1786+
<b
17871787
class=baz>&lt;li id='baz'></b>
1788-
baz
1789-
&lt;/li>
1788+
baz
1789+
&lt;/li>
17901790
&lt;/ul></pre>
17911791

17921792
<p> Recall that "in document order" turns a document tree into an ordered
@@ -1874,38 +1874,62 @@ <h3 id=nested-counters><span class=secno>8.3. </span> Nested Counters</h3>
18741874
OL will refer to that counter.
18751875
</div>
18761876

1877-
<div class=example>
1878-
<p> If we denote by item[<var>n</var>] the <var>n</var><sup>th</sup>
1879-
instance of the "item" counter, and by "(" and ")"the beginning and end
1880-
of a scope, then the following HTML fragment will use the indicated
1881-
counters. (We assume the style sheet as given in the example above).
1877+
<div class=example id=counter-nesting-example>
1878+
<p> If we denote the <var>n</var><sup>th</sup> instance of the "item"
1879+
counter by item[<var>n</var>], then the following HTML fragment will use
1880+
the indicated counters. (We assume the style sheet as given in the
1881+
example above).
18821882

1883-
<pre>
1884-
&lt;OL> &lt;!-- (set item[0] to 0 -->
1885-
&lt;LI>item &lt;!-- increment item[0] to 1 -->
1886-
&lt;LI>item &lt;!-- increment item[0] to 2 -->
1887-
&lt;OL> &lt;!-- (set item[1] to 0 -->
1888-
&lt;LI>item &lt;!-- increment item[1] to 1 -->
1889-
&lt;LI>item &lt;!-- increment item[1] to 2 -->
1890-
&lt;LI>item &lt;!-- increment item[1] to 3 -->
1891-
&lt;OL> &lt;!-- (set item[2] to 0 -->
1892-
&lt;LI>item &lt;!-- increment item[2] to 1 -->
1893-
&lt;/OL> &lt;!-- ) -->
1894-
&lt;OL> &lt;!-- (set item[3] to 0 -->
1895-
&lt;LI> &lt;!-- increment item[3] to 1 -->
1896-
&lt;/OL> &lt;!-- ) -->
1897-
&lt;LI>item &lt;!-- increment item[0] to 3 -->
1898-
&lt;LI>item &lt;!-- increment item[0] to 4 -->
1899-
&lt;/OL> &lt;!-- ) -->
1900-
&lt;OL> &lt;!-- (set item[4] to 0 -->
1901-
&lt;LI>item &lt;!-- increment item[4] to 1 -->
1902-
&lt;LI>item &lt;!-- increment item[4] to 2 -->
1903-
&lt;/OL> &lt;!-- ) --></pre>
1904-
1905-
<p class=issue> Rewrite this example as an image showing the scopes
1906-
visually.
1883+
<div class=ol>
1884+
<div class=ol><code>&lt;ol></code> item[0] is created, set to 0
1885+
<div class=li><code>&lt;li></code> item[0] is incremented to 1</div>
1886+
1887+
<div class=li><code>&lt;li></code> item[0] is incremented to 2
1888+
<div class=ol><code>&lt;ol></code> item[1] is created, set to 0, nested
1889+
in item[0]
1890+
<div class=li><code>&lt;li></code> item[1] is incremented to 1</div>
1891+
1892+
<div class=li><code>&lt;li></code> item[1] is incremented to 2</div>
1893+
1894+
<div class=li><code>&lt;li></code> item[1] is incremented to 3
1895+
<div class=ol><code>&lt;ol></code> item[2] is created, set to 0,
1896+
nested in item[1]
1897+
<div class=li><code>&lt;li></code> item[2] is incremented to 1</div>
1898+
</div>
1899+
</div>
1900+
1901+
<div class=li><code>&lt;li></code> item[1] is incremented to 4
1902+
<div class=ol><code>&lt;ol></code> item[3] is created, set to 0,
1903+
nested in item[1]
1904+
<div class=li><code>&lt;li></code> item[3] is incremented to 1</div>
1905+
</div>
1906+
</div>
1907+
1908+
<div class=li><code>&lt;li></code> item[1] is incremented to 5</div>
1909+
</div>
1910+
</div>
1911+
1912+
<div class=li><code>&lt;li></code> item[0] is incremented to 3</div>
1913+
1914+
<div class=li><code>&lt;li></code> item[0] is incremented to 4</div>
1915+
</div>
1916+
1917+
<div class=ol><code>&lt;ol></code> item[4] is created, set to 0
1918+
<div class=li><code>&lt;li></code> item[4] is incremented to 1</div>
1919+
1920+
<div class=li><code>&lt;li></code> item[4] is incremented to 2</div>
1921+
</div>
1922+
</div>
19071923
</div>
19081924

1925+
<head>
1926+
<style>
1927+
#counter-nesting-example .ol { background: rgba(0,0,0,.1); margin: .5em 0; padding: .2em .5em; }
1928+
#counter-nesting-example .li > .ol { margin: 0 0 0 1em; }
1929+
#counter-nesting-example .li { list-style: none; margin-left: 1em;}
1930+
</style>
1931+
1932+
<body>
19091933
<h3 id=counters-without-boxes><span class=secno>8.4. </span> Counters in
19101934
elements that do not generate boxes</h3>
19111935

@@ -2032,14 +2056,14 @@ <h2 id=counter-function><span class=secno>9. </span> Printing Counters: the
20322056

20332057
<pre>
20342058
&lt;ul>
2035-
&lt;li>one&lt;/li>
2036-
&lt;li>two
2037-
&lt;ul>
2038-
&lt;li>nested one&lt;/li>
2039-
&lt;li>nested two&lt;/li>
2040-
&lt;/ul>
2041-
&lt;/li>
2042-
&lt;li>three&lt;/li>
2059+
&lt;li>one&lt;/li>
2060+
&lt;li>two
2061+
&lt;ul>
2062+
&lt;li>nested one&lt;/li>
2063+
&lt;li>nested two&lt;/li>
2064+
&lt;/ul>
2065+
&lt;/li>
2066+
&lt;li>three&lt;/li>
20432067
&lt;/ul>
20442068
&lt;style>
20452069
ul { counter-reset: list-item; }
@@ -2052,8 +2076,8 @@ <h2 id=counter-function><span class=secno>9. </span> Printing Counters: the
20522076
<pre>
20532077
(1) one
20542078
(2) two
2055-
(2.1) nested one
2056-
(2.2) nested two
2079+
(2.1) nested one
2080+
(2.2) nested two
20572081
(3) three</pre>
20582082
</div>
20592083

@@ -2086,10 +2110,10 @@ <h2 id=counter-function><span class=secno>9. </span> Printing Counters: the
20862110
h3 { counter-increment: h3; }
20872111
h1::before { content: counter(h1,upper-alpha) ' '; }
20882112
h2::before { content: counter(h1,upper-alpha) '.'
2089-
counter(h2,decimal) ' '; }
2113+
counter(h2,decimal) ' '; }
20902114
h3::before { content: counter(h1,upper-alpha) '.'
2091-
counter(h2,decimal) '.'
2092-
counter(h3,lower-roman) ' '; }
2115+
counter(h2,decimal) '.'
2116+
counter(h3,lower-roman) ' '; }
20932117
&lt;/style></pre>
20942118

20952119
<p>The preceding document should render something like this:
@@ -2137,7 +2161,7 @@ <h2 id=ua-stylesheet><span class=secno>10. </span> Sample style sheet for
21372161
ul ul { list-style-type: square; }
21382162
ul ul ul { list-style-type: circle; }
21392163
/* Alternately, if Values & Units Level 3 is supported, replace
2140-
the above three lines with: */
2164+
the above three lines with: */
21412165
ul { list-style-type: disc; }
21422166
ul ul { list-style-type: cycle(disc, square, circle); }
21432167

@@ -2236,10 +2260,10 @@ <h2 class=no-num id=acknowledgments> Acknowledgments</h2>
22362260
Randall Bart, Richard Ishida, Simon Montagu (Mozilla,
22372261
smontagu@smontagu.org)
22382262
<!-- see http://www.damowmow.com/temp/csswg/lists/part2.html
2239-
http://www.qsm.co.il/Hebrew/Gimatria.htm
2240-
http://people.netscape.com/smontagu/writings/HebrewNumbers.html
2241-
http://www.ethiopic.org/Collation/OrderedLists.html
2242-
http://bugzilla.mozilla.org/show_bug.cgi?id=102252 -->
2263+
http://www.qsm.co.il/Hebrew/Gimatria.htm
2264+
http://people.netscape.com/smontagu/writings/HebrewNumbers.html
2265+
http://www.ethiopic.org/Collation/OrderedLists.html
2266+
http://bugzilla.mozilla.org/show_bug.cgi?id=102252 -->
22432267
<!-- ====================================================================== -->
22442268

22452269
<h2 class=no-num id=changes> Changes From CSS2.1</h2>

0 commit comments

Comments
 (0)