rollX');
    assert_approx_equals(window.scrollY, y, 0.5, 'scrollY');
  }, `scrollIntoView(${format_input(input)}) starting at left,top`);

  test(() => {
    window.scrollTo(0, 12000);
    testScrollIntoView(input);
    var x = (expectedX === "nearest") ? expectedXRight : expectedX;
    var y = (expectedY === "nearest") ? expectedYTop : expectedY;
    assert_approx_equals(window.scrollX, x, 0.5, 'scrollX');
    assert_approx_equals(window.scrollY, y, 0.5, 'scrollY');
  }, `scrollIntoView(${format_input(inp