Commit ac8f5a4a authored by shreeram.k's avatar shreeram.k Committed by Commit bot

ARIA role region is not exposed correct with MSAA+IA2 role

According to specs, ARIA role region should be exposed as below

MSAA+IA2: ROLE_SYSTEM_PANE

AXRole:AXGroup
AXSubrole:AXDocumentRegion
AXRoleDescription:'region'

Also section tag should have AXRoleDescription as 'region'

BUG=424521
TBR=avi

Review URL: https://codereview.chromium.org/638103003

Cr-Commit-Position: refs/heads/master@{#300535}
parent baccf371
......@@ -353,6 +353,9 @@ below:
<message name="IDS_AX_ROLE_HEADING" desc="accessibility role description for headings">
heading
</message>
<message name="IDS_AX_ROLE_REGION" desc="accessibility role description for region">
region
</message>
<if expr="is_macosx">
<message name="IDS_AX_ROLE_FOOTER" desc="accessibility role description for footers">
footer
......
......@@ -582,6 +582,9 @@ NSDictionary* attributeToMethodNameMap = nil;
case ui::AX_ROLE_FOOTER:
return base::SysUTF16ToNSString(content_client->GetLocalizedString(
IDS_AX_ROLE_FOOTER));
case ui::AX_ROLE_REGION:
return base::SysUTF16ToNSString(content_client->GetLocalizedString(
IDS_AX_ROLE_REGION));
case ui::AX_ROLE_SPIN_BUTTON:
// This control is similar to what VoiceOver calls a "stepper".
return base::SysUTF16ToNSString(content_client->GetLocalizedString(
......
......@@ -3690,9 +3690,12 @@ void BrowserAccessibilityWin::InitRoleAndState() {
ia2_role_ = IA2_ROLE_SECTION;
break;
case ui::AX_ROLE_REGION:
ia_role_ = ROLE_SYSTEM_GROUPING;
ia2_role_ = IA2_ROLE_SECTION;
ia_state_ |= STATE_SYSTEM_READONLY;
if (html_tag == L"section") {
ia_role_ = ROLE_SYSTEM_GROUPING;
ia2_role_ = IA2_ROLE_SECTION;
} else {
ia_role_ = ROLE_SYSTEM_PANE;
}
break;
case ui::AX_ROLE_ROW:
ia_role_ = ROLE_SYSTEM_ROW;
......
......@@ -469,6 +469,10 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
RunTest(FILE_PATH_LITERAL("aria-readonly.html"));
}
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaRegion) {
RunTest(FILE_PATH_LITERAL("aria-region.html"));
}
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaSort) {
RunTest(FILE_PATH_LITERAL("aria-sort.html"));
}
......@@ -824,8 +828,8 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityQ) {
RunTest(FILE_PATH_LITERAL("q.html"));
}
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityRegion) {
RunTest(FILE_PATH_LITERAL("region.html"));
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySection) {
RunTest(FILE_PATH_LITERAL("section.html"));
}
IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilitySelect) {
......
AXWebArea AXRoleDescription='HTML content'
AXGroup AXRoleDescription='group' AXLinkedUIElements=["AXGroup footer"]
AXGroup AXRoleDescription='region' AXLinkedUIElements=["AXGroup footer"]
AXStaticText AXRoleDescription='text' AXValue='Lorem ipsum'
AXGroup AXRoleDescription='footer'
AXStaticText AXRoleDescription='text' AXValue='dolor sit amet'
android.webkit.WebView focusable focused scrollable
android.view.View clickable name='This is an ARIA region.'
AXWebArea AXRoleDescription='HTML content'
AXGroup AXSubrole=AXDocumentRegion AXRoleDescription='region'
AXStaticText AXRoleDescription='text' AXValue='This is an ARIA region.'
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
ROLE_SYSTEM_PANE xml-roles:region
ROLE_SYSTEM_STATICTEXT name='This is an ARIA region.'
<!--
@MAC-ALLOW:AXSubrole=AXDocumentRegion
@MAC-DENY:AXTitle*
@WIN-ALLOW:xml-roles:region
@MAC-ALLOW:AXRole*
@MAC-ALLOW:AXSubrole*
@WIN-ALLOW:xml-roles:*
-->
<!doctype html>
<!DOCTYPE html>
<html>
<body>
<section>
This is a section element.
</section>
<div role="region">
This is an ARIA region.
</div>
</body>
</html>
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
IA2_ROLE_SECTION READONLY
ROLE_SYSTEM_STATICTEXT name='Test that elements respawn in the accessibility tree after a modal dialog closes.'
IA2_ROLE_SECTION READONLY
IA2_ROLE_SECTION
ROLE_SYSTEM_COMBOBOX FOCUSABLE
ROLE_SYSTEM_CLIENT
ROLE_SYSTEM_LISTITEM FOCUSABLE
......
AXWebArea
AXGroup AXSubrole=AXDocumentRegion
AXStaticText AXValue='This is a section element.'
AXGroup AXSubrole=AXDocumentRegion
AXStaticText AXValue='This is an ARIA region.'
android.webkit.WebView focusable focused scrollable
android.view.View clickable name='This is a section element.'
android.view.View clickable name='This is an ARIA region.'
AXWebArea AXRoleDescription='HTML content'
AXGroup AXSubrole=AXDocumentRegion AXRoleDescription='region'
AXStaticText AXRoleDescription='text' AXValue='This is a section element.'
ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
IA2_ROLE_SECTION READONLY xml-roles:region
IA2_ROLE_SECTION xml-roles:region
ROLE_SYSTEM_STATICTEXT name='This is a section element.'
IA2_ROLE_SECTION READONLY xml-roles:region
ROLE_SYSTEM_STATICTEXT name='This is an ARIA region.'
<!--
@MAC-ALLOW:AXRole*
@MAC-ALLOW:AXSubrole*
@WIN-ALLOW:xml-roles:*
-->
<!DOCTYPE html>
<html>
<body>
<section>
This is a section element.
</section>
</body>
</html>
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