From aeb815cc660c1cdd95072796bd45a80b913881eb Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 26 May 2024 10:49:03 +1200 Subject: [PATCH] LibWeb: Implement HTMLFormElement.enctype --- .../expected/HTML/form-element-enctype.txt | 5 +++++ .../Text/input/HTML/form-element-enctype.html | 18 ++++++++++++++++++ .../Libraries/LibWeb/HTML/HTMLFormElement.idl | 10 +++++++++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Tests/LibWeb/Text/expected/HTML/form-element-enctype.txt create mode 100644 Tests/LibWeb/Text/input/HTML/form-element-enctype.html diff --git a/Tests/LibWeb/Text/expected/HTML/form-element-enctype.txt b/Tests/LibWeb/Text/expected/HTML/form-element-enctype.txt new file mode 100644 index 00000000000..4e5e08d258d --- /dev/null +++ b/Tests/LibWeb/Text/expected/HTML/form-element-enctype.txt @@ -0,0 +1,5 @@ + enctype | application/x-www-form-urlencoded + +enctype | text/plain + +enctype | application/x-www-form-urlencoded diff --git a/Tests/LibWeb/Text/input/HTML/form-element-enctype.html b/Tests/LibWeb/Text/input/HTML/form-element-enctype.html new file mode 100644 index 00000000000..4c9ad01df27 --- /dev/null +++ b/Tests/LibWeb/Text/input/HTML/form-element-enctype.html @@ -0,0 +1,18 @@ +
+ + diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl index baef3669f7a..84667f30fe1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl @@ -1,6 +1,14 @@ #import #import +// https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#attr-fs-enctype +[MissingValueDefault=application/x-www-form-urlencoded, InvalidValueDefault=application/x-www-form-urlencoded] +enum EnctypeAttribute { + "application/x-www-form-urlencoded", + "multipart/form-data", + "text/plain" +}; + // https://html.spec.whatwg.org/multipage/semantics.html#htmlformelement [Exposed=Window, LegacyOverrideBuiltIns, LegacyUnenumerableNamedProperties] interface HTMLFormElement : HTMLElement { @@ -10,7 +18,7 @@ interface HTMLFormElement : HTMLElement { [CEReactions, Reflect=accept-charset] attribute DOMString acceptCharset; [CEReactions] attribute USVString action; [FIXME, CEReactions] attribute DOMString autocomplete; - [FIXME, CEReactions] attribute DOMString enctype; + [CEReactions, Enumerated=EnctypeAttribute, Reflect] attribute DOMString enctype; [FIXME, CEReactions] attribute DOMString encoding; [CEReactions] attribute DOMString method; [CEReactions, Reflect] attribute DOMString name;