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

counter-reset: list-item - is not fully implemented in Safari WebKit #23070

Open
glmvc opened this issue May 11, 2024 · 3 comments
Open

counter-reset: list-item - is not fully implemented in Safari WebKit #23070

glmvc opened this issue May 11, 2024 · 3 comments
Labels
data:css 🎨 Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS

Comments

@glmvc
Copy link

glmvc commented May 11, 2024

What type of issue is this?

Incorrect support data (example: BrowserX says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

There is a bug entry in WebKit stating "counter-reset: list-item is not fully implemented".

What browsers does this problem apply to, if applicable?

Safari (tested in version 17.4)

What did you expect to see?

A note that list-item for the CSS counter-reset property is not fully implemented in Safari.

Did you test this? If so, how?

counter-reset: list-item seems to work for generated ::marker content in Safari, but results in incorrect values for content generated with the counter() function, for example.

This incorrect behavior can be observed in this CodePen example: https://codepen.io/glmvc/pen/dyLBEgP

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

Related site on MDN where the compat-data is used in the browser compatibility table:
https://developer.mozilla.org/en-US/docs/Web/CSS/counter-reset

Do you have anything more you want to share?

No response

MDN URL

No response

MDN metadata

No response

@queengooborg queengooborg added the data:css 🎨 Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS label May 11, 2024
@myfonj
Copy link
Contributor

myfonj commented May 16, 2024

Don't have real Safari at hand, but in Playwright's AppleWebKit/605.1.15 and even any Chromium-derived browser on my machine touching list-item by either counter-reset or counter-set does not seem to have any effect at all:

data:text/html,
on LI:
<ol>
 <li>Expected: 1.
 <li>Expected: 2.
 <li style="counter-reset: list-item 10;">Expected: 11.
</ol>

on OL:

<ol style="counter-reset: list-item 10;">
 <li>Expected: 11.
 <li>Expected: 12.
 <li>Expected: 13.
</ol>

(sandbox)

Anything but Firefox still counts 1 - 2 - 3 in both lists:

Both list goes 1 - 2 - 3; user agent string contains Chrome/122

Correct rendering in Firefox:

First list is 1 - 2 - 11, second 11 - 12 - 13; user agent string contains Firefox/127

@glmvc
Copy link
Author

glmvc commented May 16, 2024

@myfonj Thanks for your insights. There seems to be a bug in Chromium that affects the ::marker content. Check following screenshot:
list-item-counter

Safari on macOS seems to generate the ::marker content correctly (although Safari has no "real" support to adapt ::marker content with CSS), but the values of the counter() function for content are different compared to Firefox and Chrome:
list-item-content

Here is a complete example on CodePen showing different scenarios.
Please note that I use the latest stable browser versions for testing. As of May 2024.

@myfonj
Copy link
Contributor

myfonj commented May 16, 2024

@glmvc these are great demonstrations, and man, what Safari does is wild! My even wilder guess is that they are 1) incrementing the counter precisely on the ::marker (instead of on the li) and 2) in their implementation, ::marker comes after ::after. That's hilarious! XD

Anyway, given all the evidence here, I think it is safe to declare support of list-item under counter-* stuff in Safari and even Chrome as incomplete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:css 🎨 Compat data for CSS features. https://developer.mozilla.org/docs/Web/CSS
Projects
None yet
Development

No branches or pull requests

3 participants