mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1802866: Don't send a11y cache pushes containing no data. r=nlapre
This can happen if we're pushing the tree for only moved (no new) Accessibles, since we don't send cache pushes for those. It can also happen if an Accessible generates no cache data, which is rare but probably not impossible. Making IPDL calls with no data is wasteful, so don't do it. Differential Revision: https://phabricator.services.mozilla.com/D163203
This commit is contained in:
parent
e536e5292a
commit
4e85ff0fe9
@ -3086,6 +3086,9 @@ void LocalAccessible::SendCache(uint64_t aCacheDomain,
|
|||||||
|
|
||||||
RefPtr<AccAttributes> fields =
|
RefPtr<AccAttributes> fields =
|
||||||
BundleFieldsForCache(aCacheDomain, aUpdateType);
|
BundleFieldsForCache(aCacheDomain, aUpdateType);
|
||||||
|
if (!fields->Count()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
nsTArray<CacheData> data;
|
nsTArray<CacheData> data;
|
||||||
data.AppendElement(CacheData(ID(), fields));
|
data.AppendElement(CacheData(ID(), fields));
|
||||||
ipcDoc->SendCache(aUpdateType, data, false);
|
ipcDoc->SendCache(aUpdateType, data, false);
|
||||||
|
@ -109,7 +109,11 @@ void DocAccessibleChildBase::InsertIntoIpcTree(LocalAccessible* aParent,
|
|||||||
cache.AppendElement(CacheData(id, fields));
|
cache.AppendElement(CacheData(id, fields));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Unused << SendCache(CacheUpdateType::Initial, cache, !aSuppressShowEvent);
|
// The cache array might be empty if there were only moved Accessibles or if
|
||||||
|
// no Accessibles generated any cache data.
|
||||||
|
if (!cache.IsEmpty()) {
|
||||||
|
Unused << SendCache(CacheUpdateType::Initial, cache, !aSuppressShowEvent);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user