tor-browser

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

helper_zoomToFocusedInput_zoom_in_position_fixed.html (1230B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=2100,initial-scale=0.4"/>
      6  <title>Tests that zoomToFocuedInput zooms in element in position:fixed element</title>
      7  <script src="apz_test_native_event_utils.js"></script>
      8  <script src="apz_test_utils.js"></script>
      9  <script src="/tests/SimpleTest/paint_listener.js"></script>
     10  <style>
     11  .container {
     12    top: 0px;
     13    height: 100px;
     14    width: calc(100% - 30px);
     15    position: fixed;
     16  }
     17  html {
     18    height: 500vh;
     19  }
     20  </style>
     21 </head>
     22 <body>
     23 <div class="container">
     24  <input>
     25 </div>
     26 <script>
     27 async function test() {
     28  const initial_resolution = await getResolution();
     29  ok(initial_resolution > 0,
     30     "The initial_resolution is " + initial_resolution + ", which is some sane value");
     31 
     32  document.querySelector("input").focus();
     33 
     34  const transformEndPromise = promiseTransformEnd();
     35  SpecialPowers.DOMWindowUtils.zoomToFocusedInput();
     36  await transformEndPromise;
     37  await promiseApzFlushedRepaints();
     38 
     39  let resolution = await getResolution();
     40  ok(resolution > initial_resolution, "zoomToFocusedInput zooms in to " + resolution);
     41 }
     42 
     43 waitUntilApzStable()
     44 .then(test)
     45 .then(subtestDone, subtestFailed);
     46 </script>
     47 </body>
     48 </html>