Skip to content

Commit 52fcc10

Browse files
authored
Merge bb6c412 into 8f4909b
2 parents 8f4909b + bb6c412 commit 52fcc10

File tree

2 files changed

+55
-2
lines changed

2 files changed

+55
-2
lines changed

nvdaHelper/vbufBackends/gecko_ia2/gecko_ia2.cpp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,38 @@ CComPtr<IAccessible2> GeckoVBufBackend_t::getSelectedItem(
369369
return nullptr;
370370
}
371371

372+
/**
373+
* Get the text box inside a combo box, if any.
374+
*/
375+
CComPtr<IAccessible2> getTextBoxInComboBox(
376+
IAccessible2* comboBox
377+
) {
378+
CComPtr<IDispatch> childDisp;
379+
// We only check the first child.
380+
if (FAILED(comboBox->get_accChild(CComVariant(1), &childDisp))) {
381+
return nullptr;
382+
}
383+
CComQIPtr<IAccessible2> child = childDisp;
384+
if (!child) {
385+
return nullptr;
386+
}
387+
long role;
388+
if (FAILED(child->role(&role))) {
389+
return nullptr;
390+
}
391+
if (role != ROLE_SYSTEM_TEXT) {
392+
return nullptr;
393+
}
394+
CComVariant state;
395+
if (FAILED(child->get_accState(CComVariant(CHILDID_SELF), &state))) {
396+
return nullptr;
397+
}
398+
if (state.vt != VT_I4 || !(state.lVal & STATE_SYSTEM_FOCUSABLE)) {
399+
return nullptr;
400+
}
401+
return child;
402+
}
403+
372404
const vector<wstring>ATTRLIST_ROLES(1, L"IAccessible2::attribute_xml-roles");
373405
const wregex REGEX_PRESENTATION_ROLE(L"IAccessible2\\\\:\\\\:attribute_xml-roles:.*\\bpresentation\\b.*;");
374406

@@ -969,6 +1001,25 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(IAccessible2* pacc,
9691001
}
9701002
}
9711003

1004+
} else if (role == ROLE_SYSTEM_COMBOBOX) {
1005+
CComPtr<IAccessible2> textBox = getTextBoxInComboBox(pacc);
1006+
if (textBox) {
1007+
// ARIA 1.1 combobox. Render the text box child.
1008+
if (tempNode = this->fillVBuf(textBox, buffer, parentNode, previousNode,
1009+
paccTable, paccTable2, tableID, presentationalRowNumber,
1010+
ignoreInteractiveUnlabelledGraphics)
1011+
) {
1012+
previousNode=tempNode;
1013+
} else {
1014+
LOG_DEBUG(L"Error in calling fillVBuf");
1015+
}
1016+
} else if (value) {
1017+
previousNode=buffer->addTextFieldNode(parentNode,previousNode,value);
1018+
if(previousNode && !locale.empty()) {
1019+
previousNode->addAttribute(L"language", locale);
1020+
}
1021+
}
1022+
9721023
} else {
9731024
// There were no children to render.
9741025
if(role==ROLE_SYSTEM_GRAPHIC) {

source/browseMode.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,8 +1582,10 @@ def _isNVDAObjectInApplication_noWalk(self, obj):
15821582
if (
15831583
# roles such as application and dialog should be treated as being within a "application" and therefore outside of the browseMode document.
15841584
obj.role in self.APPLICATION_ROLES
1585-
# Anything inside a combo box should be treated as being outside a browseMode document.
1586-
or (obj.container and obj.container.role==controlTypes.ROLE_COMBOBOX)
1585+
# Anything other than an editable text box inside a combo box should be
1586+
# treated as being outside a browseMode document.
1587+
or (obj.role!=controlTypes.ROLE_EDITABLETEXT and obj.container
1588+
and obj.container.role==controlTypes.ROLE_COMBOBOX)
15871589
):
15881590
return True
15891591
return None

0 commit comments

Comments
 (0)