From 12fc1de9ca2d81250bfd97b81fa907c802569498 Mon Sep 17 00:00:00 2001 From: Tim Ledbetter Date: Tue, 26 Nov 2024 14:34:25 +0000 Subject: [PATCH] LibWeb: Implement `HTMLElement.inputMode` This reflects the value of the `inputmode` content attribute --- Libraries/LibWeb/HTML/AttributeNames.h | 1 + Libraries/LibWeb/HTML/HTMLElement.idl | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/HTML/AttributeNames.h b/Libraries/LibWeb/HTML/AttributeNames.h index 0b74b3498f5..9db2b197f3f 100644 --- a/Libraries/LibWeb/HTML/AttributeNames.h +++ b/Libraries/LibWeb/HTML/AttributeNames.h @@ -100,6 +100,7 @@ namespace AttributeNames { __ENUMERATE_HTML_ATTRIBUTE(is) \ __ENUMERATE_HTML_ATTRIBUTE(iscontenteditable) \ __ENUMERATE_HTML_ATTRIBUTE(ismap) \ + __ENUMERATE_HTML_ATTRIBUTE(inputmode) \ __ENUMERATE_HTML_ATTRIBUTE(itemscope) \ __ENUMERATE_HTML_ATTRIBUTE(kind) \ __ENUMERATE_HTML_ATTRIBUTE(label) \ diff --git a/Libraries/LibWeb/HTML/HTMLElement.idl b/Libraries/LibWeb/HTML/HTMLElement.idl index d3805b9d52b..4d0b8140fbd 100644 --- a/Libraries/LibWeb/HTML/HTMLElement.idl +++ b/Libraries/LibWeb/HTML/HTMLElement.idl @@ -52,12 +52,24 @@ HTMLElement includes GlobalEventHandlers; HTMLElement includes ElementContentEditable; HTMLElement includes HTMLOrSVGElement; +// https://html.spec.whatwg.org/#attr-inputmode +enum InputMode { + "none", + "text", + "tel", + "url", + "email", + "numeric", + "decimal", + "search" +}; + // https://html.spec.whatwg.org/#elementcontenteditable interface mixin ElementContentEditable { [CEReactions] attribute DOMString contentEditable; [FIXME, CEReactions] attribute DOMString enterKeyHint; readonly attribute boolean isContentEditable; - [FIXME, CEReactions] attribute DOMString inputMode; + [Reflect=inputmode, Enumerated=InputMode, CEReactions] attribute DOMString inputMode; }; HTMLElement includes ElementCSSInlineStyle;