W3C home > Mailing lists > Public > www-style@w3.org > September 2010

[CSS21] 12.5 Lists: numbering undefined, implementations differ

From: Peter Moulder <peter.moulder@monash.edu>
Date: Wed, 08 Sep 2010 07:28:15 +1000
To: www-style@w3.org
Message-id: <20100907212815.GA8372@bowman.infotech.monash.edu.au>
By "numbering" here, I mean the number as distinct from what string to display
for a given number.

As far as I've seen, there's no text saying what number to give for a given
list-item.  The closest I've seen is an example of an <li> list in an HTML
document; but note that that's an HTML list, whose numbering is [more or less]
defined by the HTML spec, and so doesn't tell us much about how <span
style="display:list-item"> should be numbered, or how list-items in generic XML
documents should be numbered (when styled by CSS).

I append a document with a few tests, to see what existing user agents are doing.
Of the four user agents I tested, no two do the same thing.

In the implementations I looked at, it seems that in an HTML document, <ol> is
special for display:list-item elements even other than <li>; and numbering of
list-items that are descendents of an <ol> element had less variation in

(Looking at WebCore source code, it seems that the test is ol or ul.
A reasonable starting point for the relevant code in WebKit would be

<ol> loses its magic in generic XML documents in each of the user agents
whose generic XML behaviour I tested.

Relevant to discussion would be http://www.w3.org/TR/css3-lists (search for
counter; though the main point is that display:list-item implicitly increments
a counter called list-item), and its dependency
http://www.w3.org/TR/css3-content/ for most of the information regarding
numbering.  Whether intentional or not, the numbering appears to be order
within document tree, as modified by pseudo-elements such as :before and :after
(by my reading, though it isn't very clear about this), and as modified by
display:none, but not modified by run-in or 'caption-side' or anonymous block
box processing; and as modified by the suppression of children of
'table-column' boxes and suppression of non-'table-column' children of
'table-column-group', but not modified by the rest of anonymous table object
creation rules.  (Anonymous block processing and anonymous table object
creation don't affect order of boxes/elements, but would be relevant to counter

Note that both css3-lists and css3-content are at working-draft status.

Possibly the resolution to this issue would be to note explicitly that CSS2.1
does not define the number assigned to a given list-item, and that this is
expected to be defined by a future level of CSS, probably making some mention
of css3-lists (already in refs.html as #ref-CSS3LIST).

I attach the HTML version of the tests, while the corresponding XML version
(and its associated stylesheets, and the HTML version for good measure) is at

N.B. One of the tests caused a segfault in a WebKit-based browser; if that
happens then comment out the :before rule in the stylesheet.


Received on Tuesday, 7 September 2010 21:28:47 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:34:41 UTC