tor-browser

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

scroller-covered-by-empty-svg.html (1490B)


      1 <!doctype html>
      2 <link rel="help" href="https://crbug.com/41490395">
      3 <script src=/resources/testharness.js></script>
      4 <script src=/resources/testharnessreport.js></script>
      5 <script src="/resources/testdriver.js"></script>
      6 <script src="/resources/testdriver-vendor.js"></script>
      7 <script src="/resources/testdriver-actions.js"></script>
      8 <style>
      9  #scroller {
     10    overflow: auto;
     11    width: 600px;
     12    height: 300px;
     13    border: 2px solid blue;
     14    will-change: scroll-position;
     15  }
     16 
     17  #svg {
     18    position: relative;
     19    top: -300px;
     20    width: 300px;
     21    height: 300px;
     22  }
     23 
     24  .spacer {
     25    height: 200vh;
     26  }
     27 </style>
     28 
     29 <div id="scroller">
     30  <div class="spacer"></div>
     31 </div>
     32 <svg id="svg"></svg>
     33 <div class="spacer"></div>
     34 
     35 <script>
     36  promise_test(async (t) => {
     37    let scrolled = new Promise((resolve) => {
     38      let scrollers = [window, document.getElementById("scroller")];
     39      let onscroll = (evt) => {
     40        for (const scroller of scrollers) {
     41          scroller.removeEventListener("scroll", onscroll);
     42        }
     43        resolve(evt.target.id || "root");
     44      }
     45      for (const scroller of scrollers) {
     46        scroller.addEventListener("scroll", onscroll);
     47      }
     48    });
     49    // Scroll in SVG. Should scroll the window.
     50    new test_driver.Actions().scroll(100, 100, 0, 50, { duration: 50 }).send();
     51    assert_equals(await scrolled, "root", "Scroll in SVG should scroll the window");
     52  }, "Wheel-scroll in empty SVG covering scroller should not scroll the scroller");
     53 </script>