Bug 1798550: Use cached name accessor method when computing MEMBER_OF r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D160948
This commit is contained in:
Morgan Rae Reschenberg 2022-11-02 19:32:58 +00:00
parent 40ef75f8ae
commit e70136af6d

View File

@ -771,9 +771,8 @@ Relation RemoteAccessibleBase<Derived>::RelationByType(
Relation rel = Relation();
// HTML radio buttons with cached names should be grouped.
if (IsHTMLRadioButton()) {
auto maybeName =
mCachedFields->GetAttribute<nsString>(nsGkAtoms::radioLabel);
if (!maybeName) {
nsString name = GetCachedHTMLNameAttribute();
if (name.IsEmpty()) {
return rel;
}
@ -782,7 +781,7 @@ Relation RemoteAccessibleBase<Derived>::RelationByType(
ancestor = ancestor->RemoteParent();
}
Pivot p = Pivot(ancestor);
PivotRadioNameRule rule(*maybeName);
PivotRadioNameRule rule(name);
Accessible* match = p.Next(ancestor, rule);
while (match) {
rel.AppendTarget(match->AsRemote());