diff options
author | Kenneth Myhra <kennethmyhra@gmail.com> | 2023-02-13 10:59:19 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-13 14:34:37 +0000 |
commit | 562594c4166c23899ad9512ef06b463ec8bd11dd (patch) | |
tree | 4bca61f0e5373a1390d03f633b18615307a8bffd /Userland/Libraries/LibWeb | |
parent | 7d23af49c22ba46e30fbfbc0c6f40672d4ca294a (diff) | |
download | serenity-562594c4166c23899ad9512ef06b463ec8bd11dd.zip |
LibWeb: Do not assume field element is always a HTMLInputElement
Cast to a HTMLElement instead and retrieve the value attribute from
there instead.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/FormControlInfrastructure.cpp | 6 |
1 files 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<Optional<HashMapWithVectorOfFormDataEntryValue>> 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<HTML::HTMLInputElement*>(control.ptr()); - VERIFY(input_element); - TRY_OR_THROW_OOM(vm, form_data_entries.try_append(input_element->value())); + auto* element = dynamic_cast<HTML::HTMLElement*>(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)); } |