LibWeb: Implement formData() for "multipart/form-data"

This commit is contained in:
Feng Yu 2024-12-24 19:11:33 -08:00 committed by Tim Ledbetter
commit 8b097b38dd
Notes: github-actions[bot] 2025-01-20 23:34:52 +00:00
27 changed files with 1356 additions and 4 deletions

View file

@ -70,6 +70,11 @@ WebIDL::ExceptionOr<GC::Ref<FormData>> FormData::create(JS::Realm& realm, Vector
return construct_impl(realm, move(list));
}
WebIDL::ExceptionOr<GC::Ref<FormData>> FormData::create(JS::Realm& realm, Vector<FormDataEntry> entry_list)
{
return construct_impl(realm, move(entry_list));
}
FormData::FormData(JS::Realm& realm, Vector<FormDataEntry> entry_list)
: PlatformObject(realm)
, m_entry_list(move(entry_list))

View file

@ -28,6 +28,7 @@ public:
static WebIDL::ExceptionOr<GC::Ref<FormData>> construct_impl(JS::Realm&, Vector<FormDataEntry> entry_list);
static WebIDL::ExceptionOr<GC::Ref<FormData>> create(JS::Realm&, Vector<DOMURL::QueryParam> entry_list);
static WebIDL::ExceptionOr<GC::Ref<FormData>> create(JS::Realm&, Vector<FormDataEntry> entry_list);
WebIDL::ExceptionOr<void> append(String const& name, String const& value);
WebIDL::ExceptionOr<void> append(String const& name, GC::Ref<FileAPI::Blob> const& blob_value, Optional<String> const& filename = {});