0

Implement support for ARIA code, strong, emphasis, and time roles

* Create ax::mojom::Role::kCode, kEmphasis, and kStrong
* Map to accessibility APIs as defined in Core-AAM specification

Because it is up to content authors and toolkits/frameworks to
style these roles as they see fit, font and format information
will be exposed based on authoring. We cannot assume (and thus
should not automatically expose) bold for the strong role or
italics for the emphasis role.

Bug: 1017195
Change-Id: I4fa6d300de27b01abd6c72742c4cf1ac90f63c01
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875520
Reviewed-by: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: Kevin Babbitt <kbabbitt@microsoft.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Joanmarie Diggs <jdiggs@igalia.com>
Cr-Commit-Position: refs/heads/master@{#709986}
This commit is contained in:
Joanmarie Diggs
2019-10-28 18:52:25 +00:00
committed by Commit Bot
parent 5f1ca217c8
commit 954e4b971a
45 changed files with 385 additions and 6 deletions

@ -1884,6 +1884,9 @@ base::string16 BrowserAccessibility::GetLocalizedStringForRoleDescription()
case ax::mojom::Role::kAudio:
return content_client->GetLocalizedString(IDS_AX_ROLE_AUDIO);
case ax::mojom::Role::kCode:
return content_client->GetLocalizedString(IDS_AX_ROLE_CODE);
case ax::mojom::Role::kColorWell:
return content_client->GetLocalizedString(IDS_AX_ROLE_COLOR_WELL);
@ -1910,6 +1913,9 @@ base::string16 BrowserAccessibility::GetLocalizedStringForRoleDescription()
case ax::mojom::Role::kDetails:
return content_client->GetLocalizedString(IDS_AX_ROLE_DETAILS);
case ax::mojom::Role::kEmphasis:
return content_client->GetLocalizedString(IDS_AX_ROLE_EMPHASIS);
case ax::mojom::Role::kFigure:
return content_client->GetLocalizedString(IDS_AX_ROLE_FIGURE);
@ -1940,6 +1946,9 @@ base::string16 BrowserAccessibility::GetLocalizedStringForRoleDescription()
case ax::mojom::Role::kStatus:
return content_client->GetLocalizedString(IDS_AX_ROLE_OUTPUT);
case ax::mojom::Role::kStrong:
return content_client->GetLocalizedString(IDS_AX_ROLE_STRONG);
case ax::mojom::Role::kTextField: {
std::string input_type;
if (data.GetStringAttribute(ax::mojom::StringAttribute::kInputType,

@ -666,6 +666,9 @@ base::string16 BrowserAccessibilityAndroid::GetRoleDescription() const {
case ax::mojom::Role::kClient:
// No role description.
break;
case ax::mojom::Role::kCode:
// No role description.
break;
case ax::mojom::Role::kColorWell:
message_id = IDS_AX_ROLE_COLOR_WELL;
break;
@ -849,6 +852,9 @@ base::string16 BrowserAccessibilityAndroid::GetRoleDescription() const {
case ax::mojom::Role::kEmbeddedObject:
message_id = IDS_AX_ROLE_EMBEDDED_OBJECT;
break;
case ax::mojom::Role::kEmphasis:
// No role description.
break;
case ax::mojom::Role::kFeed:
message_id = IDS_AX_ROLE_FEED;
break;
@ -1083,6 +1089,9 @@ base::string16 BrowserAccessibilityAndroid::GetRoleDescription() const {
case ax::mojom::Role::kStatus:
message_id = IDS_AX_ROLE_STATUS;
break;
case ax::mojom::Role::kStrong:
// No role description.
break;
case ax::mojom::Role::kSwitch:
message_id = IDS_AX_ROLE_SWITCH;
break;

@ -459,6 +459,10 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaChecked) {
RunAriaTest(FILE_PATH_LITERAL("aria-checked.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaCode) {
RunAriaTest(FILE_PATH_LITERAL("aria-code.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaColAttr) {
RunAriaTest(FILE_PATH_LITERAL("aria-col-attr.html"));
}
@ -550,6 +554,9 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaDropEffect) {
RunAriaTest(FILE_PATH_LITERAL("aria-dropeffect.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaEmphasis) {
RunAriaTest(FILE_PATH_LITERAL("aria-emphasis.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaEditable) {
RunAriaTest(FILE_PATH_LITERAL("aria-editable.html"));
}
@ -971,6 +978,10 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaStatus) {
RunAriaTest(FILE_PATH_LITERAL("aria-status.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaStrong) {
RunAriaTest(FILE_PATH_LITERAL("aria-strong.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaSwitch) {
RunAriaTest(FILE_PATH_LITERAL("aria-switch.html"));
}
@ -1009,6 +1020,10 @@ IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest,
RunAriaTest(FILE_PATH_LITERAL("aria-textbox-with-selection.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaTime) {
RunAriaTest(FILE_PATH_LITERAL("aria-time.html"));
}
IN_PROC_BROWSER_TEST_P(DumpAccessibilityTreeTest, AccessibilityAriaTimer) {
RunAriaTest(FILE_PATH_LITERAL("aria-timer.html"));
}

@ -65,6 +65,8 @@ std::string RoleToString(ax::mojom::Role role) {
return result.append("Caption");
case ax::mojom::Role::kCell:
return result.append("Cell");
case ax::mojom::Role::kCode:
return result.append("Code");
case ax::mojom::Role::kCheckBox:
return result.append("CheckBox");
case ax::mojom::Role::kColorWell:
@ -187,6 +189,8 @@ std::string RoleToString(ax::mojom::Role role) {
return result.append("Document");
case ax::mojom::Role::kEmbeddedObject:
return result.append("EmbeddedObject");
case ax::mojom::Role::kEmphasis:
return result.append("Emphasis");
case ax::mojom::Role::kFigcaption:
return result.append("Figcaption");
case ax::mojom::Role::kFigure:
@ -331,6 +335,9 @@ std::string RoleToString(ax::mojom::Role role) {
return result.append("StaticText");
case ax::mojom::Role::kStatus:
return result.append("Status");
case ax::mojom::Role::kStrong:
return result.append("Strong");
;
case ax::mojom::Role::kSwitch:
return result.append("Switch");
case ax::mojom::Role::kTabList:

@ -0,0 +1,5 @@
android.webkit.WebView focusable focused scrollable
++android.view.View name='role'
++android.view.View name='element (no name)'
++android.view.View name=' '
++android.view.View name='include me'

@ -0,0 +1,7 @@
[document web]
++[static] xml-roles:code
++++[text] name='role'
++[text] name='element (no name)'
++[text] name=' '
++[static] name='include me'
++++[text] name='element (with name)'

@ -0,0 +1,12 @@
rootWebArea
++genericContainer ignored
++++code
++++++staticText name='role'
++++++++inlineTextBox name='role'
++++staticText name='element (no name)'
++++++inlineTextBox name='element (no name)'
++++staticText name=' '
++++++inlineTextBox name=' '
++++code name='include me'
++++++staticText name='element (with name)'
++++++++inlineTextBox name='element (with name)'

@ -0,0 +1,7 @@
AXWebArea AXRoleDescription='HTML content'
++AXGroup AXSubrole=AXCodeStyleGroup AXRoleDescription='code'
++++AXStaticText AXRoleDescription='text' AXValue='role'
++AXStaticText AXRoleDescription='text' AXValue='element (no name)'
++AXStaticText AXRoleDescription='text' AXValue=' '
++AXGroup AXSubrole=AXCodeStyleGroup AXRoleDescription='group' AXDescription='include me'
++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'

@ -0,0 +1,7 @@
document LocalizedControlType='document'
++code LocalizedControlType='code'
++++description LocalizedControlType='text' Name='role'
++description LocalizedControlType='text' Name='element (no name)'
++description LocalizedControlType='text' Name=' '
++code LocalizedControlType='code' Name='include me'
++++description LocalizedControlType='text' Name='element (with name)'

@ -0,0 +1,7 @@
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_TEXT_FRAME xml-roles:code
++++ROLE_SYSTEM_STATICTEXT name='role'
++ROLE_SYSTEM_STATICTEXT name='element (no name)'
++ROLE_SYSTEM_STATICTEXT name=' '
++IA2_ROLE_TEXT_FRAME name='include me'
++++ROLE_SYSTEM_STATICTEXT name='element (with name)'

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!--
@MAC-ALLOW:AXSubrole=*
@MAC-ALLOW:AXRoleDescription=*
@WIN-ALLOW:xml-roles:*
@AURALINUX-ALLOW:xml-roles:*
@UIA-WIN-ALLOW:LocalizedControlType=*
-->
<html>
<body>
<div role="code">role</div>
<code>element (no name)</code>
<code aria-label="include me">element (with name)</code>
</body>
</html>

@ -0,0 +1,5 @@
android.webkit.WebView focusable focused scrollable
++android.view.View name='role'
++android.view.View name='element (no name)'
++android.view.View name=' '
++android.view.View name='include me'

@ -0,0 +1,7 @@
[document web]
++[static] xml-roles:emphasis
++++[text] name='role'
++[text] name='element (no name)'
++[text] name=' '
++[static] name='include me'
++++[text] name='element (with name)'

@ -0,0 +1,12 @@
rootWebArea
++genericContainer ignored
++++emphasis
++++++staticText name='role'
++++++++inlineTextBox name='role'
++++staticText name='element (no name)'
++++++inlineTextBox name='element (no name)'
++++staticText name=' '
++++++inlineTextBox name=' '
++++emphasis name='include me'
++++++staticText name='element (with name)'
++++++++inlineTextBox name='element (with name)'

@ -0,0 +1,7 @@
AXWebArea AXRoleDescription='HTML content'
++AXGroup AXSubrole=AXEmphasisStyleGroup AXRoleDescription='emphasis'
++++AXStaticText AXRoleDescription='text' AXValue='role'
++AXStaticText AXRoleDescription='text' AXValue='element (no name)'
++AXStaticText AXRoleDescription='text' AXValue=' '
++AXGroup AXSubrole=AXEmphasisStyleGroup AXRoleDescription='group' AXDescription='include me'
++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'

@ -0,0 +1,7 @@
document LocalizedControlType='document'
++emphasis LocalizedControlType='emphasis'
++++description LocalizedControlType='text' Name='role'
++description LocalizedControlType='text' Name='element (no name)'
++description LocalizedControlType='text' Name=' '
++emphasis LocalizedControlType='emphasis' Name='include me'
++++description LocalizedControlType='text' Name='element (with name)'

@ -0,0 +1,7 @@
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_TEXT_FRAME xml-roles:emphasis
++++ROLE_SYSTEM_STATICTEXT name='role'
++ROLE_SYSTEM_STATICTEXT name='element (no name)'
++ROLE_SYSTEM_STATICTEXT name=' '
++IA2_ROLE_TEXT_FRAME name='include me'
++++ROLE_SYSTEM_STATICTEXT name='element (with name)'

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!--
@MAC-ALLOW:AXSubrole=*
@MAC-ALLOW:AXRoleDescription=*
@WIN-ALLOW:xml-roles:*
@AURALINUX-ALLOW:xml-roles:*
@UIA-WIN-ALLOW:LocalizedControlType=*
-->
<html>
<body>
<div role="emphasis">role</div>
<em>element (no name)</em>
<em aria-label="include me">element (with name)</em>
</body>
</html>

@ -19,7 +19,7 @@ rootWebArea
++++dialog
++++list
++++document
++++genericContainer
++++emphasis
++++feed
++++figure
++++form
@ -65,7 +65,7 @@ rootWebArea
++++slider
++++spinButton
++++status
++++genericContainer
++++strong
++++genericContainer
++++genericContainer
++++switch expanded
@ -75,7 +75,7 @@ rootWebArea
++++tabPanel
++++term
++++textField
++++genericContainer
++++time
++++timer
++++toolbar
++++tooltip

@ -0,0 +1,5 @@
android.webkit.WebView focusable focused scrollable
++android.view.View name='role'
++android.view.View name='element (no name)'
++android.view.View name=' '
++android.view.View name='include me'

@ -0,0 +1,7 @@
[document web]
++[static] xml-roles:strong
++++[text] name='role'
++[text] name='element (no name)'
++[text] name=' '
++[static] name='include me'
++++[text] name='element (with name)'

@ -0,0 +1,12 @@
rootWebArea
++genericContainer ignored
++++strong
++++++staticText name='role'
++++++++inlineTextBox name='role'
++++staticText name='element (no name)'
++++++inlineTextBox name='element (no name)'
++++staticText name=' '
++++++inlineTextBox name=' '
++++strong name='include me'
++++++staticText name='element (with name)'
++++++++inlineTextBox name='element (with name)'

@ -0,0 +1,7 @@
AXWebArea AXRoleDescription='HTML content'
++AXGroup AXSubrole=AXStrongStyleGroup AXRoleDescription='strong'
++++AXStaticText AXRoleDescription='text' AXValue='role'
++AXStaticText AXRoleDescription='text' AXValue='element (no name)'
++AXStaticText AXRoleDescription='text' AXValue=' '
++AXGroup AXSubrole=AXStrongStyleGroup AXRoleDescription='group' AXDescription='include me'
++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'

@ -0,0 +1,7 @@
document LocalizedControlType='document'
++strong LocalizedControlType='strong'
++++description LocalizedControlType='text' Name='role'
++description LocalizedControlType='text' Name='element (no name)'
++description LocalizedControlType='text' Name=' '
++strong LocalizedControlType='strong' Name='include me'
++++description LocalizedControlType='text' Name='element (with name)'

@ -0,0 +1,7 @@
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_TEXT_FRAME xml-roles:strong
++++ROLE_SYSTEM_STATICTEXT name='role'
++ROLE_SYSTEM_STATICTEXT name='element (no name)'
++ROLE_SYSTEM_STATICTEXT name=' '
++IA2_ROLE_TEXT_FRAME name='include me'
++++ROLE_SYSTEM_STATICTEXT name='element (with name)'

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!--
@MAC-ALLOW:AXSubrole=*
@MAC-ALLOW:AXRoleDescription=*
@WIN-ALLOW:xml-roles:*
@AURALINUX-ALLOW:xml-roles:*
@UIA-WIN-ALLOW:LocalizedControlType=*
-->
<html>
<body>
<div role="strong">role</div>
<strong>element (no name)</strong>
<strong aria-label="include me">element (with name)</strong>
</body>
</html>

@ -0,0 +1,5 @@
android.webkit.WebView focusable focused scrollable
++android.view.View role_description='time'
++android.view.View role_description='time'
++android.view.View name=' '
++android.view.View role_description='time' hint='include me'

@ -0,0 +1,8 @@
[document web]
++[static] xml-roles:time
++++[text] name='role'
++[static] xml-roles:time
++++[text] name='element (no name)'
++[text] name=' '
++[static] name='include me' xml-roles:time
++++[text] name='element (with name)'

@ -0,0 +1,13 @@
rootWebArea
++genericContainer ignored
++++time
++++++staticText name='role'
++++++++inlineTextBox name='role'
++++time
++++++staticText name='element (no name)'
++++++++inlineTextBox name='element (no name)'
++++staticText name=' '
++++++inlineTextBox name=' '
++++time name='include me'
++++++staticText name='element (with name)'
++++++++inlineTextBox name='element (with name)'

@ -0,0 +1,8 @@
AXWebArea AXRoleDescription='HTML content'
++AXGroup AXSubrole=AXTimeGroup AXRoleDescription='time'
++++AXStaticText AXRoleDescription='text' AXValue='role'
++AXGroup AXSubrole=AXTimeGroup AXRoleDescription='group'
++++AXStaticText AXRoleDescription='text' AXValue='element (no name)'
++AXStaticText AXRoleDescription='text' AXValue=' '
++AXGroup AXSubrole=AXTimeGroup AXRoleDescription='group' AXDescription='include me'
++++AXStaticText AXRoleDescription='text' AXValue='element (with name)'

@ -0,0 +1,8 @@
document LocalizedControlType='document'
++time LocalizedControlType='time'
++++description LocalizedControlType='text' Name='role'
++time LocalizedControlType='time'
++++description LocalizedControlType='text' Name='element (no name)'
++description LocalizedControlType='text' Name=' '
++time LocalizedControlType='time' Name='include me'
++++description LocalizedControlType='text' Name='element (with name)'

@ -0,0 +1,8 @@
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
++IA2_ROLE_TEXT_FRAME xml-roles:time
++++ROLE_SYSTEM_STATICTEXT name='role'
++IA2_ROLE_TEXT_FRAME xml-roles:time
++++ROLE_SYSTEM_STATICTEXT name='element (no name)'
++ROLE_SYSTEM_STATICTEXT name=' '
++IA2_ROLE_TEXT_FRAME name='include me' xml-roles:time
++++ROLE_SYSTEM_STATICTEXT name='element (with name)'

@ -0,0 +1,15 @@
<!DOCTYPE html>
<!--
@MAC-ALLOW:AXSubrole=*
@MAC-ALLOW:AXRoleDescription=*
@WIN-ALLOW:xml-roles:*
@AURALINUX-ALLOW:xml-roles:*
@UIA-WIN-ALLOW:LocalizedControlType=*
-->
<html>
<body>
<div role="time">role</div>
<time>element (no name)</time>
<time aria-label="include me">element (with name)</time>
</body>
</html>

@ -1,7 +1,7 @@
document
++group
++++description LocalizedControlType='time'
++++time LocalizedControlType='time'
++++++description Name='10:00'
++++description Name=' '
++++description LocalizedControlType='time'
++++time LocalizedControlType='time'
++++++description Name='Valentines day'

@ -98,6 +98,7 @@
cell,
checkBox,
client,
code,
colorWell,
column,
columnHeader,
@ -164,6 +165,7 @@
// --------------------------------------------------------------
document,
embeddedObject,
emphasis,
feed,
figcaption,
figure,
@ -247,6 +249,7 @@
splitter,
staticText,
status,
strong,
svgRoot,
switch,
tab,

@ -271,6 +271,9 @@ below:
<message name="IDS_AX_ROLE_BANNER" desc="Accessibility role description for banner">
banner
</message>
<message name="IDS_AX_ROLE_CODE" desc="Accessibility role description for a section whose content represents a fragment of computer code">
code
</message>
<!-- https://w3c.github.io/html-aam/#el-input-color -->
<message name="IDS_AX_ROLE_COLOR_WELL" desc="Accessibility role description for a color picker">
color picker
@ -429,6 +432,9 @@ below:
<message name="IDS_AX_ROLE_DOC_TOC" desc="Accessibility role description for table of contents">
table of contents
</message>
<message name="IDS_AX_ROLE_EMPHASIS" desc="Accessibility role description for one or more emphasized characters">
emphasis
</message>
<message name="IDS_AX_ROLE_FEED" desc="Accessibility role description for a scrollable list of articles.">
feed
</message>
@ -516,6 +522,9 @@ below:
<message name="IDS_AX_ROLE_STATUS" desc="Accessibility role description for status">
status
</message>
<message name="IDS_AX_ROLE_STRONG" desc="Accessibility role description for content which is important, serious, or urgent">
strong
</message>
<message name="IDS_AX_ROLE_SWITCH" desc="Accessibility role description for switch">
switch
</message>

@ -653,6 +653,15 @@ ax::mojom::Role AXNodeObject::NativeRoleIgnoringAria() const {
if (GetNode()->HasTagName(html_names::kArticleTag))
return ax::mojom::Role::kArticle;
if (GetNode()->HasTagName(html_names::kCodeTag))
return ax::mojom::Role::kCode;
if (GetNode()->HasTagName(html_names::kEmTag))
return ax::mojom::Role::kEmphasis;
if (GetNode()->HasTagName(html_names::kStrongTag))
return ax::mojom::Role::kStrong;
if (GetNode()->HasTagName(html_names::kDelTag))
return ax::mojom::Role::kContentDeletion;

@ -102,6 +102,7 @@ const RoleEntry kRoles[] = {
{"button", ax::mojom::Role::kButton},
{"caption", ax::mojom::Role::kCaption},
{"cell", ax::mojom::Role::kCell},
{"code", ax::mojom::Role::kCode},
{"checkbox", ax::mojom::Role::kCheckBox},
{"columnheader", ax::mojom::Role::kColumnHeader},
{"combobox", ax::mojom::Role::kComboBoxGrouping},
@ -156,6 +157,7 @@ const RoleEntry kRoles[] = {
// End DPub roles.
// -------------------------------------------------
{"document", ax::mojom::Role::kDocument},
{"emphasis", ax::mojom::Role::kEmphasis},
{"feed", ax::mojom::Role::kFeed},
{"figure", ax::mojom::Role::kFigure},
{"form", ax::mojom::Role::kForm},
@ -209,6 +211,7 @@ const RoleEntry kRoles[] = {
{"slider", ax::mojom::Role::kSlider},
{"spinbutton", ax::mojom::Role::kSpinButton},
{"status", ax::mojom::Role::kStatus},
{"strong", ax::mojom::Role::kStrong},
{"switch", ax::mojom::Role::kSwitch},
{"tab", ax::mojom::Role::kTab},
{"table", ax::mojom::Role::kTable},
@ -217,6 +220,7 @@ const RoleEntry kRoles[] = {
{"term", ax::mojom::Role::kTerm},
{"text", ax::mojom::Role::kStaticText},
{"textbox", ax::mojom::Role::kTextField},
{"time", ax::mojom::Role::kTime},
{"timer", ax::mojom::Role::kTimer},
{"toolbar", ax::mojom::Role::kToolbar},
{"tooltip", ax::mojom::Role::kTooltip},
@ -252,6 +256,7 @@ const InternalRoleEntry kInternalRoles[] = {
{ax::mojom::Role::kCell, "Cell"},
{ax::mojom::Role::kCheckBox, "CheckBox"},
{ax::mojom::Role::kClient, "Client"},
{ax::mojom::Role::kCode, "Code"},
{ax::mojom::Role::kColorWell, "ColorWell"},
{ax::mojom::Role::kColumnHeader, "ColumnHeader"},
{ax::mojom::Role::kColumn, "Column"},
@ -318,6 +323,7 @@ const InternalRoleEntry kInternalRoles[] = {
// --------------------------------------------------------------
{ax::mojom::Role::kDocument, "Document"},
{ax::mojom::Role::kEmbeddedObject, "EmbeddedObject"},
{ax::mojom::Role::kEmphasis, "Emphasis"},
{ax::mojom::Role::kFeed, "feed"},
{ax::mojom::Role::kFigcaption, "Figcaption"},
{ax::mojom::Role::kFigure, "Figure"},
@ -402,6 +408,7 @@ const InternalRoleEntry kInternalRoles[] = {
{ax::mojom::Role::kSplitter, "Splitter"},
{ax::mojom::Role::kStaticText, "StaticText"},
{ax::mojom::Role::kStatus, "Status"},
{ax::mojom::Role::kStrong, "Strong"},
{ax::mojom::Role::kSwitch, "Switch"},
{ax::mojom::Role::kTab, "Tab"},
{ax::mojom::Role::kTabList, "TabList"},
@ -3425,6 +3432,7 @@ bool AXObject::NameFromContents(bool recursive) const {
case ax::mojom::Role::kBanner:
case ax::mojom::Role::kBlockquote:
case ax::mojom::Role::kCaret:
case ax::mojom::Role::kCode:
case ax::mojom::Role::kClient:
case ax::mojom::Role::kColorWell:
case ax::mojom::Role::kColumn:
@ -3474,6 +3482,7 @@ bool AXObject::NameFromContents(bool recursive) const {
case ax::mojom::Role::kDocToc:
case ax::mojom::Role::kDocument:
case ax::mojom::Role::kEmbeddedObject:
case ax::mojom::Role::kEmphasis:
case ax::mojom::Role::kFeed:
case ax::mojom::Role::kFigure:
case ax::mojom::Role::kForm:
@ -3513,6 +3522,7 @@ bool AXObject::NameFromContents(bool recursive) const {
case ax::mojom::Role::kSpinButton:
case ax::mojom::Role::kStatus:
case ax::mojom::Role::kSliderThumb:
case ax::mojom::Role::kStrong:
case ax::mojom::Role::kSvgRoot:
case ax::mojom::Role::kTable:
case ax::mojom::Role::kTableHeaderContainer:

@ -107,6 +107,7 @@ chrome.automation.RoleType = {
CAPTION: 'caption',
CARET: 'caret',
CELL: 'cell',
CODE: 'code',
CHECK_BOX: 'checkBox',
CLIENT: 'client',
COLOR_WELL: 'colorWell',
@ -170,6 +171,7 @@ chrome.automation.RoleType = {
DOC_TOC: 'docToc',
DOCUMENT: 'document',
EMBEDDED_OBJECT: 'embeddedObject',
EMPHASIS: 'emphasis',
FEED: 'feed',
FIGCAPTION: 'figcaption',
FIGURE: 'figure',
@ -248,6 +250,7 @@ chrome.automation.RoleType = {
SPLITTER: 'splitter',
STATIC_TEXT: 'staticText',
STATUS: 'status',
STRONG: 'strong',
SVG_ROOT: 'svgRoot',
SWITCH: 'switch',
TAB: 'tab',

@ -309,6 +309,8 @@ const char* ToString(ax::mojom::Role role) {
return "checkBox";
case ax::mojom::Role::kClient:
return "client";
case ax::mojom::Role::kCode:
return "code";
case ax::mojom::Role::kColorWell:
return "colorWell";
case ax::mojom::Role::kColumnHeader:
@ -431,6 +433,8 @@ const char* ToString(ax::mojom::Role role) {
return "document";
case ax::mojom::Role::kEmbeddedObject:
return "embeddedObject";
case ax::mojom::Role::kEmphasis:
return "emphasis";
case ax::mojom::Role::kFeed:
return "feed";
case ax::mojom::Role::kFigcaption:
@ -567,6 +571,8 @@ const char* ToString(ax::mojom::Role role) {
return "rubyAnnotation";
case ax::mojom::Role::kSection:
return "section";
case ax::mojom::Role::kStrong:
return "strong";
case ax::mojom::Role::kSvgRoot:
return "svgRoot";
case ax::mojom::Role::kScrollBar:
@ -685,6 +691,8 @@ ax::mojom::Role ParseRole(const char* role) {
return ax::mojom::Role::kCheckBox;
if (0 == strcmp(role, "client"))
return ax::mojom::Role::kClient;
if (0 == strcmp(role, "code"))
return ax::mojom::Role::kCode;
if (0 == strcmp(role, "colorWell"))
return ax::mojom::Role::kColorWell;
if (0 == strcmp(role, "columnHeader"))
@ -807,6 +815,8 @@ ax::mojom::Role ParseRole(const char* role) {
return ax::mojom::Role::kDocument;
if (0 == strcmp(role, "embeddedObject"))
return ax::mojom::Role::kEmbeddedObject;
if (0 == strcmp(role, "emphasis"))
return ax::mojom::Role::kEmphasis;
if (0 == strcmp(role, "feed"))
return ax::mojom::Role::kFeed;
if (0 == strcmp(role, "figcaption"))
@ -967,6 +977,8 @@ ax::mojom::Role ParseRole(const char* role) {
return ax::mojom::Role::kStatus;
if (0 == strcmp(role, "switch"))
return ax::mojom::Role::kSwitch;
if (0 == strcmp(role, "strong"))
return ax::mojom::Role::kStrong;
if (0 == strcmp(role, "tabList"))
return ax::mojom::Role::kTabList;
if (0 == strcmp(role, "tabPanel"))

@ -126,6 +126,7 @@ enum Role {
kCell,
kCheckBox,
kClient,
kCode,
kColorWell,
kColumn,
kColumnHeader,
@ -192,6 +193,7 @@ enum Role {
// --------------------------------------------------------------
kDocument,
kEmbeddedObject,
kEmphasis,
kFeed,
kFigcaption,
kFigure,
@ -278,6 +280,7 @@ enum Role {
kSplitter,
kStaticText,
kStatus,
kStrong,
kSvgRoot,
kSwitch,
kTab,

@ -2646,6 +2646,9 @@ AtkRole AXPlatformNodeAuraLinux::GetAtkRole() const {
case ax::mojom::Role::kTextFieldWithComboBox:
return ATK_ROLE_COMBO_BOX;
case ax::mojom::Role::kAbbr:
case ax::mojom::Role::kCode:
case ax::mojom::Role::kEmphasis:
case ax::mojom::Role::kStrong:
case ax::mojom::Role::kTime:
return kStaticRole;
case ax::mojom::Role::kTimer:

@ -58,6 +58,7 @@ RoleMap BuildRoleMap() {
{ax::mojom::Role::kCaption, NSAccessibilityGroupRole},
{ax::mojom::Role::kCell, @"AXCell"},
{ax::mojom::Role::kCheckBox, NSAccessibilityCheckBoxRole},
{ax::mojom::Role::kCode, NSAccessibilityGroupRole},
{ax::mojom::Role::kColorWell, NSAccessibilityColorWellRole},
{ax::mojom::Role::kColumn, NSAccessibilityColumnRole},
{ax::mojom::Role::kColumnHeader, @"AXCell"},
@ -122,6 +123,7 @@ RoleMap BuildRoleMap() {
{ax::mojom::Role::kDocToc, NSAccessibilityGroupRole},
{ax::mojom::Role::kDocument, NSAccessibilityGroupRole},
{ax::mojom::Role::kEmbeddedObject, NSAccessibilityGroupRole},
{ax::mojom::Role::kEmphasis, NSAccessibilityGroupRole},
{ax::mojom::Role::kFigcaption, NSAccessibilityGroupRole},
{ax::mojom::Role::kFigure, NSAccessibilityGroupRole},
{ax::mojom::Role::kFooter, NSAccessibilityGroupRole},
@ -202,6 +204,7 @@ RoleMap BuildRoleMap() {
{ax::mojom::Role::kStatus, NSAccessibilityGroupRole},
{ax::mojom::Role::kSvgRoot, NSAccessibilityGroupRole},
{ax::mojom::Role::kSwitch, NSAccessibilityCheckBoxRole},
{ax::mojom::Role::kStrong, NSAccessibilityGroupRole},
{ax::mojom::Role::kTab, NSAccessibilityRadioButtonRole},
{ax::mojom::Role::kTable, NSAccessibilityTableRole},
{ax::mojom::Role::kTableHeaderContainer, NSAccessibilityGroupRole},
@ -238,6 +241,7 @@ RoleMap BuildSubroleMap() {
{ax::mojom::Role::kApplication, @"AXLandmarkApplication"},
{ax::mojom::Role::kArticle, @"AXDocumentArticle"},
{ax::mojom::Role::kBanner, @"AXLandmarkBanner"},
{ax::mojom::Role::kCode, @"AXCodeStyleGroup"},
{ax::mojom::Role::kComplementary, @"AXLandmarkComplementary"},
{ax::mojom::Role::kContentDeletion, @"AXDeleteStyleGroup"},
{ax::mojom::Role::kContentInsertion, @"AXInsertStyleGroup"},
@ -247,6 +251,7 @@ RoleMap BuildSubroleMap() {
{ax::mojom::Role::kDescriptionListTerm, @"AXTerm"},
{ax::mojom::Role::kDialog, @"AXApplicationDialog"},
{ax::mojom::Role::kDocument, @"AXDocument"},
{ax::mojom::Role::kEmphasis, @"AXEmphasisStyleGroup"},
{ax::mojom::Role::kFooter, @"AXLandmarkContentInfo"},
{ax::mojom::Role::kForm, @"AXLandmarkForm"},
{ax::mojom::Role::kGraphicsDocument, @"AXDocument"},
@ -262,9 +267,11 @@ RoleMap BuildSubroleMap() {
{ax::mojom::Role::kSearchBox, @"AXSearchField"},
{ax::mojom::Role::kSection, @"AXLandmarkRegion"},
{ax::mojom::Role::kStatus, @"AXApplicationStatus"},
{ax::mojom::Role::kStrong, @"AXStrongStyleGroup"},
{ax::mojom::Role::kSwitch, @"AXSwitch"},
{ax::mojom::Role::kTabPanel, @"AXTabPanel"},
{ax::mojom::Role::kTerm, @"AXTerm"},
{ax::mojom::Role::kTime, @"AXTimeGroup"},
{ax::mojom::Role::kTimer, @"AXApplicationTimer"},
{ax::mojom::Role::kToggleButton, @"AXToggleButton"},
{ax::mojom::Role::kTooltip, @"AXUserInterfaceTooltip"},

@ -4995,6 +4995,9 @@ int AXPlatformNodeWin::MSAARole() {
return ROLE_SYSTEM_COMBOBOX;
case ax::mojom::Role::kAbbr:
case ax::mojom::Role::kCode:
case ax::mojom::Role::kEmphasis:
case ax::mojom::Role::kStrong:
case ax::mojom::Role::kTime:
return ROLE_SYSTEM_TEXT;
@ -5356,6 +5359,9 @@ int32_t AXPlatformNodeWin::ComputeIA2Role() {
ia2_role = IA2_ROLE_TOGGLE_BUTTON;
break;
case ax::mojom::Role::kAbbr:
case ax::mojom::Role::kCode:
case ax::mojom::Role::kEmphasis:
case ax::mojom::Role::kStrong:
case ax::mojom::Role::kTime:
ia2_role = IA2_ROLE_TEXT_FRAME;
break;
@ -5430,6 +5436,9 @@ base::string16 AXPlatformNodeWin::UIAAriaRole() {
case ax::mojom::Role::kCell:
return L"gridcell";
case ax::mojom::Role::kCode:
return L"code";
case ax::mojom::Role::kCheckBox:
return L"checkbox";
@ -5552,6 +5561,9 @@ base::string16 AXPlatformNodeWin::UIAAriaRole() {
return L"document";
}
case ax::mojom::Role::kEmphasis:
return L"emphasis";
case ax::mojom::Role::kFeed:
return L"group";
@ -5761,6 +5773,9 @@ base::string16 AXPlatformNodeWin::UIAAriaRole() {
case ax::mojom::Role::kSpinButton:
return L"spinbutton";
case ax::mojom::Role::kStrong:
return L"strong";
case ax::mojom::Role::kSwitch:
return L"checkbox";
@ -5812,9 +5827,11 @@ base::string16 AXPlatformNodeWin::UIAAriaRole() {
return L"combobox";
case ax::mojom::Role::kAbbr:
case ax::mojom::Role::kTime:
return L"description";
case ax::mojom::Role::kTime:
return L"time";
case ax::mojom::Role::kTimer:
return L"timer";
@ -6089,6 +6106,9 @@ LONG AXPlatformNodeWin::ComputeUIAControlType() { // NOLINT(runtime/int)
case ax::mojom::Role::kClient:
return UIA_PaneControlTypeId;
case ax::mojom::Role::kCode:
return UIA_TextControlTypeId;
case ax::mojom::Role::kColorWell:
return UIA_ButtonControlTypeId;
@ -6205,6 +6225,9 @@ LONG AXPlatformNodeWin::ComputeUIAControlType() { // NOLINT(runtime/int)
return UIA_DocumentControlTypeId;
}
case ax::mojom::Role::kEmphasis:
return UIA_TextControlTypeId;
case ax::mojom::Role::kFeed:
return UIA_GroupControlTypeId;
@ -6415,6 +6438,9 @@ LONG AXPlatformNodeWin::ComputeUIAControlType() { // NOLINT(runtime/int)
case ax::mojom::Role::kStatus:
return UIA_StatusBarControlTypeId;
case ax::mojom::Role::kStrong:
return UIA_TextControlTypeId;
case ax::mojom::Role::kSplitter:
return UIA_SeparatorControlTypeId;

@ -628,6 +628,9 @@ base::string16 TestAXNodeWrapper::GetLocalizedStringForRoleDescription() const {
case ax::mojom::Role::kAudio:
return base::ASCIIToUTF16("audio");
case ax::mojom::Role::kCode:
return base::ASCIIToUTF16("code");
case ax::mojom::Role::kColorWell:
return base::ASCIIToUTF16("color picker");
@ -653,6 +656,9 @@ base::string16 TestAXNodeWrapper::GetLocalizedStringForRoleDescription() const {
case ax::mojom::Role::kDetails:
return base::ASCIIToUTF16("details");
case ax::mojom::Role::kEmphasis:
return base::ASCIIToUTF16("emphasis");
case ax::mojom::Role::kFigure:
return base::ASCIIToUTF16("figure");
@ -683,6 +689,9 @@ base::string16 TestAXNodeWrapper::GetLocalizedStringForRoleDescription() const {
case ax::mojom::Role::kStatus:
return base::ASCIIToUTF16("output");
case ax::mojom::Role::kStrong:
return base::ASCIIToUTF16("strong");
case ax::mojom::Role::kTextField: {
std::string input_type;
if (data.GetStringAttribute(ax::mojom::StringAttribute::kInputType,