1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 18:57:35 +00:00

LibWeb: Introduce the FormData interface from the XHR specification

This commit is contained in:
Kenneth Myhra 2023-02-03 21:50:05 +01:00 committed by Linus Groh
parent b74d5a423d
commit d5b5b94a35
9 changed files with 317 additions and 0 deletions

View file

@ -0,0 +1,23 @@
#import <FileAPI/Blob.idl>
#import <FileAPI/File.idl>
#import <HTML/HTMLFormElement.idl>
typedef (File or USVString) FormDataEntryValue;
// https://xhr.spec.whatwg.org/#interface-formdata
[Exposed=Window]
interface FormData {
constructor(optional HTMLFormElement form);
undefined append(USVString name, USVString value);
undefined append(USVString name, Blob blobValue, optional USVString filename);
undefined delete(USVString name);
// FIXME: The BindingsGenerator is not able to resolve the Variant's visit for FormDataEntryValue when
// the return value for one function returns an optional FormDataEntryValue while the others does not.
(File or USVString)? get(USVString name);
sequence<FormDataEntryValue> getAll(USVString name);
boolean has(USVString name);
undefined set(USVString name, USVString value);
undefined set(USVString name, Blob blobValue, optional USVString filename);
// FIXME: iterable<USVString, FormDataEntryValue>;
};