tor-browser

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

helper_doubletap_zoom_touch_action_manipulation.html (1570B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=2100"/>
      6  <title>Tests that double tap to zoom doesn't work on touch-action: manipulation 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  <script>
     11 
     12 async function test() {
     13  let useTouchpad = (location.search == "?touchpad");
     14 
     15  var resolution = await getResolution();
     16  ok(resolution > 0,
     17     "The initial_resolution is " + resolution + ", which is some sane value");
     18 
     19  // A double tap on the touch-action: manipulation element.
     20  await synthesizeDoubleTap(document.getElementById("target"), 20, 20, useTouchpad);
     21 
     22  for (let i = 0; i < 10; i++) {
     23    await promiseFrame();
     24  }
     25 
     26  // Flush state just in case.
     27  await promiseApzFlushedRepaints();
     28 
     29  var prev_resolution = resolution;
     30  resolution = await getResolution();
     31  if (!useTouchpad) {
     32    is(resolution, prev_resolution, "No zoom should happen on touchscreen");
     33  } else {
     34    isnot(resolution, prev_resolution, "Zoom should happen on touchpad");
     35  }
     36 
     37  // Send another tap event outside of the area where
     38  // `touch-action: manipulation` is specified so that it will create a new
     39  // touch block to avoid bug 1848062 on Mac.
     40  await synthesizeNativeTap(target, 200, 200);
     41 }
     42 
     43 waitUntilApzStable()
     44 .then(test)
     45 .then(subtestDone, subtestFailed);
     46 
     47  </script>
     48 </head>
     49 <body>
     50 
     51 <div id="target" style="width: 100px; height: 100px; touch-action: manipulation;"></div>
     52 
     53 </body>
     54 </html>