Bug 1737944 - P11: When cache is enabled, calculate group info remotely and add it to attributes. r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D134214
This commit is contained in:
Eitan Isaacson 2022-01-04 21:01:38 +00:00
Родитель 7a6180f627
Коммит 965646877d
3 изменённых файлов: 29 добавлений и 0 удалений

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

@ -484,7 +484,23 @@ already_AddRefed<AccAttributes> RemoteAccessibleBase<Derived>::Attributes() {
mCachedFields->GetAttribute<RefPtr<nsAtom>>(nsGkAtoms::tag)) {
attributes->SetAttribute(nsGkAtoms::tag, *tag);
}
GroupPos groupPos = GroupPosition();
nsAccUtils::SetAccGroupAttrs(attributes, groupPos.level, groupPos.setSize,
groupPos.posInSet);
bool hierarchical = false;
uint32_t itemCount = AccGroupInfo::TotalItemCount(this, &hierarchical);
if (itemCount) {
attributes->SetAttribute(nsGkAtoms::child_item_count,
static_cast<int32_t>(itemCount));
}
if (hierarchical) {
attributes->SetAttribute(nsGkAtoms::tree, true);
}
}
return attributes.forget();
}

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

@ -136,6 +136,10 @@ nsStaticAtom* RemoteAccessible::ARIARoleAtom() const {
}
GroupPos RemoteAccessible::GroupPosition() {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
return RemoteAccessibleBase<RemoteAccessible>::GroupPosition();
}
GroupPos groupPos;
Unused << mDoc->SendGroupPosition(mID, &groupPos.level, &groupPos.setSize,
&groupPos.posInSet);

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

@ -859,5 +859,14 @@ Accessible* RemoteAccessible::ChildAtPoint(
return proxy;
}
GroupPos RemoteAccessible::GroupPosition() {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
return RemoteAccessibleBase<RemoteAccessible>::GroupPosition();
}
// This is only supported when cache is enabled.
return GroupPos();
}
} // namespace a11y
} // namespace mozilla