tor-browser

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

test_bug1151667.html (2013B)


      1 <!DOCTYPE HTML>
      2 <html>
      3 <!--
      4 https://bugzilla.mozilla.org/show_bug.cgi?id=1151667
      5 -->
      6 <head>
      7  <title>Test for Bug 1151667</title>
      8  <script src="/tests/SimpleTest/SimpleTest.js"></script>
      9  <script src="/tests/SimpleTest/EventUtils.js"></script>
     10  <script src="/tests/SimpleTest/paint_listener.js"></script>
     11  <script type="application/javascript" src="apz_test_native_event_utils.js"></script>
     12  <script type="application/javascript" src="apz_test_utils.js"></script>
     13  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
     14  <style>
     15  #subframe {
     16    margin-top: 100px;
     17    height: 500px;
     18    width: 500px;
     19    overflow: scroll;
     20  }
     21  #subframe-content {
     22    height: 1000px;
     23    width: 500px;
     24    /* the background is so that we can see it scroll*/
     25    background: repeating-linear-gradient(#EEE, #EEE 100px, #DDD 100px, #DDD 200px);
     26  }
     27  #page-content {
     28    height: 5000px;
     29    width: 500px;
     30  }
     31  </style>
     32 </head>
     33 <body>
     34 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151667">Mozilla Bug 1151667</a>
     35 <p id="display"></p>
     36 <div id="subframe">
     37  <!-- This makes sure the subframe is scrollable -->
     38  <div id="subframe-content"></div>
     39 </div>
     40 <!-- This makes sure the page is also scrollable, so it (rather than the subframe)
     41     is considered the primary async-scrollable frame, and so the subframe isn't
     42     layerized upon page load. -->
     43 <div id="page-content"></div>
     44 <pre id="test">
     45 <script type="application/javascript">
     46 
     47 async function test() {
     48  var subframe = document.getElementById("subframe");
     49  await promiseNativeWheelAndWaitForScrollEvent(subframe, 100, 150, 0, -10);
     50 
     51  is(subframe.scrollTop > 0, true, "We should have scrolled the subframe down");
     52  is(document.documentElement.scrollTop, 0, "We should not have scrolled the page");
     53 }
     54 
     55 SimpleTest.waitForExplicitFinish();
     56 pushPrefs([["general.smoothScroll", false]])
     57  .then(waitUntilApzStable)
     58  .then(test)
     59  .then(SimpleTest.finish, SimpleTest.finishWithFailure);
     60 
     61 </script>
     62 </pre>
     63 </body>
     64 </html>