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
parent 6bfc35b6a9
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

@ -115,6 +115,8 @@ private:
void update_inner_text_element();
void queue_input_and_change_events();
u32 display_size() const;
GC::Ptr<HTMLOptionsCollection> m_options;
GC::Ptr<DOM::HTMLCollection> m_selected_options;
bool m_is_open { false };