gfx/layers/apz/test/mochitest/helper_scroll_snap_no_valid_snap_position.html
author Cosmin Sabou <csabou@mozilla.com>
Sun, 05 Feb 2023 19:37:33 +0000
changeset 651812 d8601249f1eb8c52c742b0c19c9ca0fa8f2e31fe
parent 562391 9c19da5ffeca6954d957a477aec346496ccc97bd
permissions -rw-r--r--
Bug 1806090 - temporarily disable browser_quickactions.js on linux for frequent failures. r=intermittent-reviewers,MasterWayZ Differential Revision: https://phabricator.services.mozilla.com/D168909

<!DOCTYPE HTML>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>No snapping occurs if there is no valid snap position</title>
  <script src="apz_test_utils.js"></script>
  <script src="apz_test_native_event_utils.js"></script>
  <script src="/tests/SimpleTest/paint_listener.js"></script>
  <style>
    div {
      position: absolute;
    }
    #scroller {
      width: 100%;
      height: 500px;
      overflow-y: scroll;
      scroll-snap-type: y mandatory;
    }
    .child {
      width: 100%;
      height: 100px;
      background-color: blue;
    }
  </style>
</head>
<body>
  <div id="scroller">
    <div class="child" style="top: 0px;"></div>
    <div style="width: 100%; height: 2000px;"></div>
    <div class="child" style="top: 1000px;"></div>
  </div>
  <script type="application/javascript">
    async function test() {
      await promiseMoveMouseAndScrollWheelOver(scroller, 100, 100);

      ok(scroller.scrollTop > 0, "Scroll should happen some amount");
    }

    waitUntilApzStable()
    .then(test)
    .then(subtestDone, subtestFailed);
  </script>
</body>
</html>