<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="../../resources/js-test-pre.js"></script>
</head>
<body>
<select foo="bar">
<option name="A">A</option>
</select>
<script>

description("This test verifies that a HTMLCollection protects its base node from being GC'd.");

options = document.getElementsByTagName("select")[0].options;

document.body.removeChild(document.getElementsByTagName("select")[0]);

gc();

options[0] = new Option("bik", "bok");
shouldBe("options[0].parentNode.getAttribute('foo')", "'bar'");

</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>
