Re: [css3-lists] counter-reset and counter-increment

On Fri, Dec 2, 2011 at 10:17 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Hi,
>
> The counter-reset and counter-increment properties are not defined in Lists
> and Counters Level 3, while they are mentioned in the prose (in section 2)
> and used in examples.
>
> They are defined in CSS3 Content, but that spec is marked as obsolete and
> the definition seems to be the same as in CSS 2.1. Lists 3 should explicitly
> link to either 2.1 or Content 3 for defining these properties.

Yeah, I was thinking that I should probably define them in Lists.
I'll see about doing so today.

> Also, section 12.5.1 of CSS 2.1 reads:
>
> """
> CSS 2.1 does not define how the list numbering is reset and incremented.
> This is expected to be defined in the CSS List Module [CSS3LIST].
> """
>
> Lists 3 defines that lists are based on the list-item counter, and that
> `display: list-item` increments that counter. However there is nothing
> normative about resetting this counter. Only the sample stylesheet suggests
> that or and ul elements reset the list-item counter.
>
> Does this mean that the counter is not reset anywhere else unless author or
> user stylesheets have a counter-reset rule? I’m thinking of lists made
> without ul/ol/li elements but with `display: list-item`.

The following line from Content should apply: "If ‘counter-increment’
refers to a counter that is not in the scope (see below) of any
‘counter-reset’, the counter is assumed to have been reset to 0 by the
root element.".

I don't believe this is actually what browsers do, though.  WebKit, at
least, has something more complex; I think we might be assuming that
the parent element resets the counter to 0, rather than the root.
I'll need to do some testing to figure out exactly what should be
specified.

In any case, something like the above applies - counters that have
never been explicitly reset are still implicitly reset in some way.

~TJ

Received on Friday, 2 December 2011 18:26:13 UTC