Bug 1451169 - Change nsRoleMapEntry::roleAtom from nsStaticAtom** to nsStaticAtom* const. r=davidb

--HG--
extra : rebase_source : 3a7101328e9ffcb6adeef42c98afa26d0531ca1c
This commit is contained in:
Nicholas Nethercote 2018-04-03 10:55:33 +10:00
parent 2d810403e3
commit 7de7b7aae3
7 changed files with 166 additions and 165 deletions

File diff suppressed because it is too large Load Diff

View File

@ -142,7 +142,7 @@ struct nsRoleMapEntry
* Return true if matches to the given ARIA role.
*/
bool Is(nsAtom* aARIARole) const
{ return *roleAtom == aARIARole; }
{ return roleAtom == aARIARole; }
/**
* Return true if ARIA role has the given accessible type.
@ -154,10 +154,10 @@ struct nsRoleMapEntry
* Return ARIA role.
*/
const nsDependentAtomString ARIARoleString() const
{ return nsDependentAtomString(*roleAtom); }
{ return nsDependentAtomString(roleAtom); }
// ARIA role: string representation such as "button"
nsStaticAtom** roleAtom;
nsStaticAtom* const roleAtom;
// Role mapping rule: maps to enum Role
mozilla::a11y::role role;

View File

@ -1549,8 +1549,9 @@ nsAtom*
Accessible::LandmarkRole() const
{
const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
return roleMapEntry && roleMapEntry->IsOfType(eLandmark) ?
*(roleMapEntry->roleAtom) : nullptr;
return roleMapEntry && roleMapEntry->IsOfType(eLandmark)
? roleMapEntry->roleAtom
: nullptr;
}
role

View File

@ -62,7 +62,7 @@ bool IsSearchbox() const;
nsAtom* LandmarkRole() const;
nsAtom* ARIARoleAtom() const;
nsStaticAtom* ARIARoleAtom() const;
int32_t GetLevelInternal();
void ScrollTo(uint32_t aScrollType);

View File

@ -293,7 +293,7 @@ DocAccessibleChild::RecvARIARoleAtom(const uint64_t& aID, nsString* aRole)
}
if (const nsRoleMapEntry* roleMap = acc->ARIARoleMap()) {
if (nsAtom* roleAtom = *(roleMap->roleAtom)) {
if (nsStaticAtom* roleAtom = roleMap->roleAtom) {
roleAtom->ToString(*aRole);
}
}

View File

@ -127,7 +127,7 @@ ProxyAccessible::LandmarkRole() const
return NS_GetStaticAtom(landmark);
}
nsAtom*
nsStaticAtom*
ProxyAccessible::ARIARoleAtom() const
{
nsString role;

View File

@ -770,10 +770,10 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
return @"AXLandmarkRegion";
// Now, deal with widget roles
nsAtom* roleAtom = nullptr;
nsStaticAtom* roleAtom = nullptr;
if (accWrap && accWrap->HasARIARole()) {
const nsRoleMapEntry* roleMap = accWrap->ARIARoleMap();
roleAtom = *roleMap->roleAtom;
roleAtom = roleMap->roleAtom;
}
if (proxy)
roleAtom = proxy->ARIARoleAtom();