blob: 2404105b09a7724cf8cc5e2cf6d7bf7a8fb6f39b [file] [log] [blame]
<script>
function queueTest() {
// The timeout is necessary to avoid the parser still being active when
// `document.open()` is called and becoming a no-op.
//
// We also cannot use setTimeout(..., 0), as the parser is terminated in a
// task with DOM manipulation task source while the timeout is run in a task
// on the timer task source. The order is therefore not guaranteed. Let's
// play it safer and use some actual timeout.
setTimeout(() => {
document.open();
document.write("<p>New content</p>");
document.close();
opener.onDocumentOpen();
}, 200);
}
</script>
<body onload="opener.onFrameLoaded(); queueTest();">
<p>Old content</p>
</body>