blob: bd648c8a87a2b7d003614540db6e8b5c94dd00ca [file] [log] [blame]
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<script>
description("Passes if it doesn't crash and the child is not in the id map");
var script = document.createElement("script");
script.type = "dont-execute";
script.textContent = "script.remove()";
child = document.createElement("div");
child.id = "child";
script.appendChild(child);
// The script won't execute here because the type is invalid, but it also won't
// get marked as being already run, so changing the children later will run it.
document.documentElement.appendChild(script);
// Per the spec setting the type has no effect
script.type = "";
// but changing the children *will* execute the script now that the type is
// is valid.
child.remove();
child = null;
gc();
shouldBeNull("document.getElementById('child')");
</script>