Re: [CSS3-content] [css3-lists] [css3-page] Implied counter-increment

fantasai wrote:
> 
> So far in CSS3 I've come across two implied counters:
>   pages     (CSS3 Paged Media)
>   list-item (CSS3 Lists)
> 
> The 'pages' counter is incremented on each page box, as if
>   @page { counter-increment: pages; }
> were implied.
> 
> The 'list-item' counter is incremented on each list-item, as if
>   :select-all-elements-with-display-list-item { counter-increment: 
> list-item; }
> were implied.
> 
> My question is, what is the specified value of counter-increment on
> these boxes? If I specify "counter-increment: mycounter;" does the
> implied counter stop incrementing?
> 
> Also, do we need to add a 'normal' or 'auto' value to counter-increment
> so that we can distinguish between
>   counter-increment: none; /* doesn't increment implied counters */
> and
>   counter-increment: normal; /* only increments any implied counters */
> ?

s/pages/page/g;

The relevant text in CSS3 Page currently says:
  # In the absence of a ‘counter-reset’ or ‘counter-increment’ for a
  # counter named ‘page’, the UA must automatically create and increment
  # such a counter as if "@page { counter-increment: page;}" were specified."

This means that if the author specifies
   @page { counter-increment: mycounter; }
or
   @page { counter-increment: none; }
the 'page' counter is still created and incremented, but if the author specifies
   @page { counter-reset: page; counter-increment: none; }
or
   @page { counter-increment: page 0; }
the 'page' counter is created but not incremented.

The relevant text in CSS3 Lists currently says:
  # To declare a list item, the 'display' property should be set to 'list-item'.
  # This, in addition to generating a ::marker pseudo-element and enabling the
  # properties described below for that element, causes that element to increment
  # the list item counter list-item. (This does not affect the specified or
  # computed values of the counter properties.)
  #
  # The list-item counter is a real counter, and can be directly affected using
  # the 'counter-increment' and 'counter-reset' properties. It can also be used
  # in the counter() and counters() function forms.

This means that if the author specifies li { display: list-item; } and
   li { counter-increment: mycounter; }
or
   li { counter-increment: none; }
or
   li{ counter-reset: list-item; counter-increment: none; }
the 'list-item' counter is still created and incremented, but if the author specifies
   li { counter-increment: list-item 0; }
the counter is created but not incremented.

The behavior for these two counters is slightly different, but should be consistent.

I think at this point I'm leaning towards changing the 'page' counter to behave like
the 'list-item' counter, and introducing an 'inhibit' value for counter-increment that
will cause any implied counters to not be incremented.

The proposed change to CSS3 Paged Media would be to replace the above text with
   | The UA must automatically create and increment an implied counter named 'page'
   | as if "@page { counter-increment: page;}" were specified. This implied counter
   | does not affect the specified or computed values of the counter properties;
   | however it is a real counter and can be directly affected using the
   | 'counter-increment' and 'counter-reset' properties and can be used in the
   | counter() and counters() function forms.
   |
   | Example:
   |   @page titlepage { counter-increment: page 0; }
   |   This suppresses the 'page' counter increment on 'titlepage' named pages.

~fantasai

Received on Wednesday, 17 October 2007 18:18:40 UTC