Merge branch 'supports-featureupdates' into supports

This commit is contained in:
Stu Cox
2013-03-09 15:15:13 -06:00
6 changed files with 14 additions and 59 deletions

View File

@@ -13,13 +13,8 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
Modernizr.addTest('bgpositionxy', function() {
return testStyles('#modernizr {background-position: 3px 5px;}', function( elem ) {
var cssStyleDeclaration = window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle;
var xSupport = (cssStyleDeclaration.backgroundPositionX == '3px') || (cssStyleDeclaration['background-position-x'] == '3px');
var ySupport = (cssStyleDeclaration.backgroundPositionY == '5px') || (cssStyleDeclaration['background-position-y'] == '5px');
return xSupport && ySupport;
});
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('bgpositionxy', function () {
return testAllProps('backgroundPositionX', '3px') && testAllProps('backgroundPositionY', '5px');
});
});

View File

@@ -16,20 +16,7 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
function getBgRepeatValue( elem ) {
return (window.getComputedStyle ?
getComputedStyle(elem, null).getPropertyValue('background') :
elem.currentStyle['background']);
}
testStyles(' #modernizr { background-repeat: round; } ', function( elem, rule ) {
Modernizr.addTest('bgrepeatround', getBgRepeatValue(elem) == 'round');
});
testStyles(' #modernizr { background-repeat: space; } ', function( elem, rule ) {
Modernizr.addTest('bgrepeatspace', getBgRepeatValue(elem) == 'space');
});
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('bgrepeatround', testAllProps('backgroundRepeat', 'round'));
Modernizr.addTest('bgrepeatspace', testAllProps('backgroundRepeat', 'space'));
});

View File

@@ -9,14 +9,6 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
testStyles('#modernizr{background-size:cover}', function( elem ) {
var style = window.getComputedStyle ?
window.getComputedStyle(elem, null)
: elem.currentStyle;
Modernizr.addTest('bgsizecover', style.backgroundSize == 'cover' );
});
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('bgsizecover', testAllProps('backgroundSize', 'cover'));
});

View File

@@ -8,5 +8,5 @@
}
!*/
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('borderimage', testAllProps('borderImageWidth', '2px'));
Modernizr.addTest('borderimage', testAllProps('borderImage', 'url()'));
});

View File

@@ -13,12 +13,7 @@
}]
}
!*/
define(['Modernizr', 'testStyles'], function( Modernizr, testStyles ) {
testStyles(' #modernizr { display: run-in; } ', function( elem, rule ) {
var ret = (window.getComputedStyle ?
getComputedStyle(elem, null).getPropertyValue('display') :
elem.currentStyle['display']);
Modernizr.addTest('displayrunin', ret == 'run-in', { aliases: ['display-runin'] });
});
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
Modernizr.addTest('displayrunin', testAllProps('display', 'run-in'),
{ aliases: ['display-runin'] });
});

View File

@@ -1,20 +1,6 @@
define(['Modernizr', 'prefixed', 'docElement'], function( Modernizr, prefixed, docElement ) {
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
// http://www.w3.org/TR/css3-exclusions
// Examples: http://html.adobe.com/webstandards/cssexclusions
// Separate test for `wrap-flow` property as IE10 has just implemented this alone
Modernizr.addTest('wrapflow', function () {
var prefixedProperty = prefixed('wrapFlow'),
wrapFlowProperty;
if (!prefixedProperty)
return false;
wrapFlowProperty = prefixedProperty.replace(/([A-Z])/g, function (str, m1) { return '-' + m1.toLowerCase(); }).replace(/^ms-/, '-ms-');
return Modernizr.testStyles('#modernizr { ' + wrapFlowProperty + ':start }', function (elem) {
// Check against computed value
var styleObj = window.getComputedStyle ? getComputedStyle(elem, null) : elem.currentStyle;
return styleObj[prefixed('wrapFlow', docElement.style, false)] == 'start';
});
});
Modernizr.addTest('wrapflow', testAllProps('wrapFlow', 'start'));
});