Skip to content

Commit

Permalink
Moving cssgradients test into feature-detects/css-cssgradients.js
Browse files Browse the repository at this point in the history
  • Loading branch information
rupl committed Sep 24, 2012
1 parent 9dd6644 commit 6648ec6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 24 additions & 0 deletions feature-detects/css-gradients.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

//
// For CSS Gradients syntax, please see:
// webkit.org/blog/175/introducing-css-gradients/
// developer.mozilla.org/en/CSS/-moz-linear-gradient
// developer.mozilla.org/en/CSS/-moz-radial-gradient
// dev.w3.org/csswg/css3-images/#gradients-
//

Modernizr.addTest('cssgradients', function() {

var str1 = 'background-image:',
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';

setCss(
// 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)
);

return contains(mStyle.backgroundImage, 'gradient');
});
24 changes: 0 additions & 24 deletions modernizr.js
Original file line number Diff line number Diff line change
Expand Up @@ -396,30 +396,6 @@ window.Modernizr = (function( window, document, undefined ) {
* -----
*/

tests['cssgradients'] = function() {
/**
* For CSS Gradients syntax, please see:
* webkit.org/blog/175/introducing-css-gradients/
* developer.mozilla.org/en/CSS/-moz-linear-gradient
* developer.mozilla.org/en/CSS/-moz-radial-gradient
* dev.w3.org/csswg/css3-images/#gradients-
*/

var str1 = 'background-image:',
str2 = 'gradient(linear,left top,right bottom,from(#9f9),to(white));',
str3 = 'linear-gradient(left top,#9f9, white);';

setCss(
// 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)
);

return contains(mStyle.backgroundImage, 'gradient');
};


/*>>webforms*/
// input features and input types go directly onto the ret object, bypassing the tests loop.
// Hold this guy to execute in a moment.
Expand Down

0 comments on commit 6648ec6

Please sign in to comment.