docshell/test/file_anchor_scroll_after_document_open.html
author Boris Zbarsky <bzbarsky@mit.edu>
Mon, 04 Aug 2014 01:25:30 -0400
changeset 217382 48788ecea2c6fd740386b5413f8a308e14f7b8a5
parent 180217 4142d03082e1a76483be6b6736539edd749103ef
child 497594 58adc643dcdc20eccb4d30bc454b50420e96c020
permissions -rw-r--r--
Bug 1045096 - Make sure initial about:blank in iframes have a nsDOMNavigationTiming object, so we don't end up with window.performance throwing when accessed on their window. r=smaug, a=sledru

<!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>