W3C home > Mailing lists > Public > www-style@w3.org > June 2004

Re: CSS on invalid HTML

From: Max Romantschuk <max@provico.fi>
Date: Thu, 03 Jun 2004 15:35:21 +0300
Message-ID: <40BF1B09.6040206@provico.fi>
Cc: www-style@w3.org

David Balch wrote:
> Is it defined how UAs should act when trying to apply CSS styles to invalid
> HTML?
> 
> I would expect that there would be no guarantees on how the styles are
> applied, all bets are off...

As far as I know the specifications do not cover selectors in reference 
to invalid HTML. I believe most UAs try to match individual selectors to 
individual elements, so the validity of the document itself is not 
really that significant.

Cascade rules and such would probably be messed up with HTML abuse, but 
then again most invalid HTML is rendered in quirks mode by the more 
compliant browsers, and quirks mode compensates for most of the funny stuff.

But as you say I believe it's entierly up to the UA. Does it really 
matter? After all, documents _should_ be valid whenever possible.


With invalid CSS it is trickier though. Gecko-derivatives work as 
intended and ignore invalid rules. IE tries it's best to be smart, which 
in turn causes a bunch of problems if testing with IE. (stuff works when 
it shouldn't.)

.max

-- 
Max Romantschuk
http://max.nma.fi/
Received on Thursday, 3 June 2004 08:35:51 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:30 GMT