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

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 <style>
     2   body { overflow-y: 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 style="height: 50px"></div> <!-- Unaffected by scrollbars. -->
    13   <div id="c"></div>
    14   <div style="height: 50px"></div> <!-- Unaffected by scrollbars. -->
    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-y' here, only the width units are affected.
    25   var vw = 0.01 * document.body.clientWidth;
    26   document.getElementById('a').style.width = (50 * vw) + "px";
    27   document.getElementById('c').style.width = (35 * vw) + "px";
    28 </script>

mercurial