Skip to content

Commit 1af9115

Browse files
committed
[css2] Hakon's edits
--HG-- extra : convert_revision : svn%3A73dc7c4b-06e6-40f3-b4f7-9ed1dbc14bfc/trunk%402291
1 parent e8752c1 commit 1af9115

1 file changed

Lines changed: 31 additions & 24 deletions

File tree

css2/generate.src

Lines changed: 31 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,21 @@ with two different functions: 'counter()' or 'counters()'.
172172
The former has two forms:
173173
'counter(<var>name</var>)' or 'counter(<var>name</var>,
174174
<var>style</var>)'.
175-
The generated text is the value of the named
176-
counter at this point in the formatting structure; it
177-
is formatted in the indicated
178-
<a href="#counter-styles">style</a> ('decimal' by default).
179-
The latter function also has two forms:
180-
'counters(<var>name</var>, <var>string</var>)' or 'counters(<var>name</var>,
181-
<var>string</var>, <var>style</var>)'. The generated text is the value of all
182-
counters with the given name at this point in the formatting structure,
183-
separated by the specified string. The counters are rendered
184-
in the indicated <a href="#counter-styles">style</a> ('decimal' by default).
185-
See the section on <a href="#counters">automatic counters and
186-
numbering</a> for more information.
187-
<dt><span class="index-inst" title="open-quote"><span
188-
class="value-inst-open-quote"><strong>open-quote</strong></span></span> and
189-
<span class="index-inst" title="close-quote"><span
175+
176+
The generated text is the value of the innermost counter of the given
177+
name in scope at this pseudo-element; it is formatted in the indicated
178+
<a href="#counter-styles">style</a> ('decimal' by default). The latter
179+
function also has two forms: 'counters(<var>name</var>,
180+
<var>string</var>)' or 'counters(<var>name</var>, <var>string</var>,
181+
<var>style</var>)'. The generated text is the value of all counters
182+
with the given name in scope at this pseudo-element, from outermost to
183+
innermost separated by the specified string. The counters are rendered
184+
in the indicated <a href="#counter-styles">style</a> ('decimal' by
185+
default). See the section on <a href="#counters">automatic counters
186+
and numbering</a> for more information. <dt><span class="index-inst"
187+
title="open-quote"><span
188+
class="value-inst-open-quote"><strong>open-quote</strong></span></span>
189+
and <span class="index-inst" title="close-quote"><span
190190
class="value-inst-close-quote"><strong>close-quote</strong></span></span>
191191

192192
<dd>These values are replaced by the appropriate string
@@ -461,6 +461,8 @@ is 0.
461461
H1:before {
462462
content: "Chapter " counter(chapter) ". ";
463463
counter-increment: chapter; /* Add 1 to chapter */
464+
}
465+
H1 {
464466
counter-reset: section; /* Set section to 0 */
465467
}
466468
H2:before {
@@ -542,14 +544,19 @@ LI:before { content: counter(item) ". "; counter-increment: item }
542544
of a counter starts at the first element in the document that has a
543545
<span class="propinst-counter-reset">'counter-reset'</span> for that
544546
counter and includes the element's descendants and its following
545-
siblings with their descendants.
547+
siblings with their descendants. However, it does not include any
548+
elements in the scope of a counter created by a 'counter-reset' on a
549+
later sibling of the element or by a later 'counter-reset' on the same
550+
element.
546551

547552
<p>If <span
548553
class="propinst-counter-increment">'counter-increment'</span> or <span
549-
class="propinst-content">'content'</span> refers to a counter that is
550-
not in the scope of any <span
551-
class="propinst-counter-reset">'counter-reset'</span>, the counter is
552-
assumed to have been reset to 0 by the root element.
554+
class="propinst-content">'content'</span> on an element or
555+
pseudo-element refers to a counter that is not in the scope of any
556+
<span class="propinst-counter-reset">'counter-reset'</span>,
557+
implementations should behave as though a <span
558+
class="propinst-counter-reset">'counter-reset'</span> had reset the
559+
counter to 0 on that element or pseudo-element.
553560

554561
<p>In the example above, an OL will create a counter, and all children
555562
of the OL will refer to that counter.
@@ -586,9 +593,9 @@ counters. (We assume the style sheet as given in the example above).
586593
</pre>
587594
</div>
588595

589-
<p>The 'counters()' function generates a string composed of the values
590-
of all counters with the same name on the element and its ancestors,
591-
separated by a given string.
596+
<p>The 'counters()' function generates a string composed of all of the
597+
counters with the same name that are in scope, separated by a given
598+
string.
592599

593600
<div class="example"><P>
594601
<P>The following style sheet numbers nested list items
@@ -597,7 +604,7 @@ as "1", "1.1", "1.1.1", etc.
597604
<PRE>
598605
OL { counter-reset: item }
599606
LI { display: block }
600-
LI:before { content: counters(item, "."); counter-increment: item }
607+
LI:before { content: counters(item, ".") " "; counter-increment: item }
601608
</PRE>
602609
</div>
603610

0 commit comments

Comments
 (0)