Skip to content

[css-counter-styles] Define extended CJK longhand counter styles range #12383

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sakupi01
Copy link
Member

@sakupi01 sakupi01 commented Jun 22, 2025

This attempts to define extended CJK longhand counter styles with clear implementation separation as discussed in #12300.

This is mainly copy/pasted from an older version of the spec defined counter values outside this limited range.
https://www.w3.org/TR/2013/WD-css-counter-styles-3-20130718/#extended-cjk

Closes #12300.

cc: @nt1m


The Chinese longhand styles are defined out to 10k with a [=Chinese|specialized algorithm=], while the Japanese and Korean longhand styles are defined similarly as ''additive'' styles. However, these styles are defined out to 10<sup>16</sup> in common usage. The following section describes an alternative algorithm for these styles.

All of the Chinese, Japanese, and Korean styles are defined for all numbers between -10<sup>16</sup> and 10<sup>16</sup>, exclusive. For numbers outside this range, the ''cjk-decimal'' style is used. All of the styles are defined by almost identical algorithms (specified as a single algorithm here, with the differences called out when relevant), but use different sets of characters. The list following the algorithm gives the name of each counter style using this algorithm, and the individual character sets used by each style.
Copy link
Member Author

@sakupi01 sakupi01 Jun 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The former version of the spec defines a range between 0 and 10^16 for Korean, yet the new version defines it down to a negative range because the current ED spec already defines the Korean negative range.
https://drafts.csswg.org/css-counter-styles/#limited-korean

FWIW, the Korean negative range has been implemented as well. See: https://issues.chromium.org/issues/40504326#comment75

If there's any clue why the former version was limited to the positive range for Korean, and why it still needs to be regulated in the current extended version, please let me know.

@nt1m
Copy link
Member

nt1m commented Jun 22, 2025

Amazing, thanks! I'll tag @fantasai since she's more familiar with this spec than I am.

@nt1m nt1m requested a review from fantasai June 22, 2025 16:51
@svgeesus
Copy link
Contributor

If this is

  1. What the spec used to say
  2. What (at least one) implementation does
  3. What WPT tests for

Then review should be easy and fast.

@w3cbot
Copy link

w3cbot commented Jun 23, 2025

svgeesus marked as non substantive for IPR from ash-nazg.

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

Successfully merging this pull request may close these issues.

[css-counter-styles] CJK longhand counter styles should support values beyond 9999
4 participants