W3C home > Mailing lists > Public > www-style@w3.org > July 2010

RE: Selecting for features

From: Sylvain Galineau <sylvaing@microsoft.com>
Date: Mon, 12 Jul 2010 17:40:59 +0000
To: Tab Atkins Jr. <jackalmage@gmail.com>
CC: Eitan Adler <lists@eitanadler.com>, Adrian Price <adrian.price@rogue-technologies.com>, David Woolley <forums@david-woolley.me.uk>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <045A765940533D4CA4933A4A7E32597E215197FE@TK5EX14MBXC111.redmond.corp.microsoft.com>
> From: Tab Atkins Jr. [mailto:jackalmage@gmail.com]


> This is somewhat unfair, Sylvain.  

Why is it unfair to state what Modernizr does and doesn't do ?
I am being told that Modernizr is better than declarative feature
detection because it 'runs code and checks the results'. In most
cases, it doesn't do that at all. It checks for simple boolean indicators 
of the existence of a feature. That this is actually sufficient and 
effective in practice does show that we are already much closer to 
declarative feature detection that we think we are. That, imo, is a fair 
statement.

> Modernizr currently relies on super-trivial checks for some features 
> *because it works*.  

Precisely. Basic boolean feature detection already works. 

> If a browser started actively lying in the way you suggest, Modernizr 
> would be updated to test more thoroughly.  

Of course. That it doesn't need to do more complex testing than checking for
the presence of a property across so many features tells us something about
the fear of browser lies destroying the value of declarative feature detection.

> Yes, but only because an independent party is making the declaration,
> and is able to provide results at whatever granularity proves useful.
> The hasFeature() function provides at least some evidence that
> browser-provided information about support is marginally useful at
> best.

Past failures are no proof of future ones. But yes, the fact that an
independent party is doing the testing is a significant factor here.

Still, given the much higher conformance pressure on browser vendors
and increasing interop trend these days, I don't believe extrapolating
from the past is that useful.


> That said, fantasai's proposal for !supports appears to be less likely
> to be lied to than directly asking the browser what they support, and
> thus more reliable.  The additional fact that it's somewhat more
> difficult to use as browser-detection just makes it even more
> attractive.

That it's more difficult for authors to use in order to do something they all 
do in some way, shape or form - many of which far less reliable than Modernizr
- makes it attractive ? The long-run cost and downside of authors using dozens of 
incompatible, unreliable and even invalid ways to detect features seems greater 
to me than the inconvenience of temporary browser inaccuracies in reporting said
features through a clean, simple standard mechanism.


Received on Monday, 12 July 2010 17:41:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:29 GMT