Re: [css-counter-styles] interaction between 'negative' and 'pad' descriptors

On Fri, Apr 25, 2014 at 8:36 AM, L. David Baron <dbaron@dbaron.org> wrote:

> Two parts of the spec say inconsistent things about the interaction
> of the 'negative' and 'pad' descriptors.
>
> I will explain both of them in terms of how they apply to the
> definition of decimal-leading-zero in
> http://dev.w3.org/csswg/css-counter-styles/#simple-numeric , which
> has effectively:
>   pad: 2 '0';
>   negative: '-';
>
> http://dev.w3.org/csswg/css-counter-styles/#generate-a-counter says
> that 'pad' is applied first, and this is done by:
>   # 4. If the representation uses less symbols than specified in
>   #    the counter style’s pad descriptor, prepend symbols to the
>   #    representation as specified in the pad descriptor.
>

I suggest this item should be changed to something like "If there is any
pad available according to rules of 'pad' descriptor, prepend it." Then it
will be consistent.


> On the other hand,
> http://dev.w3.org/csswg/css-counter-styles/#counter-style-pad says:
>   # If the counter value is negative and the counter style is
>   # negative-capable, further reduce difference by the number of
>   # grapheme clusters in the counter style’s negative descriptor’s
>   # <symbol>(s).
>
> It seems both that these should be consistent, and that this
> shouldn't be defined in two places.
>
> I'd note that the testcase
>   data:text/html,<ol start="-1"
> style="list-style-type:decimal-leading-zero"><li><li><li></ol>
> behaves differently in Firefox and Chrome.


I also noticed this difference between Firefox and Chrome. This is an
undefined behavior in CSS 2.1 spec, and in some old version of the draft,
say the LCWD, decimal-leading-zero is defined as a fixed style which
matches the behavior of Chrome. However, as it has been changed, I think
Chrome may need to change their impl accordingly.

This was discussed here:
http://lists.w3.org/Archives/Public/www-style/2014Feb/0637.html

- Xidorn

Received on Thursday, 24 April 2014 23:57:00 UTC