testing/web-platform/tests/css/css-overflow/scroll-buttons-activation-with-columns.html
author Florian Quèze <florian@queze.net>
Tue, 08 Jul 2025 20:48:53 +0000 (8 hours ago)
changeset 795809 b01190f141a12f4b506acb1f4476561c4b0f2407
parent 768437 877811fa850eb0ca2ae45988f15a89a8e48c100d
permissions -rw-r--r--
Bug 1960567 - remove the last C++ and scriptable APIs to accumulate data to legacy telemetry histograms, r=chutten. Differential Revision: https://phabricator.services.mozilla.com/D255582
<!doctype html>
<meta charset="utf-8">
<title>CSS Overflow Test: ::scroll-button() activation with column scroll markers</title>
<link rel="help" href="https://drafts.csswg.org/css-overflow-5/#scroll-buttons">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<style>
  * {
    margin: 0;
    padding: 0;
  }

  #scroller {
    width: 600px;
    height: 300px;
    overflow: auto;
    columns: 1;
    gap: 0;
    column-fill: auto;
    scroll-marker-group: after;
    white-space: nowrap;
  }

  #scroller div {
    background: green;
    display: inline-block;
    width: 600px;
    height: 270px;
  }

  #scroller :first-child {
    background: purple;
  }

  #scroller::scroll-marker-group {
    border: 3px solid black;
    padding: 5px;
    display: flex;
    height: 20px;
    width: 40px;
  }

  #scroller::scroll-button(right) {
    content: ">";
    background: blue;
    display: flex;
    height: 20px;
    width: 20px;
    top: 0px;
    left: 0px;
    position: absolute;
    z-index: 99;
  }

  #scroller::column::scroll-marker {
    content: "";
    width: 10px;
    height: 10px;
    background-color: blue;
    border-radius: 100%;
    display: inline-block;
  }
</style>
<div id="scroller">
  <div></div>
  <br>
  <div></div>
</div>
<script>
  /*
    Double click as recommended scroll amount is 85% of the page, so
    to make sure all browsers reach the end.
  */
  promise_test(async t => {
    actions_promise = new test_driver.Actions()
    .pointerMove(5, 5)
    .pointerDown()
    .pointerUp()
    .pointerDown()
    .pointerUp()
    .send();
    await actions_promise;
    assert_equals(scroller.scrollLeft, 600);
  });
</script>