tor-browser

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

helper_fixed_position_scroll_hittest.html (1524B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=device-width">
      6  <title>Hittest position:fixed zoomed scroll</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    body {
     12      margin: 0;
     13    }
     14    #fixed {
     15      position: fixed;
     16      height: 30px;
     17      width: 100%;
     18      background: linear-gradient(135deg, white, black);
     19    }
     20    #fixed > input {
     21      position: absolute;
     22      top: 0;
     23      right: 0;
     24      height: 100%;
     25    }
     26  </style>
     27 </head>
     28 <body>
     29  <div id="fixed"><input type="button" value="Button" /></div>
     30  <script>
     31    async function test() {
     32      let transformEndPromise = promiseTransformEnd();
     33      await synthesizeNativeTouchDrag(document.body, 10, 10, -2000, 0);
     34      await transformEndPromise;
     35 
     36      await promiseApzFlushedRepaints();
     37 
     38      let clickPromise = new Promise(resolve => {
     39        window.addEventListener("click", resolve);
     40      });
     41      let input = document.querySelector("input");
     42      await synthesizeNativeMouseEventWithAPZ({ type: "click", target: input, offsetX: 10, offsetY: 10 });
     43      let e = await clickPromise;
     44      is(e.target, input, "got click");
     45    }
     46 
     47    SpecialPowers.getDOMWindowUtils(window).setResolutionAndScaleTo(2.0);
     48    waitUntilApzStable().then(test).then(subtestDone, subtestFailed);
     49  </script>
     50 </body>
     51 </html>