tor-browser

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

helper_bug1934118.html (1807B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <head>
      4  <meta charset="utf-8">
      5  <meta name="viewport" content="width=device-width, initial-scale=1">
      6  <script src="apz_test_utils.js"></script>
      7  <script src="apz_test_native_event_utils.js"></script>
      8  <script src="/tests/SimpleTest/paint_listener.js"></script>
      9  <style>
     10  html {
     11    scroll-snap-type: x mandatory;
     12    overflow: scroll;
     13    scroll-behavior: smooth;
     14  }
     15  /*
     16   * Layout three child divs horizontally.
     17   * Each div has a horizontal snap point, but
     18   * doesn't have any vertical valid snap point.
     19   */
     20  .container {
     21    flex-direction: row;
     22    display: flex;
     23    width: 100vw;
     24    height: 30vh;
     25  }
     26  .container div {
     27    background-color: grey;
     28    width: 30vw;
     29    height: 100%;
     30    margin: 10px;
     31    scroll-snap-align: none center;
     32    scroll-snap-stop: always;
     33  }
     34  </style>
     35 </head>
     36 <body>
     37  <div class="container">
     38    <div></div>
     39    <div></div>
     40    <div></div>
     41  </div>
     42  <div style="height: 200vh"></div>
     43 </body>
     44 <script type="application/javascript">
     45 async function test() {
     46  const container = document.querySelector(".container");
     47 
     48  const scrollendPromise = promiseOneEvent(window, "scrollend");
     49 
     50  // Try to scroll down by a wheel event.
     51  synthesizeNativeWheel(container, 50, 50, 0, -50);
     52 
     53  // Wait for the end of the smooth scrolling triggered by above wheel event.
     54  await scrollendPromise;
     55 
     56  ok(window.scrollY, "`scroll-snap-type: x mandatory` doesn't trap vertical scrolling");
     57 }
     58 
     59 if (getPlatform() == "android") {
     60  ok(true, "Skipping test because native wheel events are not supported on Android");
     61  subtestDone();
     62 } else if (getPlatform() == "linux") {
     63  ok(true, "Skipping test on Linux because of bug 1889039");
     64  subtestDone();
     65 } else {
     66  waitUntilApzStable()
     67  .then(test)
     68  .then(subtestDone, subtestFailed);
     69 }
     70 </script>
     71 </html>