Skip to content

[css-lists-3] counter(name, none) should be invalid #4163

Closed
@fantasai

Description

@fantasai

In CSS2, counter(name, none) and counters(name, "string", none) were both invalid, as none was not allowed in counters(). See definition of counter functions in CSS2

In the CSS Lists Level 3 drafts, it was allowed, but it caused the function to return the empty string.

Meanwhile, in Chrome and Firefox, none is valid, and it represents a counter style that returns the empty string (which in counters(), is not the same thing as simply returning the empty string). Testcase

Wrt the css-lists-3 behavior, I can't think of any use case. If you want the empty string, you can just write "". As for the behavior implemented in Chrome and Firefox for counters(), it seems really odd, as it just generates a series of (n-1) copies of a string for a counter nesting depth of n?

I'm updating the css-lists-3 spec to match CSS2, because that's our reference spec for these features and we're supposed to sync with it. Filing this issue to track that and in case anyone wants to argue for matching Chrome & Firefox.

CC @MatsPalmgren @dbaron @tabatkins @jensimmons @LeaVerou

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