summaryrefslogtreecommitdiff
path: root/source/bower_components/modernizr/feature-detects/css-vhunit.js
blob: 9de2b64e785cec543234e4b8fe1eadf82216835a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// https://github.com/Modernizr/Modernizr/issues/572
// Similar to http://jsfiddle.net/FWeinb/etnYC/
Modernizr.addTest('cssvhunit', function() {
    var bool;
    Modernizr.testStyles("#modernizr { height: 50vh; }", function(elem, rule) {   
        var height = parseInt(window.innerHeight/2,10),
            compStyle = parseInt((window.getComputedStyle ?
                      getComputedStyle(elem, null) :
                      elem.currentStyle)["height"],10);
        
        bool= (compStyle == height);
    });
    return bool;
});