Permalink
Browse files

Fixed failing test and linting issues.

- Leaked globals unit test is too flaky and now we have linting it's no longer relevant.
- Fixed up some linting issues.
  • Loading branch information...
1 parent 58221c7 commit 362bcebca514538b6ad17a4ba54c500936fa9d01 @ryanseddon ryanseddon committed Aug 11, 2012
View
7 feature-detects/css-backgroundsizecover.js
@@ -1,9 +1,10 @@
// developer.mozilla.org/en/CSS/background-size
-Modernizr.testStyles( '#modernizr{background-size:cover}', function( elem ) {
- var style = window.getComputedStyle
- ? window.getComputedStyle( elem, null )
+Modernizr.testStyles( '#modernizr{background-size:cover}', function( elem ) {
+ var style = window.getComputedStyle ?
+ window.getComputedStyle( elem, null )
: elem.currentStyle;
+
Modernizr.addTest( 'bgsizecover', style.backgroundSize == 'cover' );
});
View
2 feature-detects/css-filters.js
@@ -1,7 +1,7 @@
// https://github.com/Modernizr/Modernizr/issues/615
// documentMode is needed for false positives in oldIE, please see issue above
Modernizr.addTest('cssfilters', function() {
- el = document.createElement('div');
+ var el = document.createElement('div');
el.style.cssText = Modernizr._prefixes.join('filter' + ':blur(2px); ');
return !!el.style.length && ((document.documentMode === undefined || document.documentMode > 9));
});
View
6 feature-detects/css-subpixelfont.js
@@ -14,9 +14,9 @@ Modernizr.addTest('subpixelfont', function() {
subpixel.innerHTML = 'This is a text written in Arial';
- bool = window.getComputedStyle
- ? window.getComputedStyle(subpixel, null).getPropertyValue("width") !== '44px'
- : false;
+ bool = window.getComputedStyle ?
+ window.getComputedStyle(subpixel, null).getPropertyValue("width") !== '44px'
+ : false;
}, 1, ['subpixel']);
return bool;
View
17 test/js/unit.js
@@ -28,23 +28,6 @@ test("globals set up", function() {
ok(window.Modernizr, 'global modernizr object created');
- // this comes from kangax's detect-global.js
-
- var globArr = Object.keys(__globals);
-
- // remove Modernizr and html5
- var leakedGlobArr = [''].concat(globArr).concat([''])
- .join(',')
- .replace(',Modernizr','').replace(',html5','')
- .replace('URL','') // lazily added in Opera it seems.
- .replace(/,script\w+/,'') // placed by jQuery
- .split(',');
-
- equal('', leakedGlobArr.pop(), 'retrieved my empty item from the end');
- equal('', leakedGlobArr.shift(), 'retrieved my empty item from the front');
-
- equal(leakedGlobArr.toString(), [].toString(), 'no global variables should leak (other than Modernizr and iepp)');
-
});
test("bind is implemented", function() {

0 comments on commit 362bceb

Please sign in to comment.