LibWeb: Add support for the “suggestion” ARIA role

This commit is contained in:
sideshowbarker 2024-12-09 11:41:14 +09:00 committed by Sam Atkins
commit 96540e9f89
Notes: github-actions[bot] 2024-12-12 08:54:20 +00:00
5 changed files with 48 additions and 3 deletions

View file

@ -2046,6 +2046,48 @@
"childrenArePresentational": false, "childrenArePresentational": false,
"implicitValueForRole": {} "implicitValueForRole": {}
}, },
"Suggestion": {
"specLink": "https://w3c.github.io/aria/#suggestion",
"description": "A single proposed change to content.",
"superClassRoles": [
"Section"
],
"supportedStates": [
"aria-busy",
"aria-current",
"aria-errormessage",
"aria-grabbed",
"aria-haspopup",
"aria-hidden",
"aria-invalid"
],
"supportedProperties": [
"aria-atomic",
"aria-brailleroledescription",
"aria-controls",
"aria-describedby",
"aria-description",
"aria-details",
"aria-dropeffect",
"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": {}
},
"Superscript": { "Superscript": {
"specLink": "https://www.w3.org/TR/wai-aria-1.2/#superscript", "specLink": "https://www.w3.org/TR/wai-aria-1.2/#superscript",
"description": "One or more superscripted characters. See related superscript.", "description": "One or more superscripted characters. See related superscript.",

View file

@ -293,6 +293,8 @@ ErrorOr<NonnullOwnPtr<RoleType>> RoleType::build_role_object(Role role, bool foc
return adopt_nonnull_own_or_enomem(new (nothrow) Strong(data)); return adopt_nonnull_own_or_enomem(new (nothrow) Strong(data));
case Role::subscript: case Role::subscript:
return adopt_nonnull_own_or_enomem(new (nothrow) Subscript(data)); return adopt_nonnull_own_or_enomem(new (nothrow) Subscript(data));
case Role::suggestion:
return adopt_nonnull_own_or_enomem(new (nothrow) Suggestion(data));
case Role::superscript: case Role::superscript:
return adopt_nonnull_own_or_enomem(new (nothrow) Superscript(data)); return adopt_nonnull_own_or_enomem(new (nothrow) Superscript(data));
case Role::switch_: case Role::switch_:

View file

@ -131,6 +131,7 @@ bool is_document_structure_role(Role role)
Role::separator, // TODO: Only when not focusable Role::separator, // TODO: Only when not focusable
Role::strong, Role::strong,
Role::subscript, Role::subscript,
Role::suggestion,
Role::superscript, Role::superscript,
Role::table, Role::table,
Role::term, Role::term,

View file

@ -89,6 +89,7 @@ namespace Web::ARIA {
__ENUMERATE_ARIA_ROLE(strong) \ __ENUMERATE_ARIA_ROLE(strong) \
__ENUMERATE_ARIA_ROLE(structure) \ __ENUMERATE_ARIA_ROLE(structure) \
__ENUMERATE_ARIA_ROLE(subscript) \ __ENUMERATE_ARIA_ROLE(subscript) \
__ENUMERATE_ARIA_ROLE(suggestion) \
__ENUMERATE_ARIA_ROLE(superscript) \ __ENUMERATE_ARIA_ROLE(superscript) \
__ENUMERATE_ARIA_ROLE(switch_) \ __ENUMERATE_ARIA_ROLE(switch_) \
__ENUMERATE_ARIA_ROLE(tab) \ __ENUMERATE_ARIA_ROLE(tab) \

View file

@ -2,8 +2,7 @@ Harness status: OK
Found 54 tests Found 54 tests
53 Pass 54 Pass
1 Fail
Pass role: alert Pass role: alert
Pass role: alertdialog Pass role: alertdialog
Pass role: application Pass role: application
@ -49,7 +48,7 @@ Pass role: spinbutton
Pass role: status Pass role: status
Pass role: strong Pass role: strong
Pass role: subscript Pass role: subscript
Fail role: suggestion Pass role: suggestion
Pass role: superscript Pass role: superscript
Pass role: switch Pass role: switch
Pass role: term Pass role: term