-
Notifications
You must be signed in to change notification settings - Fork 757
[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
Conversation
css-counter-styles-3/Overview.bs
Outdated
|
|
||
| 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. |
There was a problem hiding this comment.
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.
|
Amazing, thanks! I'll tag @fantasai since she's more familiar with this spec than I am. |
|
If this is
Then review should be easy and fast. |
|
svgeesus marked as non substantive for IPR from ash-nazg. |
|
@svgeesus |
|
@fantasai does this look good? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The introductory text could maybe be simplified a bit, but that can be done as a follow-up commit. Otherwise it looks pretty good. A few specific comments, and then two general ones on formatting:
- Remove all optional closing tags (e.g.
</td>,</tr>,</li>). - Use semantic line breaking.
css-counter-styles-3/Overview.bs
Outdated
| </dl> | ||
|
|
||
| The Chinese longhand styles are defined by almost identical algorithms | ||
| The <dfn dfn>Chinese</dfn> longhand styles are defined by almost identical algorithms |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't do this. If you need a subsection, create one (or more), but turning 'Chinese' into a definition for something that isn't the definition of 'Chinese' as a word is confusing.
css-counter-styles-3/Overview.bs
Outdated
| counter value. | ||
| </li></ol> | ||
|
|
||
| For all of these counter styles, the '@counter-style/suffix' is "、" U+3001, the '@counter-style/fallback' is ''cjk-decimal'', and the '@counter-style/negative' is given in the tables below, or else is the initial value of the descriptor. The '@counter-style/range' is ''-9999999999999999 9999999999999999'' (-10<sup>16</sup>+1 and 10<sup>16</sup>-1). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from the range, this is all duplicate of the earlier information, so let's just say all the descriptors are the same as for the limited range variants, aside from the range, which you're defining here.
|
(Feel free to contact me directly for re-review; GH notifications are a lost cause currently... Someday maybe I'll dig myself out of that.) |
|
Also thank you for drafting this up! <3 |
Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
|
Thanks for reviewing! |
|
I emailed @fantasai requesting re-review. Thanks both for your patience and for the PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few nits, but otherwise looks great!
Remember to SQUASH when merging (see drop-down on the side of the merge button).
css-counter-styles-3/Overview.bs
Outdated
| The Chinese longhand styles are defined out to 10k with a [[#limited-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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can drop this paragraph. It's already explained in the section above.
Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
Co-authored-by: fantasai <fantasai.bugs@inkedblade.net>
This attempts to define extended CJK longhand counter styles with clear implementation separation as discussed in #12300.
Closes #12300.
Change
This is mainly copy/pasted from an older version of the spec, which defined counter values outside this limited range and clearly separated required/optional implementations.
https://www.w3.org/TR/2013/WD-css-counter-styles-3-20130718/#extended-cjk
However, I made a slight change for the Korean range.
The former version of the spec defines a range between 0 and 10^16, yet the new version defines it down to a negative range because the current ED spec already defines the Korean negative range. See:
https://drafts.csswg.org/css-counter-styles/#limited-korean
The current browser behaviour
The cross-browser implementation for the limited one is consistent, but the extended one is inconsistent.
The new version of spec makes a clear difference between limited and optional, so that implementation and test separation makes sense.
The current implementation status that I could observe is as follows:
The Korean negative range is also supported in all 3 browsers.
FWIW, here's a Chromium implementation, according to the current ED spec (not the former one).
https://chromium.googlesource.com/chromium/src/+/d0be3bc63c34b2a904be717bfa3bf0be4e71eb45
WPT
WPT test will also be updated with:
ref: web-platform-tests/wpt#53312
cc: @nt1m