LibWeb: Limit HTMLSelectElement.size to allowed values

This change ensures that the correct default value of 0 is used and
that values greater than 2147483647 will fall back to the default value.

It also splits the display size concept into a separate method, as
this isn't supposed to be used when getting the IDL property.
This commit is contained in:
Tim Ledbetter 2024-11-29 11:19:31 +00:00 committed by Andreas Kling
commit 6218f1a609
Notes: github-actions[bot] 2024-11-29 12:39:58 +00:00
5 changed files with 41 additions and 4 deletions

View file

@ -31,6 +31,7 @@
testProperty("input", "size", (input) => input.size, (input, value) => input.size = value);
testProperty("marquee", "scrollAmount", (marquee) => marquee.scrollAmount, (marquee, value) => marquee.scrollAmount = value);
testProperty("marquee", "scrollDelay", (marquee) => marquee.scrollDelay, (marquee, value) => marquee.scrollDelay = value);
testProperty("select", "size", (select) => select.size, (select, value) => select.size = value);
testProperty("textarea", "rows", (textarea) => textarea.rows, (textarea, value) => textarea.rows = value);
testProperty("textarea", "cols", (textarea) => textarea.cols, (textarea, value) => textarea.cols = value);
});