ladybird/Tests/LibWeb/Text/input/HTML/HTMLSelectElement-with-detached-option.html
Tim Ledbetter 2227674b91 LibWeb: Don't crash when updating a select with detached option elements
`Node::shadow_including_root()` was missing a null check, which caused
a crash when manipulating a select element, whose option elements were
initially detached.
2024-03-23 20:56:26 +01:00

13 lines
432 B
HTML

<!DOCTYPE html>
<script src="../include.js"></script>
<select></select>
<script>
test(() => {
const selectElement = document.querySelector("select");
const optionElement = document.createElement("option");
optionElement.innerHTML = "option text"
selectElement.appendChild(optionElement);
document.body.removeChild(selectElement);
println("PASS (didn't crash)");
});
</script>