Skip to content

Commit

Permalink
classy improvements courtesy of fearphage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Modernizr committed Nov 9, 2009
2 parents 706ccb8 + 91c88cd commit ac2d409
Showing 1 changed file with 9 additions and 19 deletions.
28 changes: 9 additions & 19 deletions modernizr.js
Expand Up @@ -23,14 +23,14 @@
* if-conditionals in CSS styling, making it easily to have fine
* control over the look and feel of your website.
*
* @author Faruk Ates
* @copyright (2009) Faruk Ates.
* @author Faruk Ates
* @copyright (2009) Faruk Ates.
*
* @contributor Paul Irish
* @contributor Ben Alman
*/

window.Modernizr = (function(){
window.Modernizr = (function(window,doc){

var ret = {},

Expand Down Expand Up @@ -120,6 +120,9 @@ window.Modernizr = (function(){
offline = 'offline',
inputPlaceholders = 'inputplaceholders',
inputAutofocus = 'inputautofocus',

// list of property values to set for css tests
setProperties = ' -o- -moz- -ms- -webkit- '.split(' '),

tests = {},
inputs = {},
Expand All @@ -142,16 +145,7 @@ window.Modernizr = (function(){
* set_css_all extrapolates all vendor-specific css strings.
*/
function set_css_all( str1, str2 ) {
str1 += ';';

return set_css(
str1
+ '-webkit-' + str1
+ '-moz-' + str1
+ '-o-' + str1
+ '-ms-' + str1
+ ( str2 || '' )
);
return set_css(setProperties.join(str1 + ';') + ( str2 || '' ));
}

/**
Expand Down Expand Up @@ -180,7 +174,7 @@ window.Modernizr = (function(){
* compatibility.
*/
function test_props_all( prop, callback ) {
var uc_prop = prop.replace( /./, function(a) { return a.toUpperCase(); } ),
var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
props = [
prop,
'webkit' + uc_prop,
Expand Down Expand Up @@ -361,10 +355,6 @@ window.Modernizr = (function(){
tests[fontface] = (function(){

var fontret;

// IE supports EOT and has had EOT support since IE 5.
// This is a proprietary standard (ATOW) and thus this off-spec,
// proprietary test for it is acceptable.
if (!(!/*@cc_on@if(@_jscript_version>=5)!@end@*/0)) fontret = true;

else {
Expand Down Expand Up @@ -551,4 +541,4 @@ window.Modernizr = (function(){

return ret;

})();
})(this,this.document);

0 comments on commit ac2d409

Please sign in to comment.