Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/the-iframe-element/iframe-document-move-to-active-crash.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Moving focused iframe into an active document during focus change should not crash</title>
This test passes if it does not crash
<script>
const root = document.documentElement;
const activeIframe = document.createElement("iframe");
root.appendChild(activeIframe);
const targetIframe = document.createElement("iframe");
root.appendChild(targetIframe);
targetIframe.addEventListener("focusout", () => {
activeIframe.contentDocument.adoptNode(targetIframe);
})
targetIframe.focus();
const nextTarget = document.createElement("button");
root.appendChild(nextTarget);
nextTarget.focus();
</script>