// While Modernizr tests for up-and-coming features of HTML/CSS, currentizr.js
// is an add-on which detects support for features which all current browsers
// should support.
// Gotta start by duplicating some Modernizr code
c = document.createElement('currentizr');
c_style = c.style;

/**
 * test_props is a generic CSS / DOM property test; if a browser supports
 *   a certain property, it won't return undefined for it.
 *   A supported CSS property returns empty string when its not yet set.
 */

function test_props(props, callback) {
    for (var i in props) {
        if (c_style[props[i]] !== undefined && (!callback || callback(props[i]))) {
            return true;
        }
    }
}

/**
 * test_props_all tests a list of DOM properties we want to check against.
 *   We specify literally ALL possible (known and/or likely) properties on 
 *   the element including the non-vendor prefixed one, for forward-
 *   compatibility.
 */
function test_props_all(prop, callback) {
    var uc_prop = prop.charAt(0).toUpperCase() + prop.substr(1),
    props = [
    prop,
    'webkit' + uc_prop,
    'Moz' + uc_prop,
    'moz' + uc_prop,
    'o' + uc_prop,
    'ms' + uc_prop
    ];

    return !! test_props(props, callback);
}

Modernizr.addTest('textshadow',
function() {
    return test_props_all('textShadow');
});

Modernizr.addTest('minmax',
function() {
    return !! test_props(['minHeight', 'maxHeight', 'minWidth', 'maxWidth'])
});


