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 20:41:09 -0400
To: Brad Kemper <brkemper.comcast@gmail.com>
Cc: Francois Remy <fremycompany_pub@yahoo.fr>, CSS 3 W3C Group <www-style@w3.org>
Message-id: <489E3925.4030208@verizon.net>

Brad Kemper wrote:
> 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.
What I was trying to point out is that the average developer is going to 
think "oh look, this thing selects on *browser*, let's use @media 
(firefox)" without realizing the distinction between the layout engine 
and browser.
> 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.
@media (firefox) shouldn't work, period, IMO (using gecko is more 
precise, but I'm doubtful as to the utility overall).

I also think you're being too optimistic of people to assume that people 
are looking up the specs. Most probably feel that the language is too 
"legalistic" and prefer to get watered-down versions form tutorials 
churned out by publishing houses, or similar media. I can see how it 
would happen too:

John Doe comes across site "Blazing Edge of CSS", and finds an article 
on the @media feature, which "allows one to specify rules specific to 
browsers." A while later, he comes across a bug in IE and thinks 
"okay... I need to make an IE-specific hack" and puts in @media (ie), 
based on his recollection of the article he read earlier. It doesn't 
work, naturally, so he chalks it up to IE's poor standard supports. 
Later on, he sees (or reads elsewhere, more likely) that FF borks on 
this input, see he puts in an @media (firefox) but assumes it to work.
> 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.
If it were unusable, I think the corporation would be blamed; but if it 
were just... somewhat off, people would probably be more apt to blame 
the browser.
> There's no doubt in my mind that it would be better than the alternative.
I'll be frank: I have no real alternative either. @has-feature is less 
likely to be spoofed, but solves nothing in the case of borked 
implementations. Conditional comments are non-starters. Given the 
current state of things, I think I best like the idea of sending out 
different CSS pages for different browsers, but that returns to UA 
spoofing problems. And it's not one I particular enjoy, either.

P.S. Apologies to any Trident developers reading these messages. I know 
you're trying, but the fact still remains that IE 6 is a prime example 
of buggy CSS support.

-- 
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:42:06 GMT

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