1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

LibWeb: Convert FormData to String and Vector storage

This makes use of the new [UseNewAKString] extended attribute. Using
Vector storage will make it easier to make this interface into an IDL
iterable. It seems the reason it didn't use Vector originally was due
to awkward DeprecatedString -> String conversions.
This commit is contained in:
Luke Wilde 2023-02-17 18:57:58 +00:00 committed by Andreas Kling
parent c0f22065ab
commit 3275d659bf
6 changed files with 88 additions and 106 deletions

View file

@ -10,14 +10,7 @@
namespace Web::HTML {
using HashMapWithVectorOfFormDataEntryValue = HashMap<DeprecatedString, Vector<XHR::FormDataEntryValue>>;
struct Entry {
String name;
Variant<JS::NonnullGCPtr<FileAPI::File>, String> value;
};
WebIDL::ExceptionOr<Entry> create_entry(JS::Realm& realm, String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
WebIDL::ExceptionOr<Optional<HashMapWithVectorOfFormDataEntryValue>> construct_entry_list(JS::Realm&, HTMLFormElement&);
WebIDL::ExceptionOr<XHR::FormDataEntry> create_entry(JS::Realm& realm, String const& name, Variant<JS::NonnullGCPtr<FileAPI::Blob>, String> const& value, Optional<String> const& filename = {});
WebIDL::ExceptionOr<Optional<Vector<XHR::FormDataEntry>>> construct_entry_list(JS::Realm&, HTMLFormElement&);
}