forked from mirrors/gecko-dev
Bug 1824935 part 1: Add ARIA roles to RoleMap. r=eeejay
This will soon be used to return standardized ARIA role names from a new function. Differential Revision: https://phabricator.services.mozilla.com/D175581
This commit is contained in:
parent
df636672ed
commit
d143f977de
11 changed files with 211 additions and 23 deletions
|
|
@ -564,8 +564,8 @@ void AccessibleWrap::SetVirtualViewID(Accessible* aAccessible,
|
|||
}
|
||||
|
||||
int32_t AccessibleWrap::GetAndroidClass(role aRole) {
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::geckoRole: \
|
||||
return androidClass;
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ void a11y::PlatformInit() {
|
|||
}
|
||||
|
||||
// Preload any roles that have localized versions
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
rv = stringBundle->GetStringFromName(stringRole, localizedStr); \
|
||||
if (NS_SUCCEEDED(rv)) { \
|
||||
sLocalizedStrings.InsertOrUpdate(u##stringRole##_ns, localizedStr); \
|
||||
|
|
|
|||
|
|
@ -581,8 +581,8 @@ AtkRole getRoleCB(AtkObject* aAtkObj) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::geckoRole: \
|
||||
aAtkObj->role = atkRole; \
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,8 @@
|
|||
|
||||
using namespace mozilla::a11y;
|
||||
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
static_assert( \
|
||||
static_cast<uint32_t>(roles::geckoRole) == \
|
||||
static_cast<uint32_t>(nsIAccessibleRole::ROLE_##geckoRole), \
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -786,8 +786,8 @@ void nsAccessibilityService::RecreateAccessible(PresShell* aPresShell,
|
|||
}
|
||||
|
||||
void nsAccessibilityService::GetStringRole(uint32_t aRole, nsAString& aString) {
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::geckoRole: \
|
||||
aString.AssignLiteral(stringRole); \
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -312,8 +312,8 @@ bool nsTextEquivUtils::AppendString(nsAString* aString,
|
|||
}
|
||||
|
||||
uint32_t nsTextEquivUtils::GetRoleRule(role aRole) {
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::geckoRole: \
|
||||
return nameRule;
|
||||
|
||||
|
|
|
|||
|
|
@ -356,8 +356,8 @@ static const uint64_t kCacheInitialized = ((uint64_t)0x1) << 63;
|
|||
}
|
||||
|
||||
- (NSString*)moxRole {
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::geckoRole: \
|
||||
return macRole;
|
||||
|
||||
|
|
@ -430,8 +430,8 @@ static const uint64_t kCacheInitialized = ((uint64_t)0x1) << 63;
|
|||
}
|
||||
}
|
||||
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::geckoRole: \
|
||||
if (![macSubrole isEqualToString:NSAccessibilityUnknownSubrole]) { \
|
||||
return macSubrole; \
|
||||
|
|
|
|||
|
|
@ -161,8 +161,8 @@ ia2Accessible::role(long* aRole) {
|
|||
Accessible* acc = Acc();
|
||||
if (!acc) return CO_E_OBJNOTCONNECTED;
|
||||
|
||||
#define ROLE(_geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
#define ROLE(_geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::_geckoRole: \
|
||||
*aRole = ia2Role; \
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -1104,10 +1104,10 @@ MsaaAccessible::get_accRole(
|
|||
|
||||
uint32_t msaaRole = 0;
|
||||
|
||||
#define ROLE(_geckoRole, stringRole, atkRole, macRole, macSubrole, _msaaRole, \
|
||||
ia2Role, androidClass, nameRule) \
|
||||
case roles::_geckoRole: \
|
||||
msaaRole = _msaaRole; \
|
||||
#define ROLE(_geckoRole, stringRole, ariaRole, atkRole, macRole, macSubrole, \
|
||||
_msaaRole, ia2Role, androidClass, nameRule) \
|
||||
case roles::_geckoRole: \
|
||||
msaaRole = _msaaRole; \
|
||||
break;
|
||||
|
||||
switch (geckoRole) {
|
||||
|
|
|
|||
|
|
@ -482,6 +482,7 @@ STATIC_ATOMS = [
|
|||
Atom("fullscreenerror", "fullscreenerror"),
|
||||
Atom("functionAvailable", "function-available"),
|
||||
Atom("generateId", "generate-id"),
|
||||
Atom("generic", "generic"),
|
||||
Atom("getter", "getter"),
|
||||
Atom("graphicsDocument", "graphics-document"),
|
||||
Atom("graphicsObject", "graphics-object"),
|
||||
|
|
|
|||
Loading…
Reference in a new issue