W3C home > Mailing lists > Public > www-style@w3.org > September 2010

Re: [css3-lists] Specifying new list-types

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 17 Sep 2010 17:42:08 -0700
Message-ID: <AANLkTinV6YCdE6xcX4XT=Bw--kQf45bzHmL1vrU2sM4Q@mail.gmail.com>
To: Aryeh Gregor <Simetrical+w3c@gmail.com>
Cc: www-style list <www-style@w3.org>
On Sun, Sep 12, 2010 at 6:09 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Sun, Sep 12, 2010 at 5:29 PM, Aryeh Gregor <Simetrical+w3c@gmail.com> wrote:
>> On Wed, Sep 8, 2010 at 5:18 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>>> If I recall correctly, these seven types cover *every* list-style type
>>> currently in the spec* except for ethiopian-numeric (listed in the
>>> 'algorithmic' section, confusingly).
>>
>> The additive scheme won't cover Hebrew numbers above 1000, because the
>> separator (geresh) is needed between the thousands group and the
>> less-than-thousands group.
>
> Nah, it works just fine.  You just need one additional ability in
> additives that I haven't talked about yet, for glyphs that are only
> added if the original number was large enough, and which don't affect
> the value of the number (that is, they don't decrement the "current
> value" in the algorithm).
>
> You need this for Tamil, too.  It also helps with doing a more complex
> variant of English written numbers.

Since dbaron also expressed criticism, let me show exactly how the
Hebrew list-type would look in the UA style sheet (provided as escapes
to avoid confusing bidi issues in the display):

@counter-style hebrew {
  type: additive;
  range: 1 999999;
  suffix: ".";
  additive-glyphs: "\05ea\05ea\05e7" 900000, "\05ea\05ea" 800000,
"\05ea\05e9" 700000, "05ea\05e8" 600000, "\05ea\05e7" 500000, "\05ea"
400000, "\05e9" 300000, "\05e8" 200000, "\05e7" 100000, "\05e6" 90000,
"\05e4" 80000, "\05e2" 70000, "\05e1" 60000, "\05e0" 50000, "\05de"
40000, "\05dc" 30000, "\05db" 20000, "\05d9\05d8" 19000, "\05d9\05d7"
18000, "\05d9\05d6" 17000, "\05d8\05d6" 16000, "\05d8\05d5" 15000,
"\05d9" 10000, "\05d8" 9000, "\05d7" 8000, "\05d6" 7000, "\05d5" 6000,
"\05d4" 5000, "\05d3" 4000, "\05d2" 3000, "\05d1" 2000, "\05d0" 1000,
"\05f3" 1001 separator, "\05ea\05ea\05e7" 900, "\05ea\05ea" 800,
"\05ea\05e9" 700, "05ea\05e8" 600, "\05ea\05e7" 500, "\05ea" 400,
"\05e9" 300, "\05e8" 200, "\05e7" 100, "\05e6" 90, "\05e4" 80, "\05e2"
70, "\05e1" 60, "\05e0" 50, "\05de" 40, "\05dc" 30, "\05db" 20,
"\05d9\05d8" 19, "\05d9\05d7" 18, "\05d9\05d6" 17, "\05d8\05d6" 16,
"\05d8\05d5" 15, "\05d9" 10, "\05d8" 9, "\05d7" 8, "\05d6" 7, "\05d5"
6, "\05d4" 5, "\05d3" 4, "\05d2" 3, "\05d1" 2, "\05d0" 1;
}

Feels pretty verbose, but all of the systems that use different glyphs
for each digit in the number are like that.  This correctly handles
the 15/16 swap in all cases (both for 15/16 and 15000/16000), and adds
the geresh if the number is large enough, through the 'separator'
token on that group.

'separator' in a group means 3 things:
1. The group's weight is compared against the original counter value,
not the current value left in the algorithm.
2. The group's weight is not subtracted from the current value.
3. The group's glyph is added to the counter at most once.

~TJ
Received on Saturday, 18 September 2010 00:43:03 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:31 GMT