LibWeb: Ensure enumerated attributes are always limited to known values

Previously, the invalid value default wasn't taken into account when
determining the value that should be returned from the getter of an
enumerated attribute. This caused a crash when an enumerated attribute
of type DOMString? was set to an invalid value.
This commit is contained in:
Tim Ledbetter 2024-03-21 18:34:01 +00:00 committed by Andreas Kling
commit 158d9a5921
Notes: sideshowbarker 2024-07-17 10:16:43 +09:00
3 changed files with 64 additions and 21 deletions

View file

@ -5,6 +5,10 @@
println(button.type);
button.setAttribute("type", "button");
println(button.type);
button.setAttribute("type", "BUTTON");
println(button.type);
button.setAttribute("type", "invalid");
println(button.type);
button.removeAttribute("type");
println(button.type);
});