W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2013

Re: [whatwg] Challenging canvas.supportsContext

From: Brandon Benvie <bbenvie@mozilla.com>
Date: Wed, 19 Jun 2013 13:22:31 -0700
Message-ID: <51C21307.6020608@mozilla.com>
To: whatwg@lists.whatwg.org
On 6/19/2013 12:46 PM, Boris Zbarsky wrote:
> On 6/19/13 3:43 PM, Kenneth Russell wrote:
>> Accurate feature detection in libraries like Modernizr was mentioned
>> as a key use case:
>>
>> http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-September/037249.html
>
> Right, this is the use case that's not really making sense to me. The 
> fact that Modernizr was doing this _eagerly_ sounds like a bug in 
> Modernizr to me...

The point of using Modernizr or something like it is to detect 
availability of features on page load, and then conditionally load 
polyfills/alternate fallback implementations. It specifically does need 
to do eager detection to be useful. It can't wait until the first usage 
to do feature detection; it needs to be done up front when preparing 
dependencies for the main application.

This is also why Modernizr provides a custom build tool. It allows for 
users to only do the feature detection on features they know they need 
to care about, because each check has some cost that needs to be paid 
early on in a page load.
Received on Wednesday, 19 June 2013 20:22:58 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:22 UTC