Re: [css-counter-styles] Behavior of zero in system 'alphabetic' & 'symbolic'

On Tue, Feb 25, 2014 at 8:49 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Sun, Feb 23, 2014 at 12:12 AM, Xidorn Quan <quanxunzhen@gmail.com> wrote:
>> Hi,
>>
>> The spec says, 'alphabetic' and 'symbolic' are "defined only over
>> strictly positive counter values", while they are also
>> negative-capable. Consequently, if an author defines a style:
>>
>> @counter-style a { system: symbolic; range: -10 10; symbols: a; }
>>
>> and use value -2 - 2, then, according to the rules, he will get: -aa,
>> -a, 0, a, aa. The zero in the middle seems to be strange. I propose
>> that we could make the defination cover zero, and generate an empty
>> sequence for zero.
>
> I agree that the 0 in the middle is strange, but I think it's even
> stranger to generate an empty counter representation.  Note that I'd
> also have to then hook into the rest of the algorithm, so that it
> doesn't get a prefix, suffix, or pad added to it.

I don't think it is necessary to hook into the rest. Other descriptors
could be processed as normal. In fact, you remind me that, it could be
combined with pad to make it meaningful. For example, we can define
the following counter style:

@counter-style { system: symbolic; range: -10 10; symbols: a; pad: 1 z; }

so that we could have -aa, a, z, a, aa. However, if you don't allow
the symbolic to cover zero, to achieve the same effect, the author
will have to do some fallback magic.

- Xidorn

Received on Monday, 24 February 2014 22:24:37 UTC