mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 07:42:04 +00:00
bug 1243077 - simplify GetRoleCB some r=davidb
We can replace the code dealing with Accessibles and proxies differently with a call to AccessibleOrProxy::Role()
This commit is contained in:
parent
f92728f426
commit
ba8141b22e
@ -650,22 +650,17 @@ getRoleCB(AtkObject *aAtkObj)
|
||||
if (aAtkObj->role != ATK_ROLE_INVALID)
|
||||
return aAtkObj->role;
|
||||
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
a11y::role role;
|
||||
if (!accWrap) {
|
||||
ProxyAccessible* proxy = GetProxy(aAtkObj);
|
||||
if (!proxy)
|
||||
return ATK_ROLE_INVALID;
|
||||
AccessibleOrProxy acc = GetInternalObj(aAtkObj);
|
||||
if (acc.IsNull()) {
|
||||
return ATK_ROLE_INVALID;
|
||||
}
|
||||
|
||||
role = proxy->Role();
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
if (AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj)) {
|
||||
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
|
||||
"Does not support Text interface when it should");
|
||||
#endif
|
||||
|
||||
role = accWrap->Role();
|
||||
}
|
||||
#endif
|
||||
|
||||
#define ROLE(geckoRole, stringRole, atkRole, macRole, \
|
||||
msaaRole, ia2Role, nameRule) \
|
||||
@ -673,7 +668,7 @@ getRoleCB(AtkObject *aAtkObj)
|
||||
aAtkObj->role = atkRole; \
|
||||
break;
|
||||
|
||||
switch (role) {
|
||||
switch (acc.Role()) {
|
||||
#include "RoleMap.h"
|
||||
default:
|
||||
MOZ_CRASH("Unknown role.");
|
||||
|
Loading…
Reference in New Issue
Block a user