tor-browser

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

helper_touch_action_ordering_zindex.html (1489B)


      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>Touch-action with sorted element</title>
      7    <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
      8    <script type="application/javascript" src="apz_test_utils.js"></script>
      9    <script type="application/javascript" src="/tests/SimpleTest/paint_listener.js"></script>
     10    <script type="application/javascript">
     11    async function test() {
     12        var target = document.getElementById("target");
     13        let touchEndPromise = promiseTouchEnd(document.body);
     14 
     15        // drag the page up to scroll down by 50px
     16        ok(await synthesizeNativeTouchDrag(target, 10, 100, 0, -50),
     17            "Synthesized native vertical drag, waiting for touch-end event...");
     18        await touchEndPromise;
     19 
     20        await promiseOnlyApzControllerFlushed();
     21 
     22        is(window.scrollX, 0, "X scroll offset didn't change");
     23        is(window.scrollY, 50, "Y scroll offset changed");
     24    }
     25 
     26    waitUntilApzStable()
     27        .then(test)
     28        .then(subtestDone);
     29    </script>
     30 </head>
     31 <body style="border: solid 1px green">
     32    <div id="spacer" style="height:2000px">
     33        <div id="target" style="width:200px; height:200px; background-color:blue;"></div>
     34        <div style="position: relative; width:200px; height:200px; background-color:red; touch-action:none; margin-top:-200px; z-index: -1;"></div>
     35    </div>
     36 </body>
     37 </html>