Commit a80be2ec authored by Joanmarie Diggs's avatar Joanmarie Diggs Committed by Commit Bot

Implement support for the new ARIA "generic" role

As part of reaching role parity with HTML, an equivalent role was needed
for container elements which do not have any semantic meaning (similar
to div and span).

Mapping the "generic" role to ax::mojom::Role::kGenericContainer will
cause this role to be exposed via platform accessibility APIs like a
div.

Bug: 1016782
Change-Id: If5e96f64dcb1ccb8c360a20aff54c1b71b68c2af
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872305
Commit-Queue: Joanmarie Diggs <jdiggs@igalia.com>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708626}
parent 958d3158
......@@ -627,6 +627,10 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaForm) {
RunAriaTest(FILE_PATH_LITERAL("aria-form.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaGeneric) {
RunAriaTest(FILE_PATH_LITERAL("aria-generic.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaGrabbed) {
RunAriaTest(FILE_PATH_LITERAL("aria-grabbed.html"));
}
......
android.webkit.WebView focusable focused scrollable
++android.view.View name='content'
[document web]
++[section]
++++[text] name='content'
rootWebArea
++genericContainer ignored
++++genericContainer
++++++staticText name='content'
++++++++inlineTextBox name='content'
AXWebArea
++AXGroup
++++AXStaticText AXValue='content'
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_SECTION
++++ROLE_SYSTEM_STATICTEXT name='content'
<!DOCTYPE html>
<html>
<body>
<fieldset role="generic">content</fieldset>
</body>
</html>
......@@ -159,6 +159,7 @@ const RoleEntry kRoles[] = {
{"feed", ax::mojom::Role::kFeed},
{"figure", ax::mojom::Role::kFigure},
{"form", ax::mojom::Role::kForm},
{"generic", ax::mojom::Role::kGenericContainer},
// -------------------------------------------------
// ARIA Graphics module roles:
// https://rawgit.com/w3c/graphics-aam/master/
......
Tests accessibility values of display locked nodes
WebArea
GenericContainer
GenericContainer
generic
generic
text "locked"
GenericContainer
generic
text "child"
GenericContainer
generic
text "grandChild"
text
text
GenericContainer
generic
text "invisible"
text
GenericContainer
generic
text "nested"
text "text"
GenericContainer
GenericContainer
generic
generic
text "normal text"
InlineTextBox
Tests Accessibility.getFullAXTree
WebArea
GenericContainer
GenericContainer
generic
generic
text "Some text in a div, also a"
InlineTextBox
link "link"
......
......@@ -166,14 +166,14 @@ WebArea
}
WebArea
*GenericContainer
*generic
text "Div in list isn't presentational"
{
"nodeId": "<string>",
"ignored": false,
"role": {
"type": "internalRole",
"value": "GenericContainer"
"type": "role",
"value": "generic"
},
"name": {
"type": "computedString",
......@@ -508,14 +508,14 @@ WebArea
}
WebArea
*GenericContainer "span with ARIA label"
*generic "span with ARIA label"
text "should not be ignored"
{
"nodeId": "<string>",
"ignored": false,
"role": {
"type": "internalRole",
"value": "GenericContainer"
"type": "role",
"value": "generic"
},
"name": {
"type": "computedString",
......@@ -570,14 +570,14 @@ WebArea
}
WebArea
*GenericContainer
*generic
text "summary element without details parent is ignored"
{
"nodeId": "<string>",
"ignored": false,
"role": {
"type": "internalRole",
"value": "GenericContainer"
"type": "role",
"value": "generic"
},
"name": {
"type": "computedString",
......
......@@ -61,8 +61,8 @@ Tests accessibility values of ignored nodes in model dialog.
"nodeId": "<string>",
"ignored": false,
"role": {
"type": "internalRole",
"value": "GenericContainer"
"type": "role",
"value": "generic"
},
"name": {
"type": "computedString",
......
......@@ -3,8 +3,8 @@ Tests name sources when used with aria-labelledby.
"nodeId": "<string>",
"ignored": false,
"role": {
"type": "internalRole",
"value": "GenericContainer"
"type": "role",
"value": "generic"
},
"name": {
"type": "computedString",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment