Re: Proposal: version at-rule

I'll respond one at a time :o)

rijk@opera.com, Lachlan Hunt, Ian Hickson, Felipe Gasper:
Javascript UA detection is not a "success."

Although it isn't *pretty* certainly, I do think it has been successful - it has
allowed many, many scripts to be cross-browser when they otherwise could not be
without some wildly more complex hack (as we currently have to do in CSS).


Lachlan Hunt:
> Try viewing the Microsoft Office [1] website with
> Mozilla for a good example of the kind of mistakes
> browser sniffing can make.

Some would say this is actually intentional on the part of the authors (consider
Opera's "custom" CSS delivered to them on Microsoft.com), and with existing CSS
bugs and hacks in various browsers, this sort of malice is already and will
continue to be possible.


rijk@opera.com
> Both UA-detection and capability detection used for
> UA-detection are a bane for minority browsers like
> Opera. 

It certainly has, but for the same reason Flash is still a reasonable technology
to use, bad usage does not indicate a bad technology.

Furthermore I think that a block like @useragent(){} would encourage CSS-authors
to restrict those blocks only to what is absolutely necessary to make one or the
other browser play along - otherwise their CSS would become very bloated and
redundant.


Lachlan Hunt:
> IMHO, if standards compliant coding is used, browser
> sniffing *should* never be required.

No browser will ever be perfect, and it's even more unreasonable to bet that all
browsers will be perfect. In the real world, authors want and need their websites
to work in a certain set of browsers. They are going to be forced to make
exceptions for each member of that set at some point in their site authoring. It
could at least be clear.


Ian Hickson:
> Safari claims to be Gecko, Opera claims to be IE...

Yes the User Agent debacle has gotten quite convoluted - but, it is still an
essential tool for those writing cross-browser Javascript.

I don't want to go into too much Javascript because it drifts off-topic, but
consider that for a long time Javascript both existed and had no standards body
whatsoever. This:

document.getElementById( 'myDiv' )

was impossible - and so, long, browser-sniffing blocks were necessary, using
document.all and layers. With CSS, there's a standards-body from the get-go and a
lot of common CSS. What point would there be to an author to write any more than
the bare minimum into an @useragent block?
-Chris "SoopahMan" Moschini
http://hiveminds.info/
http://soopahman.com/

Received on Friday, 26 March 2004 09:55:40 UTC