Skip to content

Commit

Permalink
Reduce, reuse, recycle
Browse files Browse the repository at this point in the history
  • Loading branch information
SlexAxton committed Feb 25, 2013
1 parent f48e459 commit c3e4e50
Show file tree
Hide file tree
Showing 19 changed files with 47 additions and 119 deletions.
9 changes: 0 additions & 9 deletions feature-detects/a/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
"name": "a[download] Attribute",
"property": "adownload",
"caniuse" : "download",
"polyfills": [],
"aliases": [],
"tags": ["media", "attribute"],
"doc": null,
"knownBugs": [],
"authors": [],
"warnings": [],
"notes": [{
"name": "WhatWG Reference",
"href": "http://developers.whatwg.org/links.html#downloading-resources"
Expand All @@ -22,8 +16,5 @@ When used on an `<a>`, this attribute signifies that the resource it points to s
*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
// a[download] attribute
//

Modernizr.addTest('adownload', 'download' in createElement('a'));
});
5 changes: 0 additions & 5 deletions feature-detects/audio/audiodata.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,15 @@
{
"name": "Audio Data API",
"property": "audiodata",
"aliases": [],
"polyfills": ["xaudiojs", "dynamicaudiojs", "audiolibjs"],
"tags": ["audio", "media"],
"knownBugs": [],
"doc" : null,
"authors": ["Addy Osmani"],
"warnings" : [],
"notes": [{
"name": "API Documentation",
"href": "https://wiki.mozilla.org/Audio_Data_API"
}]
}
!*/
define(['Modernizr'], function( Modernizr ) {
// Mozilla Audio Data API
Modernizr.addTest('audiodata', !!window.Audio);
});
4 changes: 0 additions & 4 deletions feature-detects/audio/webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
"property": "webaudio",
"caniuse": "audio-api",
"polyfills": ["xaudiojs", "dynamicaudiojs", "audiolibjs"],
"aliases": [],
"tags": ["audio", "media"],
"knownBugs": [],
"doc" : null,
"authors": ["Addy Osmani"],
"warnings": [],
"notes": [{
"name": "W3 Specification",
"href": "https://dvcs.w3.org/hg/audio/raw-file/tip/webaudio/specification.html"
Expand Down
10 changes: 3 additions & 7 deletions feature-detects/battery/lowbattery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@
{
"name": "Low Battery Level",
"property": "lowbattery",
"aliases": [],
"tags": ["hardware", "mobile"],
"knownBugs": [],
"doc" : null,
"authors": ["Paul Sayre"],
"warnings": [],
"notes": [{
"name": "MDN Docs",
"href": "http://developer.mozilla.org/en/DOM/window.navigator.mozBattery"
}]
}
!*/
!*//* DOC
Enable a developer to remove CPU intensive CSS/JS when battery is low
*/
define(['Modernizr', 'prefixed'], function( Modernizr, prefixed ) {
// Enable a developer to remove CPU intensive CSS/JS when battery is low

Modernizr.addTest('lowbattery', function() {
var minLevel = 0.20;
var battery = prefixed('battery', navigator);
Expand Down
6 changes: 0 additions & 6 deletions feature-detects/canvas/todataurl.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@
{
"name": "canvas.toDataURL type support",
"property": ["todataurljpeg", "todataurlwebp"],
"aliases": [],
"tags": ["canvas"],
"async" : true,
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": [{
"name": "HTML5 Spec",
"href": "http://www.w3.org/TR/html5/the-canvas-element.html#dom-canvas-todataurl"
Expand All @@ -19,7 +14,6 @@ define(['Modernizr', 'addTest', 'createElement', 'test/canvas'], function( Moder

// This is an async test
Modernizr.addAsyncTest(function () {
// This test is asynchronous. Watch out.
if (!Modernizr.canvas) {
Modernizr._addTest('todataurljpeg', false, ['todataurlwebp']);
return false;
Expand Down
8 changes: 1 addition & 7 deletions feature-detects/css/animations.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
"property": "cssanimations",
"caniuse": "css-animation",
"polyfills": ["transformie", "csssandpaper"]
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": ["Android < 4 will pass this test, but can only animate a single property at a time"],
"notes": [{
"name" : "Article: 'Dispelling the Android CSS animation myths'",
Expand All @@ -17,7 +13,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('cssanimations', function() {
return testAllProps('animationName');
});
Modernizr.addTest('cssanimations', testAllProps('animationName'));
});
7 changes: 1 addition & 6 deletions feature-detects/css/backgroundposition-shorthand.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
{
"name": "Background Position Shorthand",
"property": "bgpositionshorthand",
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": [{
"name": "MDN Docs",
"href": "https://developer.mozilla.org/en/CSS/background-position"
Expand All @@ -21,7 +16,7 @@
}
!*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
Modernizr.addTest('bgpositionshorthand', function() {
Modernizr.addTest('bgpositionshorthand', function() {
var elem = createElement('a');
var eStyle = elem.style;
var val = 'right 10px bottom 10px';
Expand Down
4 changes: 0 additions & 4 deletions feature-detects/css/backgroundposition-xy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
{
"name": "Background Position XY",
"property": "bgpositionxy",
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": ["Allan Lei", "Brandom Aaron"],
"warnings": [],
"notes": [{
"name": "Demo",
"href": "http://jsfiddle.net/allanlei/R8AYS/"
Expand Down
4 changes: 0 additions & 4 deletions feature-detects/css/backgroundrepeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
{
"name": "Background Repeat",
"property": ["bgrepeatspace", "bgrepeatround"],
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": ["Ryan Seddon"],
"warnings": [],
"notes": [{
"name": "MDN Docs",
"href": "http://developer.mozilla.org/en/CSS/background-repeat"
Expand Down
6 changes: 1 addition & 5 deletions feature-detects/css/backgroundsize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
{
"name": "Background Size",
"property": "backgroundsize",
"aliases": [],
"tags": ["css"],
"knownBugs": ["This will false positive in Opera Mini -- http://github.com/Modernizr/Modernizr/issues/396"],
"doc" : null,
"authors": [],
"warnings": [],
"knownBugs": ["This will false positive in Opera Mini - http://github.com/Modernizr/Modernizr/issues/396"],
"notes": [{
"name": "Related Issue",
"href": "http://github.com/Modernizr/Modernizr/issues/396"
Expand Down
5 changes: 0 additions & 5 deletions feature-detects/css/backgroundsizecover.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
{
"name": "Background Size Cover",
"property": "bgsizecover",
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": [{
"name" : "MDN Docs",
"href": "http://developer.mozilla.org/en/CSS/background-size"
Expand Down
8 changes: 1 addition & 7 deletions feature-detects/css/borderimage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,7 @@
"property": "borderimage",
"caniuse": "border-image",
"polyfills": ["css3pie"],
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": []
"tags": ["css"]
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Expand Down
5 changes: 0 additions & 5 deletions feature-detects/css/borderradius.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
"property": "borderradius",
"caniuse": "border-radius",,
"polyfills": ["css3pie"],
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": [{
"name": "Comprehensive Compat Chart",
"href": "http://muddledramblings.com/table-of-css3-border-radius-compliance"
Expand Down
7 changes: 1 addition & 6 deletions feature-detects/css/boxshadow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
"name": "Box Shadow",
"property": "boxshadow",
"caniuse": "css-boxshadow",
"aliases": [],
"tags": ["css"],
"knownBugs": ["WebOS false positives on this test."],
"doc" : null,
"authors": [],
"warnings": [],
"notes": []
"knownBugs": ["WebOS false positives on this test."]
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Expand Down
10 changes: 2 additions & 8 deletions feature-detects/css/boxsizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
"name": "Box Sizing",
"property": "boxsizing",
"caniuse": "css3-boxsizing",
"aliases": [],
"polyfills": ["borderboxmodel", "boxsizingpolyfill", "borderbox"],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": [{
"name": "MDN Docs",
"href": "http://developer.mozilla.org/en/CSS/box-sizing"
Expand All @@ -19,7 +15,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('boxsizing', function() {
return testAllProps('boxSizing') && (document.documentMode === undefined || document.documentMode > 7);
});
Modernizr.addTest('boxsizing', testAllProps('boxSizing') && (document.documentMode === undefined || document.documentMode > 7));
});
5 changes: 0 additions & 5 deletions feature-detects/css/calc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@
"name": "CSS Calc",
"property": "csscalc",
"caniuse": "calc",
"aliases": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": ["@calvein"],
"warnings": [],
"notes": []
}
!*//* DOC
Expand Down
19 changes: 2 additions & 17 deletions feature-detects/css/columns.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,8 @@
"name": "CSS Columns",
"property": "csscolumns",
"caniuse": "multicolumn",
"aliases": [],
"polyfills": [{
"name": "css3-multi-column.js",
"authors": ["Cdric Savarese"],
"href": "http://www.csscripting.com/css-multi-column/",
"licenses": ["CC-GNU LGPL"],
"notes": [
"Supported Properties: column-count, column-width, column-gap, column-rule.",
"Unsupported Properties: column-rule-width (use column-rule instead), column-rule-style (use column-rule instead), column-rule-color (use column-rule instead), column-span, column-width-policy, column-space-distribution"
]
}],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": [],
"warnings": [],
"notes": []
"polyfills": ["css3multicolumnjs"],
"tags": ["css"]
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Expand Down
13 changes: 4 additions & 9 deletions feature-detects/css/cubicbezierrange.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,16 @@
{
"name": "CSS Cubic Bezier Range",
"property": "cubicbezierrange",
"aliases": [],
"polyfills": [],
"tags": ["css"],
"knownBugs": [],
"doc" : null,
"authors": ["@calvein"],
"warnings": ["cubic-bezier values can't be > 1 for Webkit until [bug #45761](https://bugs.webkit.org/show_bug.cgi?id=45761) is fixed"],
"notes": []
"warnings": ["cubic-bezier values can't be > 1 for Webkit until [bug #45761](https://bugs.webkit.org/show_bug.cgi?id=45761) is fixed"]
}
!*/
define(['Modernizr', 'createElement', 'prefixes'], function( Modernizr, createElement, prefixes ) {
Modernizr.addTest('cubicbezierrange', function() {
Modernizr.addTest('cubicbezierrange', function() {
var el = createElement('div');
el.style.cssText = prefixes.join('transition-timing-function' + ':cubic-bezier(1,0,0,1.1); ');
el.style.cssText = prefixes.join('transition-timing-function:cubic-bezier(1,0,0,1.1); ');
return !!el.style.length;
});

});
});
31 changes: 31 additions & 0 deletions polyfills.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,36 @@
"href": "http://www.useragentman.com/blog/2010/03/09/cross-browser-css-transforms-even-in-ie/",
"licenses": ["MIT"],
"notes": []
},
"borderboxmodel": {
"name": "borderBoxModel",
"authors": ["Alberto Gasparin"],
"href": "https://github.com/albertogasparin/borderBoxModel",
"licenses": ["MIT"],
"notes": ["box-sizing: border-box; javascript polyfill for IE6+"]
},
"boxsizingpolyfill": {
"name": "box-sizing-polyfill",
"authors": ["Christian \"Schepp\" Schaefer"],
"href": "https://github.com/Schepp/box-sizing-polyfill",
"licenses": ["LGPL3"],
"notes": ["box-sizing: border-box; for IE6 and IE7 via Microsoft's proprietary CSS behavior / .htc-script"]
}
"borderbox": {
"name": "Borderbox for Compass",
"authors": ["Richard Herrera"],
"href": "https://github.com/doctyper/compass-borderbox",
"licenses": [],
"notes": ["box-sizing: border-box; polyfill for SASS/Compass. Outputs equivalent CSS for IE6 & 7"]
},
"css3multicolumnjs": {
"name": "css3-multi-column.js",
"authors": ["Cdric Savarese"],
"href": "http://www.csscripting.com/css-multi-column/",
"licenses": ["CC-GNU LGPL"],
"notes": [
"Supported Properties: column-count, column-width, column-gap, column-rule.",
"Unsupported Properties: column-rule-width (use column-rule instead), column-rule-style (use column-rule instead), column-rule-color (use column-rule instead), column-span, column-width-policy, column-space-distribution"
]
}
}

0 comments on commit c3e4e50

Please sign in to comment.