- From: Simon Sapin <simon.sapin@kozea.fr>
- Date: Wed, 14 Dec 2011 15:04:05 +0100
- 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 UTC