summaryrefslogtreecommitdiffstats
path: root/docshell/test/file_anchor_scroll_after_document_open.html
blob: 7903380eac6d317a3ecf4c4132dc9e14b09e273c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<script>
  if (location.hash == "#target") {
    parent.postMessage("haveHash", "*");
  } else {
    document.addEventListener("DOMContentLoaded", function() {
      document.open();
      document.write("<!DOCTYPE html><html style='height: 100%'><body style='height: 100%'><div style='height: 200%'></div><div id='target'></div></body></html>");
      document.close();
      // Notify parent via postMessage, since otherwise exceptions will not get
      // caught by its onerror handler.
      parent.postMessage("doTest", "*");
    });
  }
</script>