LibWeb: Add support for the “mark” ARIA role

This commit is contained in:
sideshowbarker 2024-12-08 15:53:19 +09:00 committed by Tim Flynn
parent 96540e9f89
commit 6e24f23aa0
Notes: github-actions[bot] 2024-12-12 13:15:00 +00:00
4 changed files with 48 additions and 0 deletions

View file

@ -3307,6 +3307,48 @@
"childrenArePresentational": false,
"implicitValueForRole": {}
},
"Mark": {
"specLink": "https://w3c.github.io/aria/#mark",
"description": "Content which is marked or highlighted for reference or notation purposes, due to the content's relevance in the enclosing context.",
"superClassRoles": [
"Section"
],
"supportedStates": [
"aria-busy",
"aria-current",
"aria-disabled",
"aria-grabbed",
"aria-hidden",
"aria-invalid"
],
"supportedProperties": [
"aria-atomic",
"aria-brailleroledescription",
"aria-controls",
"aria-describedby",
"aria-description",
"aria-details",
"aria-dropeffect",
"aria-errormessage",
"aria-flowto",
"aria-haspopup",
"aria-keyshortcuts",
"aria-live",
"aria-owns",
"aria-relevant",
"aria-roledescription"
],
"requiredStates": [],
"requiredProperties": [],
"prohibitedStates": [],
"prohibitedProperties": [],
"requiredContextRoles": [],
"requiredOwnedElements": [],
"nameFromSource": "Prohibited",
"accessibleNameRequired": false,
"childrenArePresentational": false,
"implicitValueForRole": {}
},
"Navigation": {
"specLink": "https://www.w3.org/TR/wai-aria-1.2/#navigation",
"description": "A landmark containing a collection of navigational elements (usually links) for navigating the document or related documents.",

View file

@ -232,6 +232,8 @@ ErrorOr<NonnullOwnPtr<RoleType>> RoleType::build_role_object(Role role, bool foc
return adopt_nonnull_own_or_enomem(new (nothrow) Main(data));
case Role::marquee:
return adopt_nonnull_own_or_enomem(new (nothrow) Marquee(data));
case Role::mark:
return adopt_nonnull_own_or_enomem(new (nothrow) Mark(data));
case Role::math:
return adopt_nonnull_own_or_enomem(new (nothrow) Math(data));
case Role::meter:

View file

@ -53,6 +53,7 @@ namespace Web::ARIA {
__ENUMERATE_ARIA_ROLE(listitem) \
__ENUMERATE_ARIA_ROLE(log) \
__ENUMERATE_ARIA_ROLE(main) \
__ENUMERATE_ARIA_ROLE(mark) \
__ENUMERATE_ARIA_ROLE(marquee) \
__ENUMERATE_ARIA_ROLE(math) \
__ENUMERATE_ARIA_ROLE(meter) \

View file

@ -776,6 +776,9 @@ Optional<ARIA::Role> HTMLElement::default_role() const
// https://www.w3.org/TR/html-aria/#el-main
if (local_name() == TagNames::main)
return ARIA::Role::main;
// https://www.w3.org/TR/html-aria/#el-mark
if (local_name() == TagNames::mark)
return ARIA::Role::mark;
// https://www.w3.org/TR/html-aria/#el-nav
if (local_name() == TagNames::nav)
return ARIA::Role::navigation;