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) { ...@@ -627,6 +627,10 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaForm) {
RunAriaTest(FILE_PATH_LITERAL("aria-form.html")); 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) { IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaGrabbed) {
RunAriaTest(FILE_PATH_LITERAL("aria-grabbed.html")); 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[] = { ...@@ -159,6 +159,7 @@ const RoleEntry kRoles[] = {
{"feed", ax::mojom::Role::kFeed}, {"feed", ax::mojom::Role::kFeed},
{"figure", ax::mojom::Role::kFigure}, {"figure", ax::mojom::Role::kFigure},
{"form", ax::mojom::Role::kForm}, {"form", ax::mojom::Role::kForm},
{"generic", ax::mojom::Role::kGenericContainer},
// ------------------------------------------------- // -------------------------------------------------
// ARIA Graphics module roles: // ARIA Graphics module roles:
// https://rawgit.com/w3c/graphics-aam/master/ // https://rawgit.com/w3c/graphics-aam/master/
......
Tests accessibility values of display locked nodes Tests accessibility values of display locked nodes
WebArea WebArea
GenericContainer generic
GenericContainer generic
text "locked" text "locked"
GenericContainer generic
text "child" text "child"
GenericContainer generic
text "grandChild" text "grandChild"
text text
text text
GenericContainer generic
text "invisible" text "invisible"
text text
GenericContainer generic
text "nested" text "nested"
text "text" text "text"
GenericContainer generic
GenericContainer generic
text "normal text" text "normal text"
InlineTextBox InlineTextBox
Tests Accessibility.getFullAXTree Tests Accessibility.getFullAXTree
WebArea WebArea
GenericContainer generic
GenericContainer generic
text "Some text in a div, also a" text "Some text in a div, also a"
InlineTextBox InlineTextBox
link "link" link "link"
......
...@@ -166,14 +166,14 @@ WebArea ...@@ -166,14 +166,14 @@ WebArea
} }
WebArea WebArea
*GenericContainer *generic
text "Div in list isn't presentational" text "Div in list isn't presentational"
{ {
"nodeId": "<string>", "nodeId": "<string>",
"ignored": false, "ignored": false,
"role": { "role": {
"type": "internalRole", "type": "role",
"value": "GenericContainer" "value": "generic"
}, },
"name": { "name": {
"type": "computedString", "type": "computedString",
...@@ -508,14 +508,14 @@ WebArea ...@@ -508,14 +508,14 @@ WebArea
} }
WebArea WebArea
*GenericContainer "span with ARIA label" *generic "span with ARIA label"
text "should not be ignored" text "should not be ignored"
{ {
"nodeId": "<string>", "nodeId": "<string>",
"ignored": false, "ignored": false,
"role": { "role": {
"type": "internalRole", "type": "role",
"value": "GenericContainer" "value": "generic"
}, },
"name": { "name": {
"type": "computedString", "type": "computedString",
...@@ -570,14 +570,14 @@ WebArea ...@@ -570,14 +570,14 @@ WebArea
} }
WebArea WebArea
*GenericContainer *generic
text "summary element without details parent is ignored" text "summary element without details parent is ignored"
{ {
"nodeId": "<string>", "nodeId": "<string>",
"ignored": false, "ignored": false,
"role": { "role": {
"type": "internalRole", "type": "role",
"value": "GenericContainer" "value": "generic"
}, },
"name": { "name": {
"type": "computedString", "type": "computedString",
......
...@@ -61,8 +61,8 @@ Tests accessibility values of ignored nodes in model dialog. ...@@ -61,8 +61,8 @@ Tests accessibility values of ignored nodes in model dialog.
"nodeId": "<string>", "nodeId": "<string>",
"ignored": false, "ignored": false,
"role": { "role": {
"type": "internalRole", "type": "role",
"value": "GenericContainer" "value": "generic"
}, },
"name": { "name": {
"type": "computedString", "type": "computedString",
......
...@@ -3,8 +3,8 @@ Tests name sources when used with aria-labelledby. ...@@ -3,8 +3,8 @@ Tests name sources when used with aria-labelledby.
"nodeId": "<string>", "nodeId": "<string>",
"ignored": false, "ignored": false,
"role": { "role": {
"type": "internalRole", "type": "role",
"value": "GenericContainer" "value": "generic"
}, },
"name": { "name": {
"type": "computedString", "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