Re: [css3-lists] Partial implementation

On Wed, Dec 14, 2011 at 6:04 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Hi,
>
> WeasyPrint just shipped a 0.3 version with a complete implementation of
> chapter 12 of CSS 2.1 (Generated content, automatic numbering, and lists).
>
> This by itself is nothing new, but the implementation is based on the
> algorithms in Lists 3, and defers to Lists 3 for behavior that is not
> specified in 2.1 (eg. alphabetic counters past the alphabet size, negative
> values, more precise scoping rules, ...)
>
> The CSS parser does not support @counter-style rules at all, but these can
> be trivially translated to Python data structures to add more counter
> styles. Only the pre-defined styles that exist in CSS 2.1 are included by
> default.
>
> The source code is available. The counters.py module generates string
> representations of counter values with various styles, while build.py
> implements related properties, counter scoping etc. (The later does a lot
> more, it’s a bit more messy.)
>
> https://github.com/Kozea/WeasyPrint/blob/master/weasy/formatting_structure/counters.py
> https://github.com/Kozea/WeasyPrint/blob/master/weasy/formatting_structure/build.py
>
> Lists 3 is not yet in CR where implementations are called for, but I hope
> that this one can help test ideas or otherwise help the spec.

CR is merely when we call for implementations to flush out any
remaining bugs that we haven't figured out just by staring at the spec
really hard.  Implementations before that point are welcomed for the
experience, as long as implementors are willing to change their
implementations as things change in the spec.

By the way, if you haven't already found it, you can easily track
changes to Lists by following
<http://www.xanthir.com/feed/public-css-commits/?spec=css3-lists> in
your RSS reader (add "&format=html" for a human-readable version of
the page).

~TJ

Received on Wednesday, 14 December 2011 15:54:03 UTC