Skip to content

Commit

Permalink
fixing invalid test background-size: cover
Browse files Browse the repository at this point in the history
  • Loading branch information
bastimeyer committed Mar 20, 2012
1 parent b0c7dfc commit 20f11ef
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions feature-detects/css-backgroundsizecover.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@

// developer.mozilla.org/en/CSS/background-size

Modernizr.testStyles(' #modernizr { background-size: cover; } ', function(elem, rule){

var bool = (window.getComputedStyle ?
getComputedStyle(elem, null) :
elem.currentStyle)['background-size'] == 'cover';

Modernizr.addTest('bgsizecover', bool);
Modernizr.testStyles( '#modernizr{background-size:cover}', function( elem ) {
var style = window.getComputedStyle
? window.getComputedStyle( elem, null )
: elem.currentStyle;
Modernizr.addTest( 'bgsizecover', style.backgroundSize == 'cover' );
});

0 comments on commit 20f11ef

Please sign in to comment.