Files
ladybird/Tests/LibWeb/Crash/HTML/non-html-elements-in-form.html
Tim Ledbetter cbd01b8efc LibWeb: Use fallible FormAssociatedElement cast in form elements filter
The `HTMLFormControlsCollection` filter iterates all descendants of the
form's root, which may include non HTMLElement elements such as SVG
elements. The unchecked `as<FormAssociatedElement>` cast would crash on
these elements. Use `as_if` with a null check instead.

This fixes a regression introduced in 9af3e34875.
2026-03-26 08:31:00 +01:00

6 lines
117 B
HTML

<!DOCTYPE html>
<form id="f"><svg></svg></form>
<script>
document.getElementById("f").elements.length;
</script>