tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

helper_hittest_fixed_bg.html (1441B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=device-width, initial-scale=1.0">
      6  <title>Hit-testing of fixed background image</title>
      7  <script type="application/javascript" src="apz_test_utils.js"></script>
      8  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
      9  <script src="/tests/SimpleTest/paint_listener.js"></script>
     10  <style>
     11      html,
     12      body {
     13        height: 100vh;
     14        margin: 0px;
     15        padding: 0px;
     16        overflow-x: hidden;
     17      }
     18      .bg-gradient {
     19        background: linear-gradient(white, green) fixed;
     20        height: 1000px;
     21        width: 100%;
     22      }
     23  </style>
     24  </head>
     25  <body>
     26    <div class="bg-gradient"></div>
     27    <div style="height: 1000px; background-color: green;"></div>
     28  </body>
     29 <script type="application/javascript">
     30 
     31 async function test() {
     32  var config = getHitTestConfig();
     33  var utils = config.utils;
     34 
     35  var body = document.querySelector("body");
     36  utils.setDisplayPortForElement(0, 0, 800, 2000, body, 1);
     37  await promiseApzFlushedRepaints();
     38 
     39  var target = document.querySelector(".bg-gradient");
     40  checkHitResult(hitTest(centerOf(target)),
     41                 APZHitResultFlags.VISIBLE,
     42                 utils.getViewId(body),
     43                 utils.getLayersId(),
     44                 "fixed bg image");
     45 }
     46 
     47 waitUntilApzStable()
     48 .then(test)
     49 .then(subtestDone, subtestFailed);
     50 
     51 </script>
     52 </html>
     53 </html>