зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
7a6180f627
Коммит
965646877d
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче