tor-browser

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

scroll-marker-hover-remove.html (1930B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <title>CSS Test: ::scroll-marker:hover is removed correctly</title>
      4 <link rel="help" href="https://drafts.csswg.org/css-overflow-5/#scroll-marker">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/resources/testdriver.js"></script>
      8 <script src="/resources/testdriver-actions.js"></script>
      9 <script src="/resources/testdriver-vendor.js"></script>
     10 <style>
     11  body {
     12    margin: 0;
     13  }
     14 
     15  #scroller {
     16    width: 600px;
     17    height: 300px;
     18    overflow: auto;
     19    scroll-marker-group: before;
     20    white-space: nowrap;
     21  }
     22 
     23  #scroller div {
     24    background: green;
     25    display: inline-block;
     26    width: 600px;
     27    height: 270px;
     28  }
     29 
     30  #scroller div:hover {
     31    background-color: blue;
     32  }
     33 
     34  #scroller::scroll-marker-group {
     35    display: flex;
     36    height: 20px;
     37    width: 40px;
     38  }
     39 
     40  .scroller div::scroll-marker {
     41    content: "";
     42    width: 100px;
     43    height: 20px;
     44    background-color: green;
     45    display: inline-block;
     46  }
     47 
     48  .scroller div::scroll-marker:hover {
     49    background-color: blue;
     50  }
     51 </style>
     52 <div id="scroller" class="scroller">
     53  <div id="target"></div>
     54  <div></div>
     55 </div>
     56 <script>
     57  promise_test(async t => {
     58    actions_promise = new test_driver.Actions()
     59      .pointerMove(15, 15)
     60      .send();
     61    await actions_promise;
     62    assert_equals(getComputedStyle(target, "::scroll-marker").backgroundColor, "rgb(0, 0, 255)", "::scroll-marker changes on hover via :hover");
     63    assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 0, 255)", "::scroll-marker's originating element is hovered when ::scroll-marker is hovered");
     64    scroller.classList.remove("scroller");
     65    requestAnimationFrame(() => {
     66      assert_equals(getComputedStyle(target).backgroundColor, "rgb(0, 128, 0)", "::scroll-marker's originating element is not hovered when ::scroll-marker is removed");
     67    });
     68  });
     69 </script>