Skip to content

Commit fd96606

Browse files
committed
Bug 1417327 part 3: Accessible handler: Fix cache for IAccessible::accDefaultAction and use it for IAccessibleAction::name(0). r=MarcoZ
1. Bug 1363595 added support for retrieving accDefaultAction from the cache, but the value was never cached in the first place. This would have meant that accDefaultAction was returning nothing to clients. 2. Since accDefaultAction is the name of the first action, we can also use this cached value for IAccessibleAction::name for index 0. MozReview-Commit-ID: 6PGRH45kKdB UltraBlame original commit: f9111cd04f8cc3b2e7a3c559b8284c0525c7c098
1 parent f7975ee commit fd96606

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

accessible/ipc/win/HandlerProvider.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ HandlerProvider::BuildDynamicIA2Data(DynamicIA2Data* aOutIA2Data)
315315
return;
316316
}
317317

318+
hr = target->get_accDefaultAction(kChildIdSelf, &aOutIA2Data->mDefaultAction);
319+
if (FAILED(hr)) {
320+
return;
321+
}
322+
318323
hr = target->get_accChildCount(&aOutIA2Data->mChildCount);
319324
if (FAILED(hr)) {
320325
return;

accessible/ipc/win/handler/AccessibleHandler.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,6 +1280,24 @@ AccessibleHandler::get_keyBinding(long actionIndex,
12801280
HRESULT
12811281
AccessibleHandler::get_name(long actionIndex, BSTR* name)
12821282
{
1283+
if (!name) {
1284+
return E_INVALIDARG;
1285+
}
1286+
1287+
if (HasPayload()) {
1288+
if (actionIndex >= mCachedData.mDynamicData.mNActions) {
1289+
1290+
return E_INVALIDARG;
1291+
}
1292+
1293+
if (actionIndex == 0) {
1294+
1295+
GET_BSTR(mDefaultAction, *name);
1296+
return S_OK;
1297+
}
1298+
}
1299+
1300+
12831301
HRESULT hr = ResolveIAHyperlink();
12841302
if (FAILED(hr)) {
12851303
return hr;

0 commit comments

Comments
 (0)