LibWeb: Implement HTMLElement.enterKeyHint

This reflects the value of the `enterkeyhint` content attribute
This commit is contained in:
Tim Ledbetter 2024-11-26 14:39:53 +00:00 committed by Andreas Kling
parent 12fc1de9ca
commit d73f809af5
Notes: github-actions[bot] 2024-11-26 18:08:54 +00:00
2 changed files with 13 additions and 1 deletions

View file

@ -71,6 +71,7 @@ namespace AttributeNames {
__ENUMERATE_HTML_ATTRIBUTE(download) \
__ENUMERATE_HTML_ATTRIBUTE(enctype) \
__ENUMERATE_HTML_ATTRIBUTE(ended) \
__ENUMERATE_HTML_ATTRIBUTE(enterkeyhint) \
__ENUMERATE_HTML_ATTRIBUTE(event) \
__ENUMERATE_HTML_ATTRIBUTE(face) \
__ENUMERATE_HTML_ATTRIBUTE(fetchpriority) \

View file

@ -52,6 +52,17 @@ HTMLElement includes GlobalEventHandlers;
HTMLElement includes ElementContentEditable;
HTMLElement includes HTMLOrSVGElement;
// https://html.spec.whatwg.org/multipage/interaction.html#attr-enterkeyhint
enum EnterKeyHint {
"enter",
"done",
"go",
"next",
"previous",
"search",
"send"
};
// https://html.spec.whatwg.org/#attr-inputmode
enum InputMode {
"none",
@ -67,7 +78,7 @@ enum InputMode {
// https://html.spec.whatwg.org/#elementcontenteditable
interface mixin ElementContentEditable {
[CEReactions] attribute DOMString contentEditable;
[FIXME, CEReactions] attribute DOMString enterKeyHint;
[Reflect=enterkeyhint, Enumerated=EnterKeyHint, CEReactions] attribute DOMString enterKeyHint;
readonly attribute boolean isContentEditable;
[Reflect=inputmode, Enumerated=InputMode, CEReactions] attribute DOMString inputMode;
};