Bug 1378160 - The ARIA region role should be exposed as a landmark; not a pane. r=MarcoZ

Create a new internal REGION role which maps to the generic landmark role
of each platform accessibility API. Update the internal mapping of region
from roles::PANE and kGenericAccType to roles::REGION and eLandmark. Also
change the AXSubrole of region from "AXDocumentRegion" to "AXLandmarkRegion",
the latter being what is specified in the Core AAM 1.1 and used in Safari.
This commit is contained in:
Joanmarie Diggs 2017-07-04 18:10:00 -04:00
Родитель 9aa633008d
Коммит 4cc658fc52
7 изменённых файлов: 30 добавлений и 6 удалений

Просмотреть файл

@ -912,12 +912,12 @@ static const nsRoleMapEntry sWAIRoleMaps[] =
},
{ // region
&nsGkAtoms::region,
roles::PANE,
roles::REGION,
kUseMapRole,
eNoValue,
eNoAction,
eNoLiveAttr,
kGenericAccType,
eLandmark,
kNoReqStates
},
{ // row

Просмотреть файл

@ -1007,7 +1007,15 @@ enum Role {
*/
ARTICLE = 172,
LAST_ROLE = ARTICLE
/**
* A perceivable section containing content that is relevant to a specific,
* author-specified purpose and sufficiently important that users will likely
* want to be able to navigate to the section easily and to have it listed in
* a summary of the page.
*/
REGION = 173,
LAST_ROLE = REGION
};
} // namespace role

Просмотреть файл

@ -1399,3 +1399,11 @@ ROLE(ARTICLE,
ROLE_SYSTEM_DOCUMENT,
ROLE_SYSTEM_DOCUMENT,
eNoNameRule)
ROLE(REGION,
"region",
ATK_ROLE_LANDMARK,
NSAccessibilityGroupRole,
USE_ROLE_STRING,
IA2_ROLE_LANDMARK,
eNoNameRule)

Просмотреть файл

@ -1001,4 +1001,12 @@ interface nsIAccessibleRole : nsISupports
* e.g. in syndication.
*/
const unsigned long ROLE_ARTICLE = 172;
/**
* A perceivable section containing content that is relevant to a specific,
* author-specified purpose and sufficiently important that users will likely
* want to be able to navigate to the section easily and to have it listed in
* a summary of the page.
*/
const unsigned long ROLE_REGION = 173;
};

Просмотреть файл

@ -798,7 +798,7 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
if (roleAtom == nsGkAtoms::note_)
return @"AXDocumentNote";
if (roleAtom == nsGkAtoms::region)
return @"AXDocumentRegion";
return @"AXLandmarkRegion";
if (roleAtom == nsGkAtoms::status)
return @"AXApplicationStatus";
if (roleAtom == nsGkAtoms::tabpanel)
@ -952,7 +952,6 @@ static const RoleDescrMap sRoleDescrMap[] = {
{ @"AXDocumentArticle", NS_LITERAL_STRING("article") },
{ @"AXDocumentMath", NS_LITERAL_STRING("math") },
{ @"AXDocumentNote", NS_LITERAL_STRING("note") },
{ @"AXDocumentRegion", NS_LITERAL_STRING("region") },
{ @"AXLandmarkApplication", NS_LITERAL_STRING("application") },
{ @"AXLandmarkBanner", NS_LITERAL_STRING("banner") },
{ @"AXLandmarkComplementary", NS_LITERAL_STRING("complementary") },

Просмотреть файл

@ -100,6 +100,7 @@ const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON;
const ROLE_RADIOBUTTON = nsIAccessibleRole.ROLE_RADIOBUTTON;
const ROLE_RADIO_GROUP = nsIAccessibleRole.ROLE_RADIO_GROUP;
const ROLE_RADIO_MENU_ITEM = nsIAccessibleRole.ROLE_RADIO_MENU_ITEM;
const ROLE_REGION = nsIAccessibleRole.ROLE_REGION;
const ROLE_RICH_OPTION = nsIAccessibleRole.ROLE_RICH_OPTION;
const ROLE_ROW = nsIAccessibleRole.ROLE_ROW;
const ROLE_ROWHEADER = nsIAccessibleRole.ROLE_ROWHEADER;

Просмотреть файл

@ -54,7 +54,7 @@
testRole("aria_progressbar", ROLE_PROGRESSBAR);
testRole("aria_radio", ROLE_RADIOBUTTON);
testRole("aria_radiogroup", ROLE_RADIO_GROUP);
testRole("aria_region", ROLE_PANE);
testRole("aria_region", ROLE_REGION);
testRole("aria_row", ROLE_ROW);
testRole("aria_rowheader", ROLE_ROWHEADER);
testRole("aria_scrollbar", ROLE_SCROLLBAR);