demo/js/modernizr-1.6.js
function webforms(){
    
        // Run through HTML5's new input attributes to see if the UA understands any.
        // We're using f which is the <input> element created early on
        // Mike Taylr has created a comprehensive resource for testing these attributes
        //   when applied to all input types: 
        //   http://miketaylr.com/code/input-type-attr.html
        // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
        ret['input'] = (function(props) {
            for (var i = 0,len=props.length;i<len;i++) {
                attrs[ props[i] ] = !!(props[i] in f);
            }
            return attrs;
        })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));

        // Run through HTML5's new input types to see if the UA understands any.
        //   This is put behind the tests runloop because it doesn't return a
        //   true/false like all the other tests; instead, it returns an object
        //   containing each input type with its corresponding true/false value 
        
        // Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/
        ret['inputtypes'] = (function(props) {
            for (var i = 0, bool, len=props.length ; i < len ; i++) {
              
                f.setAttribute('type', props[i]);
                bool = f.type !== 'text';
                
                // Chrome likes to falsely purport support, so we feed it a textual value;
                // if that doesnt succeed then we know there's a custom UI
                if (bool){  

                    f.value = smile;
     
                    if (/^range$/.test(f.type) && f.style.WebkitAppearance !== undefined){
                      
                      docElement.appendChild(f);
                      var defaultView = doc.defaultView;
                      
                      // Safari 2-4 allows the smiley as a value, despite making a slider
                      bool =  defaultView.getComputedStyle && 
                              defaultView.getComputedStyle(f, null).WebkitAppearance !== 'textfield' && 
                      
                              // Mobile android web browser has false positive, so must
                              // check the height to see if the widget is actually there.
                              (f.offsetHeight !== 0);
                              
                      docElement.removeChild(f);
                              
                    } else if (/^(search|tel)$/.test(f.type)){
                      // Spec doesnt define any special parsing or detectable UI 
                      //   behaviors so we pass these through as true
                      
                      // Interestingly, opera fails the earlier test, so it doesn't
                      //  even make it here.
                      
                    } else if (/^(url|email)$/.test(f.type)) {

                      // Real url and email support comes with prebaked validation.
                      bool = f.checkValidity && f.checkValidity() === false;
                      
                    } else {
                      // If the upgraded input compontent rejects the :) text, we got a winner
                      bool = f.value != smile;
                    }
                }
                
                inputs[ props[i] ] = !!bool;
            }
            return inputs;
        })('search tel url email datetime date month week time datetime-local number range color'.split(' '));

    }
function webforms(){
    
        // Run through HTML5's new input attributes to see if the UA understands any.
        // We're using f which is the <input> element created early on
        // Mike Taylr has created a comprehensive resource for testing these attributes
        //   when applied to all input types: 
        //   http://miketaylr.com/code/input-type-attr.html
        // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary
        ret['input'] = (function(props) {
            for (var i = 0,len=props.length;i<len;i++) {
                attrs[ props[i] ] = !!(props[i] in f);
            }
            return attrs;
        })('autocomplete autofocus list placeholder max min multiple pattern required step'.split(' '));

        // Run through HTML5's new input types to see if the UA understands any.
        //   This is put behind the tests runloop because it doesn't return a
        //   true/false like all the other tests; instead, it returns an object
        //   containing each input type with its corresponding true/false value 
        
        // Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/
        ret['inputtypes'] = (function(props) {
            for (var i = 0, bool, len=props.length ; i < len ; i++) {
              
                f.setAttribute('type', props[i]);
                bool = f.type !== 'text';
                
                // Chrome likes to falsely purport support, so we feed it a textual value;
                // if that doesnt succeed then we know there's a custom UI
                if (bool){  

                    f.value = smile;
     
                    if (/^range$/.test(f.type) && f.style.WebkitAppearance !== undefined){
                      
                      docElement.appendChild(f);
                      var defaultView = doc.defaultView;
                      
                      // Safari 2-4 allows the smiley as a value, despite making a slider
                      bool =  defaultView.getComputedStyle && 
                              defaultView.getComputedStyle(f, null).WebkitAppearance !== 'textfield' && 
                      
                              // Mobile android web browser has false positive, so must
                              // check the height to see if the widget is actually there.
                              (f.offsetHeight !== 0);
                              
                      docElement.removeChild(f);
                              
                    } else if (/^(search|tel)$/.test(f.type)){
                      // Spec doesnt define any special parsing or detectable UI 
                      //   behaviors so we pass these through as true
                      
                      // Interestingly, opera fails the earlier test, so it doesn't
                      //  even make it here.
                      
                    } else if (/^(url|email)$/.test(f.type)) {

                      // Real url and email support comes with prebaked validation.
                      bool = f.checkValidity && f.checkValidity() === false;
                      
                    } else {
                      // If the upgraded input compontent rejects the :) text, we got a winner
                      bool = f.value != smile;
                    }
                }
                
                inputs[ props[i] ] = !!bool;
            }
            return inputs;
        })('search tel url email datetime date month week time datetime-local number range color'.split(' '));

    }
function webforms ( ) { // Run through HTML5's new input attributes to see if the UA understands any. // We're using f which is the <input> element created early on // Mike Taylr has created a comprehensive resource for testing these attributes //   when applied to all input types:  //   http://miketaylr.com/code/input-type-attr.html // spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/the-input-element.html#input-type-attr-summary ret [ 'input' ] = ( function ( props ) { for ( var i = 0 , len = props . length ; i < len ; i ++ ) { attrs [ props [ i ] ] = ! ! ( props [ i ] in f ) ; } return attrs ; } ) ( 'autocomplete autofocus list placeholder max min multiple pattern required step' . split ( ' ' ) ) ; // Run through HTML5's new input types to see if the UA understands any. //   This is put behind the tests runloop because it doesn't return a //   true/false like all the other tests; instead, it returns an object //   containing each input type with its corresponding true/false value  // Big thanks to @miketaylr for the html5 forms expertise. http://miketaylr.com/ ret [ 'inputtypes' ] = ( function ( props ) { for ( var i = 0 , bool , len = props . length ; i < len ; i ++ ) { f . setAttribute ( 'type' , props [ i ] ) ; bool = f . type !== 'text' ; // Chrome likes to falsely purport support, so we feed it a textual value; // if that doesnt succeed then we know there's a custom UI if ( bool ) { f . value = smile ; if ( / ^range$ / . test ( f . type ) && f . style . WebkitAppearance !== undefined ) { docElement . appendChild ( f ) ; var defaultView = doc . defaultView ; // Safari 2-4 allows the smiley as a value, despite making a slider bool = defaultView . getComputedStyle && defaultView . getComputedStyle ( f , null ) . WebkitAppearance !== 'textfield' && // Mobile android web browser has false positive, so must // check the height to see if the widget is actually there. ( f . offsetHeight !== 0 ) ; docElement . removeChild ( f ) ; } else if ( / ^(search|tel)$ / . test ( f . type ) ) { // Spec doesnt define any special parsing or detectable UI  //   behaviors so we pass these through as true // Interestingly, opera fails the earlier test, so it doesn't //  even make it here. } else if ( / ^(url|email)$ / . test ( f . type ) ) { // Real url and email support comes with prebaked validation. bool = f . checkValidity && f . checkValidity ( ) === false ; } else { // If the upgraded input compontent rejects the :) text, we got a winner bool = f . value != smile ; } } inputs [ props [ i ] ] = ! ! bool ; } return inputs ; } ) ( 'search tel url email datetime date month week time datetime-local number range color' . split ( ' ' ) ) ; }
input features and input types go directly onto the ret object, bypassing the tests loop. Hold this guy to execute in a moment.
input features and input types go directly onto the ret object bypassing the tests loop . Hold this guy to execute in a moment .