auto-numbering in CSS (was: content property)
I suggested counter properties in CSS such that every element has an
associated counter. By default, the counter has a value of 1 decimal,
but can be explicitly declared with any initial value and type.
An element's counter value can be referenced by an offspring using the
counter property - which causes the counter to be incremented - or by
using the count property - which does not increment the counter. An
element's counter is only incremented when accessed by an offspring.
Paul Prescod suggested the numbering method used in DSSSL, whereby an
element's number within the hierarchy is known. There is no explicit
incrementing of counters - if an element is the sixth sibling in a
list, its child-number is 6.
The DSSSL method strikes me as a more elegant solution than my last
insofar as my solution could require elements to be declared for the
sole purpose of counting other elements. A few questions, though:
1. HTML documents might be part of a larger document. How do you
specify an element's start number using the DSSSL method?
2. How to specify the number type (i.e. decimal, lower-alpha, etc.)?
3. What's the proper syntax for referencing an ancestor element's
4. Would an element's number include occurrences of its subclasses?
(i.e. would P.first be included in P's child-count?)