<script>
    window.onload = () => {
      const scroller = document.getElementById("scroller");
      const boxes = document.querySelectorAll(".snap.box");
      function box(n) {
        return boxes[n - 1];
      }

      promise_test(async (t) => {
        await waitForCompositorCommit();

        // Box 2 should be selected as the target in the y axis despite Box 1's
        // being a common target in both axes because Box 2 is nested within
        // Box 1.
        await runScrollSnapSelectionVerifi