From 517b1a26905667a1dca5ddb61958e0197f9b158a Mon Sep 17 00:00:00 2001 From: Bastiaan van der Plaat Date: Tue, 13 Aug 2024 15:38:35 +0200 Subject: [PATCH] LibWeb: Add autocomplete property --- Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl | 9 ++++++++- Userland/Libraries/LibWeb/HTML/HTMLInputElement.idl | 2 +- Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl | 2 +- Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.idl | 2 +- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl index 605d6f63b83..488fa992512 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLFormElement.idl @@ -1,6 +1,13 @@ #import #import +// https://html.spec.whatwg.org/multipage/forms.html#attr-form-autocomplete +[MissingValueDefault=on, InvalidValueDefault=on] +enum Autocomplete { + "on", + "off" +}; + // 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 { @@ -17,7 +24,7 @@ interface HTMLFormElement : HTMLElement { [CEReactions, Reflect=accept-charset] attribute DOMString acceptCharset; [CEReactions] attribute USVString action; - [FIXME, CEReactions] attribute DOMString autocomplete; + [CEReactions, Enumerated=Autocomplete, Reflect] attribute DOMString autocomplete; [CEReactions, Enumerated=EnctypeAttribute, Reflect] attribute DOMString enctype; [CEReactions, Enumerated=EnctypeAttribute, Reflect=enctype] attribute DOMString encoding; [CEReactions] attribute DOMString method; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.idl index 9ff4c9e5660..bf24aed35b2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.idl @@ -10,7 +10,7 @@ interface HTMLInputElement : HTMLElement { [CEReactions, Reflect] attribute DOMString accept; [CEReactions, Reflect] attribute DOMString alt; - [FIXME, CEReactions] attribute DOMString autocomplete; + [CEReactions, Enumerated=Autocomplete, Reflect] attribute DOMString autocomplete; [CEReactions, Reflect=checked] attribute boolean defaultChecked; [ImplementedAs=checked_binding] attribute boolean checked; [CEReactions, Reflect=dirname] attribute DOMString dirName; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl index 20ec7a0363e..854ba004fdb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.idl @@ -7,7 +7,7 @@ interface HTMLSelectElement : HTMLElement { [HTMLConstructor] constructor(); - [CEReactions, Reflect] attribute DOMString autocomplete; + [CEReactions, Enumerated=Autocomplete, Reflect] attribute DOMString autocomplete; [CEReactions, Reflect] attribute boolean disabled; readonly attribute HTMLFormElement? form; [CEReactions, Reflect] attribute boolean multiple; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.idl index f67ce25acc5..6371de62c21 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.idl +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.idl @@ -6,7 +6,7 @@ interface HTMLTextAreaElement : HTMLElement { [HTMLConstructor] constructor(); - [CEReactions, Reflect] attribute DOMString autocomplete; + [CEReactions, Enumerated=Autocomplete, Reflect] attribute DOMString autocomplete; [CEReactions] attribute unsigned long cols; [CEReactions, Reflect=dirname] attribute DOMString dirName; [CEReactions, Reflect] attribute boolean disabled;