Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
fantasai opened this issue Jul 31, 2019 · 4 comments
Closed

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

fantasai opened this issue Jul 31, 2019 · 4 comments

Comments

@fantasai
Copy link
Collaborator

fantasai commented Jul 31, 2019

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

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed counter(name, none) should be invalid.

The full IRC log of that discussion <fantasai> Topic: counter(name, none) should be invalid
<fantasai> github: https://github.com//issues/4163

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed counter(name, none) should be invalid, and agreed to the following:

  • RESOLVED: Update to match 2.1 and make counter(name, none) invalid
The full IRC log of that discussion <dael> Topic: counter(name, none) should be invalid
<dael> github: https://github.com//issues/4163
<dael> fantasai: If you say counter(name,counter-style) it represents list using that. There is a none value that's value of list-style-type. Some impl think that's valid as a counter style. CSS 2.1 forbids that. I updated spec to match css2.1
<dael> fantasai: If people disagree and think counter(name, none) should be valid we can reconsider
<dael> TabAtkins: I wrote that near 10 years ago. Can't comment on [missed] so whatever
<TabAtkins> s/[missed]/justification
<dael> fantasai: Objections to updating spec to match 2.1?
<TabAtkins> No objection.
<dael> RESOLVED: Update to match 2.1 and make counter(name, none) invalid

moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 30, 2019
…ounters().

CSSWG resolution:
w3c/csswg-drafts#4163 (comment)

Spec:
https://drafts.csswg.org/css-lists-3/#counter-functions

Differential Revision: https://phabricator.services.mozilla.com/D43893

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1576821
gecko-commit: f694356cca02c95231d7c5902e9c51e056186a2b
gecko-integration-branch: autoland
gecko-reviewers: emilio
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Aug 30, 2019
moz-wptsync-bot pushed a commit to web-platform-tests/wpt that referenced this issue Aug 30, 2019
…ounters().

CSSWG resolution:
w3c/csswg-drafts#4163 (comment)

Spec:
https://drafts.csswg.org/css-lists-3/#counter-functions

Differential Revision: https://phabricator.services.mozilla.com/D43893

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1576821
gecko-commit: f694356cca02c95231d7c5902e9c51e056186a2b
gecko-integration-branch: autoland
gecko-reviewers: emilio
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 4, 2019
…in counter()/counters(). r=emilio

CSSWG resolution:
w3c/csswg-drafts#4163 (comment)

Spec:
https://drafts.csswg.org/css-lists-3/#counter-functions

Differential Revision: https://phabricator.services.mozilla.com/D43893

UltraBlame original commit: f694356cca02c95231d7c5902e9c51e056186a2b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 4, 2019
…in counter()/counters(). r=emilio

CSSWG resolution:
w3c/csswg-drafts#4163 (comment)

Spec:
https://drafts.csswg.org/css-lists-3/#counter-functions

Differential Revision: https://phabricator.services.mozilla.com/D43893

UltraBlame original commit: f694356cca02c95231d7c5902e9c51e056186a2b
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 4, 2019
…in counter()/counters(). r=emilio

CSSWG resolution:
w3c/csswg-drafts#4163 (comment)

Spec:
https://drafts.csswg.org/css-lists-3/#counter-functions

Differential Revision: https://phabricator.services.mozilla.com/D43893

UltraBlame original commit: f694356cca02c95231d7c5902e9c51e056186a2b
@faceless2
Copy link

faceless2 commented Jan 2, 2020

I realise this is closed and CSS 2.1 is long since outdated, but just wanted to note that although "none" wasn't allowed in CSS 2, the final line of the example at https://www.w3.org/TR/CSS21/generate.html#counter-styles has

P:before         { content: counter(p, none) }

and the text above that example explicitly states "All the styles are allowed, including 'disc', 'circle', 'square', and 'none'."

@SebastianZ
Copy link
Contributor

Yes, it looks like the resolution here actually caused the inconsistency between the specs. 😅 See also the discussion in #5795.

Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants