iv id=scroller2>
  <div class="spacer"></div>
  <div id="scroller">
    <div class="spacer"></div>
    <iframe
      id="target"
      src="resources/subframe.html"
      loading="lazy"
      onload="iframe_onload();"
    ></iframe>
  </div>
</div>

<script>
  const t = async_test(
    "Test that lazy-loaded iframes load when near viewport."
  );

  function iframe_onload() {
    t.done();
  }

  t.step_timeout(() => {
    t.unreached_func(
      "Timed out while waiting for iframe to load."
    )();
  }, 2