Bug 1860724: Use RemoteChildAt instead of RemoteNextSibling when handling RemoteAccessible reorder events. r=eeejay

RemoteNextSibling is slow because it uses IndexInParent, which is not currently cached.

Differential Revision: https://phabricator.services.mozilla.com/D191719
This commit is contained in:
James Teh 2023-10-25 23:31:53 +00:00
parent 5d6cbfc643
commit 4f15c940fa

View file

@ -367,9 +367,9 @@ void DocAccessibleParent::FireEvent(RemoteAccessible* aAcc,
const uint32_t& aEventType) {
if (aEventType == nsIAccessibleEvent::EVENT_REORDER ||
aEventType == nsIAccessibleEvent::EVENT_INNER_REORDER) {
for (RemoteAccessible* child = aAcc->RemoteFirstChild(); child;
child = child->RemoteNextSibling()) {
child->InvalidateGroupInfo();
uint32_t count = aAcc->ChildCount();
for (uint32_t c = 0; c < count; ++c) {
aAcc->RemoteChildAt(c)->InvalidateGroupInfo();
}
} else if (aEventType == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE &&
aAcc == this) {