Re: @media and browsers conditional statments

On Aug 9, 2008, at 3:01 PM, Joshua Cranmer <Pidgeot18@verizon.net>  
wrote:

>
> 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.

That's not likely to happen any worse than it already is.

> 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.

There's really no reason to use @media (firefox) except to overcome  
bugs that are specific to FireFox. Any way, sites that would do that  
are probably already blocking those user agents from entering at all  
because they are not on the white list.

> Look at the people sniffing for "Firefox" in U-A strings instead of  
> "Gecko" if you want an example

Anyone who would use the new feature would likely look upbthe spec and  
see a note about why filtering on "gecko" would be preferred over  
filtering  for "firefox". Alternately you could have @media work with  
rendering engine and version number but not UA name.

> 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.

Not really any more than otherwise. It is a given that when a new  
version of IE comes out that there will be a lot of work to adapt a  
site to the new engine, and rewrite the absolutely necessary hacks.  
The only question is whether it will be easy (@media) or if it will  
involve comlex and increasely difficult to find hacks.

> 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  
> display:magic-type.
>
> There is no easy answer to solving the dichotomy of implementations  
> out there,

True

> especially since your consumers are not going to complain to you  
> about bugs in CSS but to their browsers.

Absolutely false. Try hanging around a large corporate call center  
sometime when a significant portion of your large user base suddenly  
finds that they can no longer use your site.

> I have bad omens about supporting feature or UA sniffing, though...

There's no doubt in my mind that it would be better than the  
alternative.
>

> -- 
> Beware of bugs in the above code; I have only proved it correct, not  
> tried it. -- Donald E. Knuth
>
>

Received on Sunday, 10 August 2008 00:04:49 UTC