Skip to content

[css-lists][cssom] Should the serialization of counter-reset/increment include default values? #2635

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

Closed
squelart opened this issue May 1, 2018 · 7 comments

Comments

@squelart
Copy link
Contributor

squelart commented May 1, 2018

In the CSSOM general principles of serialization: https://drafts.csswg.org/cssom/#serializing-css-values

If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.

This would suggest that if a counter-reset or counter-increment was declared with no values, its serialization should not include the default value (resp. 0 or 1).

E.g.: <body style="counter-increment: abc" onload="alert(document.body.style.counterIncrement)"> should display "abc".
Edge 42 does this.
However Firefox 60, Chrome 66, and Safari 11.1 currently display "abc 1".

So, should the general rule be followed, or should there be a special case for counters? (Or something else?)

@squelart
Copy link
Contributor Author

squelart commented May 1, 2018

This should probably have the "css-list-3" label (can't seem to be allowed to add it)

See initial Firefox-related discussion: https://bugzilla.mozilla.org/show_bug.cgi?id=1408257

Note: Newbie here, sorry if I used the wrong vocabulary above!

@emilio emilio added the css-lists-3 Current Work label May 1, 2018
@upsuper
Copy link
Member

upsuper commented May 7, 2018

Given the principle, I believe the default value should be omitted. We should add a web-platform test and file bugs to the corresponding browsers.

@tabatkins
Copy link
Member

Yeah, should be omitted unless there's web-compat to deal with.

@fantasai
Copy link
Collaborator

Fixed in 848b8c6

@fantasai
Copy link
Collaborator

Marked "Obvious Bugfix" because we're supposed to stay in sync with 2.1.

@ewilligers
Copy link
Contributor

Fixed in 848b8c6

I don't see how that change addresses this issue.

@fantasai
Copy link
Collaborator

fantasai commented Aug 6, 2019

@ewilligers Yeah, I don't know why I posted that comment here. :/ Must've mixed up this issue with #4163.

That said, I don't think any edits are needed here, so marking the issue closed.

@fantasai fantasai closed this as completed Aug 6, 2019
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

6 participants