W3C home > Mailing lists > Public > www-style@w3.org > August 2008

Re: @media and browsers conditional statments

From: Joshua Cranmer <Pidgeot18@verizon.net>
Date: Sat, 09 Aug 2008 18:01:47 -0400
To: Francois Remy <fremycompany_pub@yahoo.fr>
Cc: CSS 3 W3C Group <www-style@w3.org>
Message-id: <489E13CB.4040002@verizon.net>

Francois Remy wrote:
> What about a @media browser-base filtering of CSS ?
> It should be greater than hacks to repair browsers bugs.
> What are you thinking of it ?
I'm sure this has already been belabored to death, but the primary 
problem with sniffing in general is that it takes a few people to lock 
out certain browsers in key sites for developers to decide "maybe we 
should pretend to be XXX," and we get the mess that is U-A strings all 
over again.

Also, there are probably going to be a fair number of small developers 
wondering why

@media (firefox) or @media (ie) doesn't seem to work. Look at the people 
sniffing for "Firefox" in U-A strings instead of "Gecko" if you want an 

Finally, there is the problem I have seen mentioned elsewhere with 
respect to version testing. John Doe doesn't necessarily know if IE 7 
fixes some buggy behavior in IE 6. So should he do @media (trident <= 6) 
or @media (trident) ? Either way, he has a lot of work to do when IE 7 
comes out.

In an ideal world (okay, nearly ideal), the way to test would be 
@has-feature(display:magic-type) or something similar; in practice, this 
fails miserably since you don't know how buggy the support for 

There is no easy answer to solving the dichotomy of implementations out 
there, especially since your consumers are not going to complain to you 
about bugs in CSS but to their browsers. I have bad omens about 
supporting feature or UA sniffing, though...

Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth
Received on Saturday, 9 August 2008 22:02:42 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:39 UTC