Skip to content

[css-counter-styles] Clarify what to do when 'symbols' has only one symbol for 'alphabetic' and 'numeric' systems? #5698

Closed
@xiaochengh

Description

@xiaochengh

The current spec says:

The @counter-style rule must have a valid symbols descriptor...; otherwise, the @counter-style does not define a counter style (but is still a valid at-rule).

Some counter systems specify that the symbols descriptor must have at least two entries. If the counter style’s system is such, and the symbols descriptor has only a single entry, the descriptor is invalid and must be ignored.

What exactly does "the descriptor is invalid and must be ignored mean"?

Example:

@counter-style foo {
  system: alphabetic;
  symbols: 'A' 'B';
  symbols: 'X';
}

There are two possible way to interpret the spec:

  1. This is a parse failure of the declaration, and the previous symbols declaration should be used. So we end up using symbols: 'A' 'B'. This is difficult to implement, though, as the parsing of one descriptor will depend on another descriptor. I'm not sure if anywhere else in CSS has such behavior.

  2. The parsing of symbols strictly follows the syntax <symbol>+, so that we end up using symbols: 'X'. It has one symbol, and therefore the @counter-style does not define a counter style. This is Firefox's current behavior


I suggest we revise the spec and clarify that we follow the second behavior, because it's the only implemented behavior, and it's easier to implement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions