mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-05-02 03:03:05 -04:00
Stylistic tweaks following review comments
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
define(function() {
|
||||
// Helper function for e.g. boxSizing -> box-sizing
|
||||
function domToHyphenated (name) {
|
||||
function domToHyphenated( name ) {
|
||||
return name.replace(/([A-Z])/g, function(str, m1) {
|
||||
return '-' + m1.toLowerCase();
|
||||
}).replace(/^ms-/, '-ms-');
|
||||
|
||||
@@ -34,9 +34,7 @@ define(['injectElementWithStyles', 'domToHyphenated'], function ( injectElementW
|
||||
node.currentStyle)['position'] == 'absolute';
|
||||
});
|
||||
}
|
||||
else {
|
||||
return undefined;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
return nativeTestProps;
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@ define(['contains', 'mStyle', 'createElement', 'nativeTestProps', 'is'], functio
|
||||
}
|
||||
|
||||
// Otherwise do it properly
|
||||
var afterInit;
|
||||
var afterInit, i, j, prop, value;
|
||||
|
||||
// If we don't have a style element, that means
|
||||
// we're running async or after the core tests,
|
||||
@@ -48,15 +48,15 @@ define(['contains', 'mStyle', 'createElement', 'nativeTestProps', 'is'], functio
|
||||
}
|
||||
}
|
||||
|
||||
for ( var i in props ) {
|
||||
var prop = props[i];
|
||||
for ( i in props ) {
|
||||
prop = props[i];
|
||||
if ( !contains(prop, "-") && mStyle.style[prop] !== undefined ) {
|
||||
|
||||
// If values to test have been passed in, do a set-and-check test
|
||||
if (!is(values, 'undefined')) {
|
||||
var j = values.length;
|
||||
j = values.length;
|
||||
while (j--) {
|
||||
var value = values[j];
|
||||
value = values[j];
|
||||
mStyle.style[prop] = value;
|
||||
if (mStyle.style[prop] == value) {
|
||||
cleanElems();
|
||||
|
||||
Reference in New Issue
Block a user