Pārlūkot izejas kodu

LibWeb: Implement `HTMLElement.inputMode`

This reflects the value of the `inputmode` content attribute
Tim Ledbetter 7 mēneši atpakaļ
vecāks
revīzija
12fc1de9ca

+ 1 - 0
Libraries/LibWeb/HTML/AttributeNames.h

@@ -100,6 +100,7 @@ namespace AttributeNames {
     __ENUMERATE_HTML_ATTRIBUTE(is)                         \
     __ENUMERATE_HTML_ATTRIBUTE(is)                         \
     __ENUMERATE_HTML_ATTRIBUTE(iscontenteditable)          \
     __ENUMERATE_HTML_ATTRIBUTE(iscontenteditable)          \
     __ENUMERATE_HTML_ATTRIBUTE(ismap)                      \
     __ENUMERATE_HTML_ATTRIBUTE(ismap)                      \
+    __ENUMERATE_HTML_ATTRIBUTE(inputmode)                  \
     __ENUMERATE_HTML_ATTRIBUTE(itemscope)                  \
     __ENUMERATE_HTML_ATTRIBUTE(itemscope)                  \
     __ENUMERATE_HTML_ATTRIBUTE(kind)                       \
     __ENUMERATE_HTML_ATTRIBUTE(kind)                       \
     __ENUMERATE_HTML_ATTRIBUTE(label)                      \
     __ENUMERATE_HTML_ATTRIBUTE(label)                      \

+ 13 - 1
Libraries/LibWeb/HTML/HTMLElement.idl

@@ -52,12 +52,24 @@ HTMLElement includes GlobalEventHandlers;
 HTMLElement includes ElementContentEditable;
 HTMLElement includes ElementContentEditable;
 HTMLElement includes HTMLOrSVGElement;
 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
 // https://html.spec.whatwg.org/#elementcontenteditable
 interface mixin ElementContentEditable {
 interface mixin ElementContentEditable {
     [CEReactions] attribute DOMString contentEditable;
     [CEReactions] attribute DOMString contentEditable;
     [FIXME, CEReactions] attribute DOMString enterKeyHint;
     [FIXME, CEReactions] attribute DOMString enterKeyHint;
     readonly attribute boolean isContentEditable;
     readonly attribute boolean isContentEditable;
-    [FIXME, CEReactions] attribute DOMString inputMode;
+    [Reflect=inputmode, Enumerated=InputMode, CEReactions] attribute DOMString inputMode;
 };
 };
 
 
 HTMLElement includes ElementCSSInlineStyle;
 HTMLElement includes ElementCSSInlineStyle;