diff --git a/css-counter-styles-3/Overview.bs b/css-counter-styles-3/Overview.bs index 2f54f50dbfc..78573e8f943 100644 --- a/css-counter-styles-3/Overview.bs +++ b/css-counter-styles-3/Overview.bs @@ -1914,7 +1914,8 @@ Longhand East Asian Counter Styles as their characters are more difficult to alter into each other.
- The following table shows examples of these styles, particularly some ways in which they differ. + The following table shows examples of these styles, + particularly some ways in which they differ. @@ -1929,7 +1930,7 @@ Longhand East Asian Counter Styles + +
100 101 6001 -
''japanese-informal'' 〇 @@ -2030,22 +2031,25 @@ Longhand East Asian Counter Styles 壹佰 壹佰零壹 陸仟零壹 -
- Because opinions differ on how best to represent numbers 10k or greater + Because opinions differ on how best to represent numbers 10,000 or greater using the longhand CJK styles, - all of the counter styles defined in this section are defined to have a range of -9999 to 9999, - but implementations may support a larger range. + the implementation details are split into two sections. + The Korean and Japanese variants of these counter styles can, + if limited to the range of -9999 to 9999, + be expressed as ''@counter-style'' rules. + The Chinese variants use a [[#limited-chinese|specialized algorithm]], + regardless of range. + The required implementation is described in [[#limited-range-required]], + which defines the styles over these limited ranges, + and the optional implementation is described in [[#extended-range-optional]], + which defines them over a larger range using custom algorithms. Outside the implementation-supported range, the fallback is ''cjk-decimal''. - Note: Implementations are encouraged to research and implement counter representations beyond 10k - and report back to the CSS Working Group with data - when a generally-accepted answer is discovered. - Some previous research on this topic is contained in an earlier draft. - -

-Japanese: ''japanese-informal'' and ''japanese-formal''

+

Limited-range Implementation (required)

+
+Japanese: ''japanese-informal'' and ''japanese-formal''
japanese-informal @@ -2098,8 +2103,8 @@ Japanese: ''japanese-informal'' and ''japanese-formal'' -

-Korean: ''korean-hangul-formal'', ''korean-hanja-informal'', and ''korean-hanja-formal''

+
+Korean: ''korean-hangul-formal'', ''korean-hanja-informal'', and ''korean-hanja-formal''
korean-hangul-formal @@ -2154,8 +2159,8 @@ Korean: ''korean-hangul-formal'', ''korean-hanja-informal'', and ''korean-hanja- -

-Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-informal'', and ''trad-chinese-formal''

+
+Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-informal'', and ''trad-chinese-formal''
simp-chinese-informal @@ -2185,30 +2190,35 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info
The Chinese longhand styles are defined by almost identical algorithms - (specified as a single algorithm here, with the differences called out when relevant), + (specified as a single algorithm here, + with the differences called out when relevant), but use different sets of characters, as specified by the table following the algorithm.
    -
  1. If the counter value is 0, the representation is the character for 0 - specified for the given counter style. Skip the rest of this algorithm. +
  2. If the counter value is 0, + the representation is the character for 0 specified for the given counter style. + Skip the rest of this algorithm. -
  3. Initially represent the counter value as a decimal number. For each - digit that is not 0, append the appropriate digit marker to the digit. +
  4. Initially represent the counter value as a decimal number. + For each digit that is not 0, + append the appropriate digit marker to the digit. The ones digit has no marker. -
  5. For the informal styles, if the counter value is between ten and - nineteen, remove the tens digit (leave the digit marker). +
  6. For the informal styles, + if the counter value is between ten and nineteen, + remove the tens digit (leave the digit marker). -
  7. Drop any trailing zeros and collapse any remaining zeros into a single - zero digit. +
  8. Drop any trailing zeros + and collapse any remaining zeros into a single zero digit. -
  9. Replace the digits 0-9 with the appropriate character for the given - counter style. Return the resultant string as the representation of the - counter value. +
  10. Replace the digits 0-9 with the appropriate character + for the given counter style. + Return the resultant string as the representation of the counter value.
- For all of these counter styles, the '@counter-style/suffix' is "、" U+3001, + For all of these counter styles, + the '@counter-style/suffix' is "、" U+3001, the '@counter-style/fallback' is ''cjk-decimal'', the '@counter-style/range' is ''-9999 9999'', and the '@counter-style/negative' value is given in the table of symbols for each style. @@ -2225,7 +2235,7 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info simp-chinese-formal trad-chinese-informal trad-chinese-formal - + Digit 0 @@ -2311,7 +2321,7 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info 负 U+8D1F 負 U+8CA0 負 U+8CA0 - +
@@ -2361,6 +2371,380 @@ Chinese: ''simp-chinese-informal'', ''simp-chinese-formal'', ''trad-chinese-info
+

Extended Implementation (optional)

+ + Some counter styles described in earlier chapters have been limited to an artifically small (though still useful) range + to reduce the overall complexity of the spec and the task of implementing those styles. + However, some implementations might consider the extra complexity worthwhile + for the additional range it offers to authors. + To accomodate this, + this section describes how to extend the limited counter-styles to a larger range. + + This entire section is normative, but optional. + User-agents may ignore it and still be conformant. + If a user-agent implements some of the extended forms described in this section, + they must be implemented as described here. + + + All of the Chinese, Japanese, and Korean styles are defined here + for all numbers between -1016 and 1016, 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. + +
    +
  1. If the counter value is 0, + the representation is the character for 0 specified for the given counter style. + Skip the rest of this algorithm. + +
  2. Initially represent the counter value as a decimal number. + Starting from the right (ones place), + split the decimal number into groups of four digits. + +
  3. For each group with a non-zero value, + append the appropriate group marker to the group. + The ones group has no marker. + +
  4. Within each group, + for each digit that is not 0, + append the appropriate digit marker to the digit. + The ones digit of each group has no marker. + +
  5. Drop ones: +
      +
    • For the Chinese informal styles, + for any group with a value between ten and nineteen, + remove the tens digit (leave the digit marker). + +
    • For the Japanese informal and Korean informal styles, + if any of the digit markers are preceded by the digit 1, + and that digit is not the first digit of the group, + remove the digit (leave the digit marker). + +
    • For Korean informal styles, + if the value of the ten-thousands group is 1, + drop the digit (leave the digit marker). +
    + + +
  6. Drop zeros: +
      +
    • For the Japanese and Korean styles, + drop all zero digits. + +
    • For the Chinese styles, + drop any trailing zeros for all non-zero groups + and collapse (across groups) each remaining consecutive group of zeros + into a single zero digit. +
    + +
  7. For the Korean styles, + insert a space (" " U+0020) between each group. + +
  8. Replace the digits 0-9 with the appropriate character + for the given counter style. + Return the resultant string as the representation of the counter value. +
+ + For all of these counter styles, the descriptors are the same as for the [[#limited-range-required|limited range variants]], + except for the '@counter-style/range', which is ''calc(-1 * pow(10, 16) + 1) calc(pow(10, 16) - 1)''. + + The following tables define the characters used in these styles: + + + + + + + + + + + + + + + + + + + + + + +
Values + Codepoints +
simp-chinese-informal + simp-chinese-formal + trad-chinese-informal + trad-chinese-formal +
Digit 0 + 零 U+96F6 + 零 U+96F6 + 零 U+96F6 + 零 U+96F6 +
Digit 1 + 一 U+4E00 + 壹 U+58F9 + 一 U+4E00 + 壹 U+58F9 +
Digit 2 + 二 U+4E8C + 贰 U+8D30 + 二 U+4E8C + 貳 U+8CB3 +
Digit 3 + 三 U+4E09 + 叁 U+53C1 + 三 U+4E09 + 參 U+53C3 +
Digit 4 + 四 U+56DB + 肆 U+8086 + 四 U+56DB + 肆 U+8086 +
Digit 5 + 五 U+4E94 + 伍 U+4F0D + 五 U+4E94 + 伍 U+4F0D +
Digit 6 + 六 U+516D + 陆 U+9646 + 六 U+516D + 陸 U+9678 +
Digit 7 + 七 U+4E03 + 柒 U+67D2 + 七 U+4E03 + 柒 U+67D2 +
Digit 8 + 八 U+516B + 捌 U+634C + 八 U+516B + 捌 U+634C +
Digit 9 + 九 U+4E5D + 玖 U+7396 + 九 U+4E5D + 玖 U+7396 +
Second Digit Marker + 十 U+5341 + 拾 U+62FE + 十 U+5341 + 拾 U+62FE +
Third Digit Marker + 百 U+767E + 佰 U+4F70 + 百 U+767E + 佰 U+4F70 +
Fourth Digit Marker + 千 U+5343 + 仟 U+4EDF + 千 U+5343 + 仟 U+4EDF +
Second Group Marker + 万 U+4E07 + 万 U+4E07 + 萬 U+842C + 萬 U+842C +
Third Group Marker + 亿 U+4EBF + 亿 U+4EBF + 億 U+5104 + 億 U+5104 +
Fourth Group Marker + 万亿 U+4E07 U+4EBF + 万亿 U+4E07 U+4EBF + 兆 U+5146 + 兆 U+5146 +
Negative Sign + 负 U+8D1F + 负 U+8D1F + 負 U+8CA0 + 負 U+8CA0 + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Values + Codepoints +
japanese-informal + japanese-formal +
Digit 0 + 〇 U+3007 + 零 U+96F6 +
Digit 1 + 一 U+4E00 + 壱 U+58F1 +
Digit 2 + 二 U+4E8C + 弐 U+5F10 +
Digit 3 + 三 U+4E09 + 参 U+53C2 +
Digit 4 + 四 U+56DB + 四 U+56DB +
Digit 5 + 五 U+4E94 + 伍 U+4f0D +
Digit 6 + 六 U+516D + 六 U+516D +
Digit 7 + 七 U+4E03 + 七 U+4E03 +
Digit 8 + 八 U+516B + 八 U+516B +
Digit 9 + 九 U+4E5D + 九 U+4E5D +
Second Digit Marker + 十 U+5341 + 拾 U+62FE +
Third Digit Marker + 百 U+767E + 百 U+767E +
Fourth Digit Marker + 千 U+5343 + 阡 U+9621 +
Second Group Marker + 万 U+4E07 + 萬 U+842C +
Third Group Marker + 億 U+5104 + 億 U+5104 +
Fourth Group Marker + 兆 U+5146 + 兆 U+5146 +
Negative Sign + マイナス U+30DE U+30A4 U+30CA U+30B9 + +
+ + + + + + + + + + + + + + + + + + + + + + + +
Values + Codepoints +
korean-hangul-formal + korean-hanja-informal + korean-hanja-formal +
Digit 0 + 영 U+C601 + 零 U+96F6 + 零 U+96F6 +
Digit 1 + 일 U+C77C + 一 U+4E00 + 壹 U+58F9 +
Digit 2 + 이 U+C774 + 二 U+4E8C + 貳 U+8CB3 +
Digit 3 + 삼 U+C0BC + 三 U+4E09 + 參 U+53C3 +
Digit 4 + 사 U+C0AC + 四 U+56DB + 四 U+56DB +
Digit 5 + 오 U+C624 + 五 U+4E94 + 五 U+4E94 +
Digit 6 + 육 U+C721 + 六 U+516D + 六 U+516D +
Digit 7 + 칠 U+CE60 + 七 U+4E03 + 七 U+4E03 +
Digit 8 + 팔 U+D314 + 八 U+516B + 八 U+516B +
Digit 9 + 구 U+AD6C + 九 U+4E5D + 九 U+4E5D +
Second Digit Marker + 십 U+C2ED + 十 U+5341 + 拾 U+62FE +
Third Digit Marker + 백 U+BC31 + 百 U+767E + 百 U+767E +
Fourth Digit Marker + 천 U+CC9C + 千 U+5343 + 仟 U+4EDF +
Second Group Marker + 만 U+B9CC + 萬 U+842C + 萬 U+842C +
Third Group Marker + 억 U+C5B5 + 億 U+5104 + 億 U+5104 +
Fourth Group Marker + 조 U+C870 + 兆 U+5146 + 兆 U+5146 +
Negative Sign + 마이너스 U+B9C8 U+C774 U+B108 U+C2A4 + +
+