Re: Proposal: useragent at-rule

> That's why there's the Mid-pass filter [1] which I described as a possible
> alternative to the Box Model Hack, during my presentation on CSS at SXSW
> [2].  See also my point about avoiding hacks if at all possible, if not,
> minimizing hacks and keeping them as far from the content as possible.

My list of browsers was merely an example though; the principle I'm 
trying to express here is that I wish to hide CSS selectively to any 
given user agent for the sake of usability, now and in the future.

Scenario: you're stuck browsing on an older system with browser X (which 
used to be popular and wide-spread, but isn't today). You need to access 
a site that has a navigation menu obscured by a header, thanks to a 
float bug specific to browser X. The only way for you, the user, to get 
at the content you need in this case: turn off stylesheets. Except that 
browser X doesn't offer easy access to this function, and when you turn 
off style you do so globally. (Assuming the catch-all "you" knows enough 
to turn off style sheets in the first place, a huge assumption given the 
average user.) All this to access a menu.

As the developer of that site, I have a choice. I can tell users of 
Browser X they're on their own, and consciously allow my CSS to impede 
usability of the site because there's no way around the problem without 
adversely affecting the more common browsers. Or, I can use a CSS hack 
to hide the CSS and we're both happy.

Which only goes to explain why I'd use a CSS hack. The problem is that 
looking forward, larger and larger portions of my stylesheets (as more 
advanced CSS becomes practical) should be hidden from older browsers 
that aren't keeping up. If I start using CSS3 modules as they become 
practical, I begin creating dependencies on certain code that not all 
browsers can handle.

What happens in years and years when Mozilla 1.x users are the new 
bottleneck, and I want to start using Multi-column layouts? It may be 
possible to allow graceful degradation into a single column, but 
sometimes it won't be, and I can't rely on CSS3 selectors to get me out 
of the jam because they're already pretty well-supported in 1.x now. How 
do I provide alternate style to Mozilla to keep the page functional in 
that case?

Browsing today's web in IE2.0 is an absolute disaster. Browsing 
tomorrow's in Safari 1.0 doesn't have to be, if a graceful method of 
stepping down to unstyled markup is codified. Developers will continue 
to search for hacks to do just this, whether the need is acknowledged or 
not. They're necessary.

(I don't care about IE2 in the least, but I may just care about Safari 
1.0 in 5 years.)

> As someone else pointed out, don't waste time doing hacks for browsers of
> less than n% of your audience (pick you n accordingly).  Are any of those
> browsers (except IE5) even 0.1% of your audience?

Not really, no. Dwindling market share is tempting to write off, but 
I've explained above how usability problems can be introduced to a small 
percentage of the population by thinking this way. There are still more 
people than I'd care to think stuck on OS 9 using IE 5.0 or 5.1, for 
example.

But I'm not necessarily concerned with the browser share of today, more 
the ongoing and continued push forward. There's no upgrade path at the 
moment. Yes, user agents are supposed to ignore style they don't 
understand, but when style they *do* understand depends on the ignored 
style, degradation is an ugly prospect.

> Unfortunately the alternative of user-agent switching is far worse, as
> others have already pointed out, it has resulted in the ridiculous
> user-agent names that browsers have today.

I don't have a magic bullet here; the methods discussed until now all 
have their drawbacks. The mechanism itself is of little consequence to 
me, anyway, provided there *is* a mechanism. And that's what I'm going 
for here: a way to selectively hide style to user agents that can't 
render it.

d.

Received on Tuesday, 30 March 2004 13:37:09 UTC