W3C home > Mailing lists > Public > www-style@w3.org > December 2011

[css3-lists] Partial implementation

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Wed, 14 Dec 2011 15:04:05 +0100
Message-ID: <4EE8ACD5.5070801@kozea.fr>
To: "www-style@w3.org" <www-style@w3.org>
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.

Regards,
-- 
Simon Sapin
Received on Wednesday, 14 December 2011 14:04:41 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:47 GMT