Skip to content

Commit

Permalink
more test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rupl committed Sep 27, 2012
1 parent 6b8dbcf commit afb0361
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
12 changes: 8 additions & 4 deletions feature-detects/css-gradients.js
Expand Up @@ -13,12 +13,16 @@ Modernizr.addTest('cssgradients', function() {
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';

setCss(
var css =
// legacy webkit syntax (FIXME: remove when syntax not in use anymore)
(str1 + '-webkit- '.split(' ').join(str2 + str1) +
// standard syntax // trailing 'background-image:'
prefixes.join(str3 + str1)).slice(0, -str1.length)
);
Modernizr._prefixes.join(str3 + str1)).slice(0, -str1.length);

return contains(mStyle.backgroundImage, 'gradient');
var elem = document.createElement('div');
var style = elem.style;
style.cssText = css;

// IE6 returns undefined so cast to string
return ('' + style.backgroundImage).indexOf('gradient') > -1;
});
2 changes: 1 addition & 1 deletion feature-detects/indexedDB.js
Expand Up @@ -4,4 +4,4 @@
// - Firefox shipped moz_indexedDB before FF4b9, but since then has been mozIndexedDB
// For speed, we don't test the legacy (and beta-only) indexedDB

Modernizr.addTest('indexedDB', Modernizr.testAllProps("indexedDB", window));
Modernizr.addTest('indexedDB', !!Modernizr.prefixed("indexedDB", window));
3 changes: 2 additions & 1 deletion feature-detects/touch.js
Expand Up @@ -19,7 +19,8 @@ Modernizr.addTest('touch', function() {
if(('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch) {
bool = true;
} else {
injectElementWithStyles(['@media (',prefixes.join('touch-enabled),('),mod,')','{#modernizr{top:9px;position:absolute}}'].join(''), function( node ) {
var query = ['@media (',Modernizr._prefixes.join('touch-enabled),('),'heartz',')','{#modernizr{top:9px;position:absolute}}'].join('');
Modernizr.testStyles(query, function( node ) {
bool = node.offsetTop === 9;
});
}
Expand Down
3 changes: 0 additions & 3 deletions test/index.html
Expand Up @@ -33,8 +33,6 @@

<script>window.Modernizr || document.write('<script src="../modernizr.js"><\/script>')</script>

<script src="https://raw.github.com/Modernizr/Modernizr/master/modernizr.js"></script>

<script src="js/lib/polyfills.js"></script>
<script src="js/lib/detect-global.js"></script>

Expand All @@ -43,7 +41,6 @@

<script src="js/lib/jsonselect.js"></script>
<script src="js/lib/uaparser.js"></script>
<script src="js/lib/github.js"></script>

<script src="js/setup.js"></script>

Expand Down

0 comments on commit afb0361

Please sign in to comment.