W3C home > Mailing lists > Public > www-style@w3.org > April 2014

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

From: Xidorn Quan <quanxunzhen@gmail.com>
Date: Fri, 25 Apr 2014 09:55:52 +1000
Message-ID: <CAMdq69_G87uzf7AhA_bf2TV+Qj5tFj1=MZQhzYdBGWJtqCDTdQ@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style list <www-style@w3.org>
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:

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

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:42 UTC