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

xiaochengh has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-counter-styles] Clarify what to do when 'symbols' has only one symbol for 'alphabetic' and 'numeric' systems? ==
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.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5698 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 5 November 2020 01:47:14 UTC