summaryrefslogtreecommitdiffstats
path: root/docshell/test/file_anchor_scroll_after_document_open.html
diff options
context:
space:
mode:
Diffstat (limited to 'docshell/test/file_anchor_scroll_after_document_open.html')
-rw-r--r--docshell/test/file_anchor_scroll_after_document_open.html15
1 files changed, 15 insertions, 0 deletions
diff --git a/docshell/test/file_anchor_scroll_after_document_open.html b/docshell/test/file_anchor_scroll_after_document_open.html
new file mode 100644
index 000000000..7903380ea
--- /dev/null
+++ b/docshell/test/file_anchor_scroll_after_document_open.html
@@ -0,0 +1,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>