Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 9d832bd

Browse files
author
Nathan LaPre
committed
Bug 1794974: Part 5: Add code that requests new cache domains to remote accessibles, r=Jamie
This revision adds code everywhere necessary to request cache domains. These requests are a response to assistive technology queries. The revision also adds asserts and other safety mechanisms to ensure that we have the right information before responding. If an AT requests something that Gecko doesn't have an answer for, we return a default value and hope they'll ask again once we have the info. Differential Revision: https://phabricator.services.mozilla.com/D220039
1 parent 8cf50fc commit 9d832bd

File tree

4 files changed

+254
-1
lines changed

4 files changed

+254
-1
lines changed

accessible/base/CachedTableAccessible.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ TableAccessible* CachedTableCellAccessible::Table() const {
277277

278278
uint32_t CachedTableCellAccessible::ColExtent() const {
279279
if (RemoteAccessible* remoteAcc = mAcc->AsRemote()) {
280+
if (RequestDomainsIfInactive(CacheDomain::Table)) {
281+
return 1;
282+
}
280283
if (remoteAcc->mCachedFields) {
281284
if (auto colSpan = remoteAcc->mCachedFields->GetAttribute<int32_t>(
282285
CacheKey::ColSpan)) {
@@ -300,6 +303,9 @@ uint32_t CachedTableCellAccessible::ColExtent() const {
300303

301304
uint32_t CachedTableCellAccessible::RowExtent() const {
302305
if (RemoteAccessible* remoteAcc = mAcc->AsRemote()) {
306+
if (RequestDomainsIfInactive(CacheDomain::Table)) {
307+
return 1;
308+
}
303309
if (remoteAcc->mCachedFields) {
304310
if (auto rowSpan = remoteAcc->mCachedFields->GetAttribute<int32_t>(
305311
CacheKey::RowSpan)) {
@@ -323,6 +329,9 @@ uint32_t CachedTableCellAccessible::RowExtent() const {
323329

324330
UniquePtr<AccIterable> CachedTableCellAccessible::GetExplicitHeadersIterator() {
325331
if (RemoteAccessible* remoteAcc = mAcc->AsRemote()) {
332+
if (RequestDomainsIfInactive(CacheDomain::Table)) {
333+
return nullptr;
334+
}
326335
if (remoteAcc->mCachedFields) {
327336
if (auto headers =
328337
remoteAcc->mCachedFields->GetAttribute<nsTArray<uint64_t>>(
@@ -342,6 +351,9 @@ void CachedTableCellAccessible::ColHeaderCells(nsTArray<Accessible*>* aCells) {
342351
if (!table) {
343352
return;
344353
}
354+
if (mAcc->IsRemote() && RequestDomainsIfInactive(CacheDomain::Table)) {
355+
return;
356+
}
345357
if (auto iter = GetExplicitHeadersIterator()) {
346358
while (Accessible* header = iter->Next()) {
347359
role headerRole = header->Role();

accessible/base/TextLeafRange.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,6 +1490,9 @@ void TextLeafPoint::AddTextOffsetAttributes(AccAttributes* aAttrs) const {
14901490

14911491
RemoteAccessible* acc = mAcc->AsRemote();
14921492
MOZ_ASSERT(acc);
1493+
if (RequestDomainsIfInactive(CacheDomain::TextOffsetAttributes)) {
1494+
return;
1495+
}
14931496
if (!acc->mCachedFields) {
14941497
return;
14951498
}
@@ -1603,6 +1606,9 @@ TextLeafPoint TextLeafPoint::FindTextOffsetAttributeSameAcc(
16031606

16041607
RemoteAccessible* acc = mAcc->AsRemote();
16051608
MOZ_ASSERT(acc);
1609+
if (RequestDomainsIfInactive(CacheDomain::TextOffsetAttributes)) {
1610+
return TextLeafPoint();
1611+
}
16061612
if (!acc->mCachedFields) {
16071613
return TextLeafPoint();
16081614
}
@@ -1962,6 +1968,9 @@ LayoutDeviceIntRect TextLeafPoint::CharBounds() {
19621968
return bounds;
19631969
}
19641970

1971+
if (RequestDomainsIfInactive(CacheDomain::TextBounds)) {
1972+
return LayoutDeviceIntRect();
1973+
}
19651974
RemoteAccessible* remote = mAcc->AsRemote();
19661975
nsRect charBounds = remote->GetCachedCharRect(mOffset);
19671976
if (!charBounds.IsEmpty()) {

0 commit comments

Comments
 (0)