layout/reftests/css-valuesandunits/unit-vh-vw-overflow-scroll-x-ref-iframe.html

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 <style>
     2   body { overflow-x: scroll }
     3   div {
     4     width: 10px;
     5     height: 10px;
     6     background-color: #d64203;
     7   }
     8 </style>
    10 <body>
    11   <div style="width: 50px"></div> <!-- Unaffected by scrollbars. -->
    12   <div id="b"></div>
    13   <div style="width: 35px"></div> <!-- Unaffected by scrollbars. -->
    14   <div id="d"></div>
    16   <!-- Deliberately make scrollbars appear. -->
    17   <div style="width: 500px; height: 500px; background-color: black">
    18 </body>
    20 <script>
    21   // client{Width, Height} consist of the area _inside_ the scrollbars, so these
    22   // manually calculated units reflect the fact that with 'overflow: scroll' set,
    23   // viewport units are sized taking the scrollbars into account. Since we're
    24   // only dealing with 'overflow-x' here, only the height units are affected.
    25   var vh = 0.01 * document.body.clientHeight;
    26   document.getElementById('b').style.height = (25 * vh) + "px";
    27   document.getElementById('d').style.height = (25 * vh) + "px";
    28 </script>

mercurial