blob: 85f0202e5089c9d2744f4d203f990b76db4fc63a [file] [log] [blame]
<!DOCTYPE html>
<html>
<body onload="runTest()">
<div id="container"></div>
<div id="child"></div>
<div><link id="link"></div>
<script src="../../resources/js-test-pre.js"></script>
<script>
description('This tests removing a node during beforeload event.');
var exitingLink = document.querySelector('link');
var newLink = document.createElement("link");
newLink.innerHTML = '<link id="link">';
var child = document.getElementById('child');
child.appendChild(newLink);
newLink.addEventListener('beforeload', () => {
document.getElementById("link").remove();
});
document.getElementById('container').appendChild(child);
shouldBe('document.getElementById("link")', 'exitingLink');
</script>
<script src="../../resources/js-test-post.js"></script>