Testing CSS?

Ovid on 2005-09-01T22:26:09

Does anyone know of any automated software testing tool which can verify that CSS is doing what it should? The closest thing I can think of is to try and write some hooks into Firefox, but that hardly seems like a reasonable way to go -- and it's certainly not portable (assuming it's possible).

Part of the reason this came up is my XSLT can tranform the first letter of a word to upper case, but this is better done in CSS. However, if I move it there, there's no way to test if it breaks at a later date.


Paraphrasing rafael

markjugg on 2005-09-02T03:00:00

Interns?

Things better done in CSS

pjf on 2005-09-02T06:02:15

Part of the reason this came up is my XSLT can tranform the first letter of a word to upper case, but this is better done in CSS.

I'm not convinced this is better done in CSS. Correct capitalisation of words sounds pretty important to me, and given the wide range of browers and CSS support that exists, I wouldn't trust CSS to do it reliably in all circumstances.

I believe that on a very fundamental level any website should be comprehensible even with CSS turned off. This supports the various non-graphical browsers (lynx, w3m, speech and braille), and is friendly to the diverse range of bots and spiders we see today. There's a whole lot of scope for your site to be seen with incorrect capitalisation, simply because there are many browsers where CSS is not (or poorly) supported.

As to your question, no, I don't know of any automated tools. I too would dearly love not to check our website in no less than eleven different browsers to ensure it looks good in all of them.

XSLT

baz on 2005-09-02T09:28:23

Not all clients will support the CSS method.

Do it server-side.

Hixie's Work

Smylers on 2005-09-02T12:07:18

Ian Hixie, of Opera (and Mozilla) has done lots of work with testing CSS — mainly from the point of view of determining how well browsers support CSS, but it might be possible to use something similar for verifying that you haven't broken your style-sheets.

I believe the general idea for regression testing is to make a browser render a page, wait 10 seconds, take a screenshot, and then check it is identical to one you prepared earlier.

I've only read about this, I haven't tried doing it, so I can't offer any more help, but this log entry may be a start.

Smyers