1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/reftests/css-valuesandunits/unit-vh-vw-overflow-scroll-ref-iframe.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +<style> 1.5 + body { overflow: scroll } 1.6 + div { 1.7 + width: 10px; 1.8 + height: 10px; 1.9 + background-color: #d64203; 1.10 + } 1.11 +</style> 1.12 + 1.13 +<body> 1.14 + <div id="a"></div> 1.15 + <div id="b"></div> 1.16 + <div id="c"></div> 1.17 + <div id="d"></div> 1.18 + 1.19 + <!-- 1.20 + Ensure that the scroller positioned the same way as it would be in the 1.21 + 'overflow: auto' case. We'll have scrollbars either way, but we don't 1.22 + want the '!=' reftest to spuriously succeed because of the scrollers. 1.23 + --> 1.24 + <div style="width: 500px; height: 500px; background-color: black"> 1.25 +</body> 1.26 + 1.27 +<script> 1.28 + // client{Width, Height} consist of the area _inside_ the scrollbars, so these 1.29 + // manually calculated units reflect the fact that with 'overflow: scroll' set, 1.30 + // viewport units are sized taking the scrollbars into account. 1.31 + var vw = 0.01 * document.body.clientWidth; 1.32 + var vh = 0.01 * document.body.clientHeight; 1.33 + var vmin = Math.min(vw, vh); 1.34 + var vmax = Math.max(vw, vh); 1.35 + document.getElementById('a').style.width = (50 * vw) + "px"; 1.36 + document.getElementById('b').style.height = (25 * vh) + "px"; 1.37 + document.getElementById('c').style.width = (35 * vmin) + "px"; 1.38 + document.getElementById('d').style.height = (25 * vmax) + "px"; 1.39 +</script>