@@ -422,6 +422,22 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
422422 nhAssert (parentNode); // new node must have been created
423423 previousNode=NULL ;
424424
425+ // get IA2Attributes -- IAccessible2 attributes;
426+ BSTR IA2Attributes;
427+ map<wstring,wstring> IA2AttribsMap;
428+ if (pacc->get_attributes (&IA2Attributes)==S_OK ) {
429+ IA2AttribsToMap (IA2Attributes,IA2AttribsMap);
430+ SysFreeString (IA2Attributes);
431+ // Add each IA2 attribute as an attrib.
432+ for (map<wstring,wstring>::const_iterator it=IA2AttribsMap.begin ();it!=IA2AttribsMap.end ();++it) {
433+ s<<L" IAccessible2::attribute_" <<it->first ;
434+ parentNode->addAttribute (s.str (),it->second );
435+ s.str (L" " );
436+ }
437+ } else
438+ LOG_DEBUG (L" pacc->get_attributes failed" );
439+ map<wstring,wstring>::const_iterator IA2AttribsMapIt;
440+
425441 // Get role -- IAccessible2 role
426442 long role=0 ;
427443 BSTR roleString=NULL ;
@@ -438,6 +454,15 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
438454 else if (varRole.vt ==VT_BSTR )
439455 roleString=varRole.bstrVal ;
440456 }
457+
458+ // Specifically force the role of ARIA treegrids from outline to table
459+ if (role == ROLE_SYSTEM_OUTLINE ) {
460+ const auto IA2AttribsMapIt = IA2AttribsMap.find (L" xml-roles" );
461+ if (IA2AttribsMapIt != IA2AttribsMap.end () && IA2AttribsMapIt->second .find (L" treegrid" ) != wstring::npos) {
462+ role = ROLE_SYSTEM_TABLE ;
463+ }
464+ }
465+
441466 // Add role as an attrib
442467 if (roleString)
443468 s<<roleString;
@@ -495,22 +520,6 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
495520 } else
496521 parentNode->addAttribute (L" keyboardShortcut" ,L" " );
497522
498- // get IA2Attributes -- IAccessible2 attributes;
499- BSTR IA2Attributes;
500- map<wstring,wstring> IA2AttribsMap;
501- if (pacc->get_attributes (&IA2Attributes)==S_OK ) {
502- IA2AttribsToMap (IA2Attributes,IA2AttribsMap);
503- SysFreeString (IA2Attributes);
504- // Add each IA2 attribute as an attrib.
505- for (map<wstring,wstring>::const_iterator it=IA2AttribsMap.begin ();it!=IA2AttribsMap.end ();++it) {
506- s<<L" IAccessible2::attribute_" <<it->first ;
507- parentNode->addAttribute (s.str (),it->second );
508- s.str (L" " );
509- }
510- } else
511- LOG_DEBUG (L" pacc->get_attributes failed" );
512- map<wstring,wstring>::const_iterator IA2AttribsMapIt;
513-
514523 // Check IA2Attributes, and or the role etc to work out if this object is a block element
515524 bool isBlockElement=TRUE ;
516525 if (IA2States&IA2_STATE_MULTI_LINE ) {
@@ -673,9 +682,10 @@ VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(
673682 } else {
674683 // If a node has children, it's visible.
675684 isVisible = width > 0 && height > 0 || childCount > 0 ;
676- if ((role == ROLE_SYSTEM_LIST && !(states & STATE_SYSTEM_READONLY ))
677- || role == ROLE_SYSTEM_OUTLINE
678- ) {
685+ // Only render the selected item for interactive lists.
686+ if (role == ROLE_SYSTEM_LIST && !(states & STATE_SYSTEM_READONLY )) {
687+ renderSelectedItemOnly = true ;
688+ } else if (role == ROLE_SYSTEM_OUTLINE ) {
679689 renderSelectedItemOnly = true ;
680690 }
681691 if (IA2TextIsUnneededSpace
0 commit comments