Source code
Revision control
Copy as Markdown
Other Tools
<!DOCTYPE html>
<meta charset="utf-8">
<title>Reparenting in removeNode() in adoptNode() should not crash</title>
<div id="test-container"><script>
var sacrifice;
let testContainer = document.getElementById('test-container');
let iframe = document.createElement('iframe');
testContainer.appendChild(iframe);
let doc = iframe.contentDocument;
script.type = 'invalid-type';
script.textContent = 'document.body.appendChild(parent.sacrifice)';
sacrifice = document.createElement('div');
script.appendChild(sacrifice);
doc.body.appendChild(script);
script.type = '';
document.adoptNode(sacrifice);
</script>