Skip to content

Commit

Permalink
[css-counter-styles-3] Explicitly tell when the counter style is not …
Browse files Browse the repository at this point in the history
…defined (#11896)

@counter-style does not define a counter style (but is still a valid rule) when some descriptors are declared with a valid value that do not meet the requirement of the declared (or default) system.
  • Loading branch information
cdoublev authored Mar 11, 2025
1 parent 123c371 commit 2cf651d
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions css-counter-styles-3/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,8 @@ Cycling Symbols: the ''cyclic'' system</h4>
the second <a>counter symbol</a> (if it exists) is used as the representation of the value 2, etc.

If the system is ''cyclic'',
the '@counter-style/symbols' descriptor must contain at least one <a>counter symbol</a>.
the '@counter-style/symbols' descriptor must contain at least one <a>counter symbol</a>,
otherwise the rule does not define a counter style (but is still a valid rule).
This system is defined over all counter values.

<div class=example>
Expand Down Expand Up @@ -321,7 +322,8 @@ Exhaustible Symbols: the ''system/fixed'' system</h4>
such as circled digits.

If the system is ''system/fixed'',
the '@counter-style/symbols' descriptor must contain at least one <a>counter symbol</a>.
the '@counter-style/symbols' descriptor must contain at least one <a>counter symbol</a>,
otherwise the rule does not define a counter style (but is still a valid rule).
This system is defined over counter values in a finite range,
starting with the <a>first symbol value</a> and having a length equal to the length of the list of <a>counter symbols</a>.

Expand Down Expand Up @@ -381,7 +383,8 @@ Repeating Symbols: the ''symbolic'' system</h4>
and is also sometimes used for alphabetic-style lists for a slightly different presentation than what the ''system/alphabetic'' system presents.

If the system is ''symbolic'',
the '@counter-style/symbols' descriptor must contain at least one <a>counter symbol</a>.
the '@counter-style/symbols' descriptor must contain at least one <a>counter symbol</a>,
otherwise the rule does not define a counter style (but is still a valid rule).
This system is defined only over strictly positive counter values.

<div class=example>
Expand Down Expand Up @@ -469,7 +472,8 @@ Bijective Numerals: the ''alphabetic'' system</h4>
and so on.

If the system is ''system/alphabetic'',
the '@counter-style/symbols' descriptor must contain at least two <a>counter symbols</a>.
the '@counter-style/symbols' descriptor must contain at least two <a>counter symbols</a>,
otherwise the rule does not define a counter style (but is still a valid rule).
This system is defined only over strictly positive counter values.

<div class=example>
Expand Down Expand Up @@ -541,7 +545,8 @@ Positional Numerals: the ''numeric'' system</h4>
and so on.

If the system is ''system/numeric'',
the '@counter-style/symbols' descriptor must contain at least two <a>counter symbols</a>.
the '@counter-style/symbols' descriptor must contain at least two <a>counter symbols</a>,
otherwise the rule does not define a counter style (but is still a valid rule).
This system is defined over all counter values.

<div class=example>
Expand Down Expand Up @@ -612,7 +617,8 @@ Accumulating Numerals: the ''additive'' system</h4>
and other numbering systems around the world.

If the system is ''additive'',
the '@counter-style/additive-symbols' descriptor must contain at least one <a>additive tuple</a>.
the '@counter-style/additive-symbols' descriptor must contain at least one <a>additive tuple</a>,
otherwise the rule does not define a counter style (but is still a valid rule).
This system is nominally defined over all counter values
(see algorithm, below, for exact details).

Expand Down Expand Up @@ -709,7 +715,8 @@ Building from Existing Counter Styles: the ''extends'' system
rather than taking their initial values.

If a ''@counter-style'' uses the ''extends'' system,
it must not contain a '@counter-style/symbols' or '@counter-style/additive-symbols' descriptor.
it must not contain a '@counter-style/symbols' or '@counter-style/additive-symbols' descriptor,
otherwise the rule does not define a counter style (but is still a valid rule).

If the specified <<counter-style-name>> is an [=ASCII case-insensitive=] match
for ''disc'', ''circle'', ''square'', ''disclosure-open'', or ''disclosure-closed''
Expand Down Expand Up @@ -2615,7 +2622,7 @@ The <code>CSSCounterStyleRule</code> interface</h3>
1. [=CSS/parse=] [=the given value=] as the descriptor associated with the attribute.

2. If the result is invalid according to the given descriptor's grammar,
or would cause the ''@counter-style'' rule to become invalid,
or would cause the ''@counter-style'' rule to not define a counter style,
do nothing and abort these steps.
(For example, some systems require the '@counter-style/symbols' descriptor to contain two values.)

Expand Down

0 comments on commit 2cf651d

Please sign in to comment.