Skip to content

Commit fcc500b

Browse files
committed
[css-lists-3] Use <<counter-name>> instead of <<custom-ident>> and exclude 'none' as invalid, per CSS2.
1 parent 06a7715 commit fcc500b

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

css-lists-3/Overview.bs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,12 @@ Automatic Numbering With Counters</h2>
653653
the <dfn export>counter properties</dfn> 'counter-increment', 'counter-set' and 'counter-reset',
654654
and used with the ''counter()'' and ''counters()'' [=functional notations=].
655655

656+
Counters are referred to in CSS syntax
657+
using the <dfn><<counter-name>></dfn> type,
658+
which represents their name as a <<custom-ident>>.
659+
A <<counter-name>> name cannot match the keyword ''none'';
660+
such an identifier is [=invalid=] as a <<counter-name>>.
661+
656662
Resolving [=counter=] values on a given element is a multi-step process:
657663

658664
1. Existing counters are [=inherit counters|inherited=] from previous elements.
@@ -676,7 +682,7 @@ Creating Counters: the 'counter-reset' property</h3>
676682

677683
<pre class="propdef">
678684
Name: counter-reset
679-
Value: [ <<custom-ident>> <<integer>>? ]+ | none
685+
Value: [ <<counter-name>> <<integer>>? ]+ | none
680686
Initial: none
681687
Applies to: all elements
682688
Inherited: no
@@ -696,9 +702,9 @@ Creating Counters: the 'counter-reset' property</h3>
696702
<dd>
697703
This element does not create any new counters.
698704

699-
<dt><dfn><<custom-ident>> <<integer>>?</dfn>
705+
<dt><dfn><<counter-name>> <<integer>>?</dfn>
700706
<dd>
701-
[=Instantiates=] a counter of the given <<custom-ident>> <dfn>counter name</dfn>
707+
[=Instantiates=] a counter of the given <<counter-name>> <dfn>counter name</dfn>
702708
with a starting value of the given <<integer>>,
703709
defaulting to ''0''.
704710
</dl>
@@ -722,15 +728,15 @@ Creating Counters: the 'counter-reset' property</h3>
722728
See [[css-cascade-4]].
723729
</div>
724730

725-
If multiple instances of the same <<custom-ident>> occur in the property value,
731+
If multiple instances of the same <<counter-name>> occur in the property value,
726732
only the last one is honored.
727733

728734
<h3 id='increment-set'>
729735
Manipulating Counter Values: the 'counter-increment' and 'counter-set' properties</h3>
730736

731737
<pre class='propdef'>
732738
Name: counter-increment
733-
Value: [ <<custom-ident>> <<integer>>? ]+ | none
739+
Value: [ <<counter-name>> <<integer>>? ]+ | none
734740
Initial: none
735741
Applies to: all elements
736742
Inherited: no
@@ -743,7 +749,7 @@ Manipulating Counter Values: the 'counter-increment' and 'counter-set' propertie
743749

744750
<pre class='propdef'>
745751
Name: counter-set
746-
Value: [ <<custom-ident>> <<integer>>? ]+ | none
752+
Value: [ <<counter-name>> <<integer>>? ]+ | none
747753
Initial: none
748754
Applies to: all elements
749755
Inherited: no
@@ -765,7 +771,7 @@ Manipulating Counter Values: the 'counter-increment' and 'counter-set' propertie
765771
<dd>
766772
This element does not alter the value of any counters.
767773

768-
<dt><dfn><<custom-ident>> <<integer>>?</dfn>
774+
<dt><dfn><<counter-name>> <<integer>>?</dfn>
769775
<dd>
770776
Sets (for 'counter-set') or increments (for 'counter-increment')
771777
the value of the named counter on the element
@@ -796,7 +802,7 @@ Manipulating Counter Values: the 'counter-increment' and 'counter-set' propertie
796802
</pre>
797803
</div>
798804

799-
If multiple instances of the same <<custom-ident>> occur in the property value,
805+
If multiple instances of the same <<counter-name>> occur in the property value,
800806
they are all processed, in order.
801807
Thus increments will compound,
802808
but only the last set value will take effect.
@@ -1153,8 +1159,8 @@ Outputting Counters: the ''counter()'' and ''counters()'' functions</h3>
11531159

11541160
<pre>
11551161
<dfn><<counter>></dfn> = <<counter()>> | <<counters()>>
1156-
<dfn>counter()</dfn> = counter( <<custom-ident>>, [ <<counter-style>> | none ]? )
1157-
<dfn>counters()</dfn> = counters( <<custom-ident>>, <<string>>, [ <<counter-style>> | none ]? )
1162+
<dfn>counter()</dfn> = counter( <<counter-name>>, [ <<counter-style>> | none ]? )
1163+
<dfn>counters()</dfn> = counters( <<counter-name>>, <<string>>, [ <<counter-style>> | none ]? )
11581164
</pre>
11591165

11601166
For both functions, the first argument represents the name of a counter,
@@ -1325,7 +1331,7 @@ Outputting Counters: the ''counter()'' and ''counters()'' functions</h3>
13251331
but this is a *little bit* clumsy,
13261332
and doesn't work for siblings.)
13271333

1328-
Suggestion is to add a <css>counter-value(<<custom-ident>>)</css> function,
1334+
Suggestion is to add a <css>counter-value(<<counter-name>>)</css> function,
13291335
which returns the value of the named counter as an integer,
13301336
rather than returning a string.
13311337

0 commit comments

Comments
 (0)