mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-01 22:07:41 +00:00
Bug 1787284: [Part 3] Use cached name to compute MEMBER_OF rel for HTML radio buttons r=eeejay
Depends on D159118 Differential Revision: https://phabricator.services.mozilla.com/D159119
This commit is contained in:
parent
a655200f47
commit
5ba1794a07
@ -763,6 +763,28 @@ Relation RemoteAccessibleBase<Derived>::RelationByType(
|
||||
|
||||
if (aType == RelationType::MEMBER_OF) {
|
||||
Relation rel = Relation();
|
||||
// HTML radio buttons with cached names should be grouped.
|
||||
if (IsHTMLRadioButton()) {
|
||||
auto maybeName =
|
||||
mCachedFields->GetAttribute<nsString>(nsGkAtoms::radioLabel);
|
||||
if (!maybeName) {
|
||||
return rel;
|
||||
}
|
||||
|
||||
RemoteAccessible* ancestor = RemoteParent();
|
||||
while (ancestor && ancestor->Role() != roles::FORM && ancestor != mDoc) {
|
||||
ancestor = ancestor->RemoteParent();
|
||||
}
|
||||
Pivot p = Pivot(ancestor);
|
||||
PivotRadioNameRule rule(*maybeName);
|
||||
Accessible* match = p.Next(ancestor, rule);
|
||||
while (match) {
|
||||
rel.AppendTarget(match->AsRemote());
|
||||
match = p.Next(match, rule);
|
||||
}
|
||||
return rel;
|
||||
}
|
||||
|
||||
if (IsARIARole(nsGkAtoms::radio)) {
|
||||
// ARIA radio buttons should be grouped by their radio group
|
||||
// parent, if one exists.
|
||||
|
Loading…
x
Reference in New Issue
Block a user