CssValidator
W3C CSS Validator / Validation Service
In a Nutshell
The CSS Validator is a free software developed by W3C, and a free online service .
Project Logistics
Project Host
W3C is hosting and leading this project, and has been since its origin in 2002.
Online Services
Main service: https://jigsaw.w3.org/css-validator/
Source Code / Download
Source at https://github.com/w3c/css-validator/
Installation Notes / Discussions
http://jigsaw.w3.org/css-validator/DOWNLOAD.html
(use the source from github to be sure to get the latest version)
Discussion / Development / Feedback Fora
Bug Tracking
User Mailing-list www-validator-css@w3.org
Developer Mailing-list public-qa-dev@w3.org
- Archive
- shared with other projects, hackers' forum
- ~40 subscribers
- ~30 messages/month
Development
Languages Used
java.
The code uses a lot of classes, which can be a bit overwhelming for a beginner, but most of the code is fairly simple. Some parts, however, are rather complex and/or would need a rewrite.
Translations
The CSS validator is translated in more than 10 languages. The translation kit contains instructions for translation, as well as two types of files:
- static documentation (HTML, encoded as utf-8) pages
- a properties (text) file listing the terms used in the validator, and their value in english, to be translated
Once a translation is submitted it is:
- added to GitHub
- tested: run (on the dev server) java org.w3c.css.index.TranslationTableGenerator.java will generate the translation table
The translation table is also used to track an need for translation updates when the code changes.
Development Speed
The development speed is fairly slow, with bursts of development when w3c staff gets some time or when interns get associated to the project.
The project is localised in many languages (10 at the time of this writing), and relies on community to get new/updated translations, which makes it slow to push any change to production.
As a result, we have managed to have 1 major release per year in the past few years.
Test Suite
There is a test suite
cd /usr/local/Jigsaw/Jigsaw/WWW/css-validator/ for i in `ls autotest/testsuite/xml/*.xml | sed 's,autotest/testsuite/xml/,,' | sed 's,.xml,,'`; do ./autotest/autotest.sh autotest/testsuite/xml/$i.xml; mv autotest/results/results.html autotest/results/$i.html; done
Plan and Vision
High-Level Objectives
- Provide the web with a one-stop service for Web Quality check
- Help raise quality for (m)any kind(s) of Web content
- Build a positive culture of Web Quality
- Future-proof our services (new formats, new usage)
- Leverage Communities energy
- Remain the trusted source by professionals
- Find the right balance between accuracy and user-friendliness
Roadmap
- New engine: The CSS validator is currently suffering from its usage of a relatively complex java engine for parsing and validation. With help, the engine could be rewritten using either java or a different technology (e.g javascript), while using the existing test suite and localization resources to keep the tool reliable and multilingual.
- move from a per-profile only validation to a checking of "all of CSS properties" by default, mirroring the current consensus in CSS Working Group that there is only "one CSS".
- Add major features, such as accessibility checker (color contrast analysis) and browser bug check (your CSS is valid, but these feature may cause trouble).
Misc.
Resources
- source code in GitHub
- Feedback page
- Win32 build script
- WebService::Validator::CSS::W3C Perl module
- thoughts on a new logo
- CSS Validator FAQ
- How to add CSS properties in the validator?, then send a Pull Request
- LogValidator has CssValidator Support through WebService::Validator::CSS::W3C
- ...
Testing
There is WebService::Validator::CSS::W3C Perl module ...
It might be worthwhile to use Value definition parser @@ to generate test data for legal style sheets, ala
x { color: red } x { color: green } ... x { color: #eee } x { color: #000 } ... x { color: rgb(0, 0, 0) } ...
to get an idea of the implementation status for CSS3 features and to ensure that legal style sheets are not invalidated... Woult not be perfect as the lexical space might be infinite
x { width: 0px } x { width: 1px } x { width: 2px } x { width: 3px } ...
but it is unlikely that there are bugs in this direction, except maybe
x { width: 16385px } /* a */ x { width: 65537px } /* b */ x { width: 4294967296px } /* c */ x { width: 18446744073709551617px } /* d */ ...
but these might be special cases... Indeed, the CssValidator does not handle this properly, it validates d but pretty prints
x { width : 1.8446744E19px }
which is not allowed... but that would be out of scope here, as only the pretty printer is affected...
See also http://lists.w3.org/Archives/Public/www-archive/2005Mar/0036.html