mirror of
https://github.com/Modernizr/Modernizr.git
synced 2026-05-02 03:03:05 -04:00
Merge branch 'supports-featureupdates' into supports
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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'));
|
||||
});
|
||||
|
||||
@@ -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'));
|
||||
});
|
||||
|
||||
@@ -8,5 +8,5 @@
|
||||
}
|
||||
!*/
|
||||
define(['Modernizr', 'testAllProps'], function( Modernizr, testAllProps ) {
|
||||
Modernizr.addTest('borderimage', testAllProps('borderImageWidth', '2px'));
|
||||
Modernizr.addTest('borderimage', testAllProps('borderImage', 'url()'));
|
||||
});
|
||||
|
||||
@@ -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'] });
|
||||
});
|
||||
|
||||
@@ -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'));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user