[csswg-drafts] [css-lists-3] Inconsist `counter()` syntax between CSS 2 and 3 (#5795)

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

== [css-lists-3] Inconsist `counter()` syntax between CSS 2 and 3 ==
Should `content: counter(c, none)` be a parse-time failure, or a valid value that generates empty text?

In CSS 2.1:
- `counter() = counter(name, <list-style-type>?)` [1], where
- `<list-style-type> = disc | circle | square | decimal | decimal-leading-zero | lower-roman | upper-roman | lower-greek | lower-latin | upper-latin | armenian | georgian | lower-alpha | upper-alpha | none | inherit` [2]

So `content: counter(c, none)` is a valid declaration that doesn't generate any text. Chrome implements this behavior.

In CSS 3:
- `counter()  =  counter( <counter-name>, <counter-style>? )` [3], where
- `<counter-style> = <counter-style-name> | <symbols()>` [4], where
- `<counter-style-name>` is a `<custom-ident>` that is not an ASCII case-insensitive match for "none". [5]

So `content: counter(c, none)` is invalid at parse time. Firefox implements this behavior.

My proposal:  We should not allow `none`. Allowing `none` in CSS 2.1 looks like a spec bug to me, since it provides little value and doesn't make too much sense. (And the same syntax also allows `inherit`, which makes no sense at all).

[1] https://www.w3.org/TR/CSS2/generate.html#counter-styles
[2] https://www.w3.org/TR/CSS2/generate.html#propdef-list-style-type
[3] https://drafts.csswg.org/css-lists-3/#counter-functions
[4] https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style
[5] https://drafts.csswg.org/css-counter-styles-3/#typedef-counter-style-name

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


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

Received on Tuesday, 15 December 2020 21:06:32 UTC