tor-browser

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

test_bug1831148.html (1138B)


      1 <!DOCTYPE html>
      2 <html>
      3 <script src="/tests/SimpleTest/SimpleTest.js"></script>
      4 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
      5 <style>
      6 #marker {
      7  width: 1px;
      8  height: 1px;
      9 }
     10 #outer {
     11  height: 1000px;
     12  background: #a0ffff;
     13  overflow: scroll;
     14 }
     15 
     16 #inner {
     17  height: 16593200px;
     18  background: #ffa0a0;
     19 }
     20 
     21 .log {
     22  white-space: pre;
     23 }
     24 </style>
     25 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1831148">Mozilla Bug 1831148</a>
     26 <div id="marker"></div>
     27 <div id="outer">
     28  <div id="inner"></div>
     29 </div>
     30 <script>
     31 SimpleTest.waitForExplicitFinish();
     32 addLoadEvent(() => {
     33  const interval = 20;
     34  const increment = outer.scrollHeight / interval;
     35  const offset = marker.getBoundingClientRect().bottom;
     36  for (let i = 0; i < interval; i++) {
     37    outer.scrollTop = i * increment;
     38    console.log(outer.scrollTop);
     39    // Shift to account for viewport coordinate shift.
     40    const bcrTop = -inner.getBoundingClientRect().top + offset;
     41    // Floating point value diverges from scrollTop.
     42    isfuzzy(bcrTop, outer.scrollTop, 1, "scrollTop and BCR top match");
     43  }
     44  SimpleTest.finish();
     45 });
     46 </script>