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
Родитель 40ef75f8ae
Коммит e70136af6d
1 изменённых файлов: 3 добавлений и 4 удалений

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

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