1. Introduction 1.1. Project/Component Working Name: CSSutils 1.2. Name of Document Author/Supplier: Jerry Yu 1.3. Date of This Document: 10/23/2008 1.4. Name of Major Document Customer(s)/Consumer(s): 1.4.1. The PAC or CPT you expect to review your project: Solaris PAC 1.4.2. The ARC(s) you expect to review your project: LSARC 1.4.3. The Director/VP who is "Sponsoring" this project: Robert O'Dea 1.4.4. The name of your business unit: Software - OPG 1.5. Email Aliases: 1.5.1. Responsible Manager: harry.lu@sun.com 1.5.2. Responsible Engineer: jijun.yu@sun.com 1.5.3 Marketing Manager: dan.robert@sun.com 1.5.4. Interest List: desktop-discuss@opensolaris.org 2. Project Summary 2.1. Project Description: CSSutils is a Python package to parse and build CSS Cascading Style Sheets. It supports DOM only, and not any rendering facilities. 4. Technical Description: 4.1. Details: CSSutils is based upon and partly implementing the following W3C specifications (see references): * CSS2.1 * CSS2.1 Errata - For example, the definition of CHARSET_SYM tokens. * CSS3 Module: Syntax - CSSutils has some support for CSS3, but as this is not final some parts are from CSS2.1. * MediaQueries - MediaQueries are part of stylesheets. MediaList, used in @import and @media rules. * Namespaces. * Selectors - The selector syntax defined here (and not in CSS 2.1) should be parsable with CSSutils. * DOM Level 2 Style CSS - DOM for package css. * DOM Level 2 Style Stylesheets - DOM for package stylesheets. * CSSOM - A few details (mainly the NamespaceRule DOM) is taken from here. The CSSutils tokenizer is a customized implementation of CSS3 Module: Syntax (W3C Working Draft 13 August 2003) which itself is based on the CSS 2.1 tokenizer. It tries to be as compliant as possible but uses some (helpful) parts of the CSS 2.1 tokenizer. CSSutils is neither CSS 2.1 nor CSS 3 compliant but tries to at least be able to parse both grammars including some more real world cases (some CSS hacks are actually parsed and serialized). Both official grammars are not final nor bugfree but still feasible. CSSutils aim is not to be fully compliant to any CSS specification (the specifications seem to be in a constant flow anyway) but CSSutils should be able to read and write as many as possible CSS stylesheets "in the wild" while at the same time implement the official APIs which are well documented. Some minor extensions are provided as well. 4.2. Interfaces: Exported Interfaces Stability Comments ------------------- -------------- ----------------------- /usr/bin/csscapture Volatile Retrieve all CSS stylesheets including embedded for a given URL /usr/bin/csscombine Volatile Combine sheets referred to by @import rules in a given CSS proxy sheet into a single new sheet /usr/bin/cssparse Volatile Utility script to parse given filename or string /usr/lib/python2.4/vendor-packages/cssutils-0.9.5.1-py2.4.egg-info/* Volatile Info files /usr/lib/python2.4/vendor-packages/cssutils/* Volatile Implementation of the specification and API. Refer to additional_materials for API documentation. /usr/lib/python2.4/vendor-packages/encutils/* Volatile Encoding detection collection for python /usr/lib/python2.4/vendor-packages/tests/* Volatile Unit test cases SUNWpython-cssutils Uncommitted Package name Imported Interfaces Stability Comments --------------- --------------- ----------------------- Python External PSARC/2005/532 Python Evolving Migration from /usr/sfw to /usr and upgrade to v2.4.x 4.3. Doc Impact: Man page is needed. 4.4. Packaging & Delivery: SUNWpython-cssutils - the package for CSSutils. 4.5. Dependencies: None. 4.6. L10N Impact: The Desktop team and the G11N are working together to evaluate and provide I18N/L10N support. 4.7 Security Impact: None. 5. Reference Documents: CSSutils community: http://cthedot.de/cssutils/ http://code.google.com/p/cssutils/ CSS2.1 specification: http://www.w3.org/TR/CSS21/ Errata CSS level 2 revision 1 specification: http://www.w3.org/Style/css2-updates/CR-CSS21-20070719-errata.html CSS3 specification: http://www.w3.org/TR/css3-syntax/ Media Queries specification: http://www.w3.org/TR/css3-mediaqueries/ CSS Namespace Module specification: http://dev.w3.org/csswg/css3-namespace/ Selectors specification: http://www.w3.org/TR/css3-selectors/ DOM CSS specification: http://www.w3.org/TR/DOM-Level-2-Style/css.html Document Object Model Style Sheets specification: http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html Cascading Style Sheets Object Model (CSSOM) specification: http://dev.w3.org/csswg/cssom/ API documentations: Refer to additional_materials