I'm writing a custom CSS parser and want to use it to style graphical elements in my application (not HTML). I want to make sure that this conforms to the usual CSS behavior when it comes to precedence of selectors, the "cascade", etc..
Is there a comprehensive CSS test suite I can use for this project?
My CSS has most of the regular syntax features (e.g. matches "tag" names, ids, classes, pseudoclasses) and will share many of the formatting options with HTML's CSS, but also have different ones, as appropriate for the kind of "documents" I'm styling.
I've been looking for a CSS test suite to check my implementation, but the only ones I could find, like the W3C test suite, are primarily concerned with the visual representation of the document. I'm looking for something that is machine-readable or easy to adapt, and exercises the CSS engine rather than the layout engine. Something like (pseudo-test-specification):
Stylesheet
blah.blub { color: red; }
.blub { color: blue; }
+ Document
<blah class="blub" />
=> Expected result:
<blah class="blub" style="color: red" />
or
assert selector "#blub" matches element "moo#blub"
assert selector "blah#blub" does not match element "moo#blub"
...
I'd also like to test the behavior of CSS shorthands (e.g. line vs line-color), in cases I've implemented them identical to HTML's. For example
line: 1px solid blue;
line-color: red;
results in a "1px solid red" line. Any ideas?