From 562594c4166c23899ad9512ef06b463ec8bd11dd Mon Sep 17 00:00:00 2001 From: Kenneth Myhra Date: Mon, 13 Feb 2023 10:59:19 +0100 Subject: [PATCH] LibWeb: Do not assume field element is always a HTMLInputElement Cast to a HTMLElement instead and retrieve the value attribute from there instead. --- .../Libraries/LibWeb/HTML/FormControlInfrastructure.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp b/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp index 8b87aa9740..dd60727a4c 100644 --- a/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp +++ b/Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp @@ -150,9 +150,9 @@ WebIDL::ExceptionOr> construct_e // FIXME: 2. Create an entry with name and charset, and append it to entry list. // 10. Otherwise, create an entry with name and the value of the field element, and append it to entry list. else { - auto* input_element = dynamic_cast(control.ptr()); - VERIFY(input_element); - TRY_OR_THROW_OOM(vm, form_data_entries.try_append(input_element->value())); + auto* element = dynamic_cast(control.ptr()); + VERIFY(element); + TRY_OR_THROW_OOM(vm, form_data_entries.try_append(element->attribute("value"sv))); TRY_OR_THROW_OOM(vm, entry_list.try_set(name, form_data_entries)); }