Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moving cssgradients test into feature-detects/css-cssgradients.js

  • Loading branch information...
commit 6648ec68aaaa8d34ccdefb88019f99d8e48459aa 1 parent 9dd6644
@rupl rupl authored
Showing with 24 additions and 24 deletions.
  1. +24 −0 feature-detects/css-gradients.js
  2. +0 −24 modernizr.js
View
24 feature-detects/css-gradients.js
@@ -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');
+});
View
24 modernizr.js
@@ -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.
Please sign in to comment.
Something went wrong with that request. Please try again.