tor-browser

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

helper_doubletap_zoom_tablecell.html (2826B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=2100"/>
      6  <title>Check that double tapping small table cells does not zoom</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  <script>
     11 
     12 async function test() {
     13  let useTouchpad = (location.search == "?touchpad");
     14 
     15  let resolution = await getResolution();
     16  ok(resolution > 0,
     17     "The initial_resolution is " + resolution + ", which is some sane value");
     18 
     19  // Check that double-tapping does not zoom in
     20  info("sending first double tap");
     21  await doubleTapOn(document.getElementById("target1"), 10, 10, useTouchpad);
     22  let prev_resolution = resolution;
     23  resolution = await getResolution();
     24  ok(resolution == prev_resolution, "The first double-tap did not change the resolution: " + resolution);
     25 
     26  // Check that double-tapping does not zoom in
     27  info("sending second double tap");
     28  await doubleTapOn(document.getElementById("target2"), 10, 10, useTouchpad);
     29  prev_resolution = resolution;
     30  resolution = await getResolution();
     31  ok(resolution == prev_resolution, "The second double-tap did not change the resolution: " + resolution);
     32 
     33  // Check that double-tapping does zoom in
     34  info("sending third double tap");
     35  await doubleTapOn(document.getElementById("target3"), 10, 10, useTouchpad);
     36  prev_resolution = resolution;
     37  resolution = await getResolution();
     38  ok(resolution > prev_resolution, "The third double-tap has increased the resolution to " + resolution);
     39 }
     40 
     41 waitUntilApzStable()
     42 .then(test)
     43 .then(subtestDone, subtestFailed);
     44 
     45  </script>
     46  <style>
     47    table {
     48      width: 100%;
     49    }
     50    table,
     51    td {
     52        border: 1px solid #333;
     53    }
     54    td {
     55      height: 25px;
     56    }
     57    .small {
     58      width: 15vw;
     59    }
     60    .big {
     61      width: 50vw;
     62    }
     63  </style>
     64 </head>
     65 <body>
     66 <table>
     67    <thead>
     68        <tr>
     69            <th colspan="2">The table header</th>
     70        </tr>
     71    </thead>
     72    <tbody>
     73        <tr>
     74            <td class="small"><div id="target1" class="small">The table body</div></td>
     75            <td>with two columns</td>
     76        </tr>
     77    </tbody>
     78 </table>
     79 
     80 <table>
     81    <thead>
     82        <tr>
     83            <th colspan="2">The table header</th>
     84        </tr>
     85    </thead>
     86    <tbody>
     87        <tr>
     88            <td class="small"><div class="small"><div id="target2" class="small">The table body</div></div></td>
     89            <td>with two columns</td>
     90        </tr>
     91    </tbody>
     92 </table>
     93 
     94 <table>
     95    <thead>
     96        <tr>
     97            <th colspan="2">The table header</th>
     98        </tr>
     99    </thead>
    100    <tbody>
    101        <tr>
    102            <td id="target3" class="big">The table body</td>
    103            <td>with two columns</td>
    104        </tr>
    105    </tbody>
    106 </table>
    107 
    108 
    109 </body>
    110 </html>