blob: 62bfa8b1077fc6256693da93b56d3ece1c2804e2 [file] [log] [blame]
<!DOCTYPE html>
<body>
<p>Tests that there is no remove() overload taking an option element in parameter.</p>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<script>
test(function() {
const select = document.createElement("select");
const option = document.createElement("option");
select.appendChild(document.createElement("option"));
assert_equals(select.options.length, 1, "options.length before removal");
select.remove(option); // option gets coerced to index 0.
assert_equals(select.options.length, 0, "options.length after removal");
}, "HTMLSelectElement.remove()");
test(function() {
const select = document.createElement("select");
const option = document.createElement("option");
select.appendChild(document.createElement("option"));
assert_equals(select.options.length, 1, "options.length before removal");
select.options.remove(option); // option gets coerced to index 0.
assert_equals(select.options.length, 0, "options.length after removal");
}, "HTMLOptionsCollection.remove()");
</script>
</body>