-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from aldendaniels/master
Update modernizr
- Loading branch information
Showing
270 changed files
with
3,562 additions
and
4,205 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
var ModernizrProto = require('./ModernizrProto'); | ||
var prefixes = require('./cssomPrefixes'); | ||
|
||
|
||
/** | ||
* atRule returns a given CSS property at-rule (eg @keyframes), possibly in | ||
* some prefixed form, or false, in the case of an unsupported rule | ||
* | ||
* @param prop - String naming the property to test | ||
*/ | ||
|
||
var atRule = function(prop) { | ||
var length = prefixes.length; | ||
var cssrule = window.CSSRule; | ||
var rule; | ||
|
||
if (typeof cssrule === 'undefined') { | ||
return undefined; | ||
} | ||
|
||
if (!prop) { | ||
return false; | ||
} | ||
|
||
// remove literal @ from beginning of provided property | ||
prop = prop.replace(/^@/,''); | ||
|
||
// CSSRules use underscores instead of dashes | ||
rule = prop.replace(/-/g,'_').toUpperCase() + '_RULE'; | ||
|
||
if (rule in cssrule) { | ||
return '@' + prop; | ||
} | ||
|
||
for ( var i = 0; i < length; i++ ) { | ||
// prefixes gives us something like -o-, and we want O_ | ||
var prefix = prefixes[i]; | ||
var thisRule = prefix.toUpperCase() + '_' + rule; | ||
|
||
if (thisRule in cssrule) { | ||
return '@-' + prefix.toLowerCase() + '-' + prop; | ||
} | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
|
||
|
||
module.exports = atRule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
var isSVG = require('./isSVG'); | ||
|
||
|
||
function createElement() { | ||
if (typeof document.createElement !== 'function') { | ||
// This is the case in IE7, where the type of createElement is "object". | ||
// For this reason, we cannot call apply() as Object is not a Function. | ||
return document.createElement(arguments[0]); | ||
} else if (isSVG) { | ||
return document.createElementNS.call(document, 'http://www.w3.org/2000/svg', arguments[0]); | ||
} else { | ||
return document.createElement.apply(document, arguments); | ||
} | ||
} | ||
|
||
var createElement = function() { | ||
return document.createElement.apply(document, arguments); | ||
}; | ||
|
||
|
||
module.exports = createElement; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
// Helper function for converting kebab-case to camelCase, | ||
// e.g. box-sizing -> boxSizing | ||
function cssToDOM( name ) { | ||
return name.replace(/([a-z])-([a-z])/g, function(str, m1, m2) { | ||
return m1 + m2.toUpperCase(); | ||
}).replace(/^-/, ''); | ||
} | ||
|
||
module.exports = cssToDOM; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
// Helper function for converting camelCase to kebab-case, | ||
// e.g. boxSizing -> box-sizing | ||
function domToCSS( name ) { | ||
return name.replace(/([A-Z])/g, function(str, m1) { | ||
return '-' + m1.toLowerCase(); | ||
}).replace(/^ms-/, '-ms-'); | ||
} | ||
|
||
module.exports = domToCSS; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,10 @@ | ||
var slice = require('./slice'); | ||
|
||
|
||
// Adapted from ES5-shim https://github.com/kriskowal/es5-shim/blob/master/es5-shim.js | ||
// es5.github.com/#x15.3.4.5 | ||
|
||
if (!Function.prototype.bind) { | ||
Function.prototype.bind = function bind(that) { | ||
|
||
var target = this; | ||
|
||
if (typeof target != "function") { | ||
throw new TypeError(); | ||
} | ||
|
||
var args = slice.call(arguments, 1); | ||
var bound = function() { | ||
|
||
if (this instanceof bound) { | ||
|
||
var F = function(){}; | ||
F.prototype = target.prototype; | ||
var self = new F(); | ||
|
||
var result = target.apply( | ||
self, | ||
args.concat(slice.call(arguments)) | ||
); | ||
if (Object(result) === result) { | ||
return result; | ||
} | ||
return self; | ||
|
||
} else { | ||
|
||
return target.apply( | ||
that, | ||
args.concat(slice.call(arguments)) | ||
); | ||
|
||
} | ||
|
||
}; | ||
|
||
return bound; | ||
// Change the function's scope. | ||
function fnBind(fn, that) { | ||
return function() { | ||
return fn.apply(that, arguments); | ||
}; | ||
} | ||
|
||
|
||
|
||
module.exports = Function.prototype.bind; | ||
module.exports = fnBind; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.