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

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 <style>
     2   body { overflow: scroll }
     3   div {
     4     width: 10px;
     5     height: 10px;
     6     background-color: #d64203;
     7   }
     8 </style>
    10 <body>
    11   <div id="a"></div>
    12   <div id="b"></div>
    13   <div id="c"></div>
    14   <div id="d"></div>
    16   <!--
    17   Ensure that the scroller positioned the same way as it would be in the
    18   'overflow: auto' case. We'll have scrollbars either way, but we don't
    19   want the '!=' reftest to spuriously succeed because of the scrollers.
    20   -->
    21   <div style="width: 500px; height: 500px; background-color: black">
    22 </body>
    24 <script>
    25   // client{Width, Height} consist of the area _inside_ the scrollbars, so these
    26   // manually calculated units reflect the fact that with 'overflow: scroll' set,
    27   // viewport units are sized taking the scrollbars into account.
    28   var vw = 0.01 * document.body.clientWidth;
    29   var vh = 0.01 * document.body.clientHeight;
    30   var vmin = Math.min(vw, vh);
    31   var vmax = Math.max(vw, vh);
    32   document.getElementById('a').style.width = (50 * vw) + "px";
    33   document.getElementById('b').style.height = (25 * vh) + "px";
    34   document.getElementById('c').style.width = (35 * vmin) + "px";
    35   document.getElementById('d').style.height = (25 * vmax) + "px";
    36 </script>

mercurial