DEBUG_MSG(L"IAccessibleTable::get_rowColumnExtentsAtIndex failed, result " << res);\r
}\r
\r
-inline void fillTableCellInfo_IATable2(VBufStorage_controlFieldNode_t* node, IAccessibleTableCell* paccTableCell) {\r
+inline void GeckoVBufBackend_t::fillTableCellInfo_IATable2(VBufStorage_controlFieldNode_t* node, IAccessibleTableCell* paccTableCell) {\r
int res;\r
wostringstream s;\r
\r
}\r
}\r
\r
+ if (this->shouldDisableTableHeaders)\r
+ return;\r
+\r
IUnknown** headerCells;\r
long nHeaderCells;\r
IAccessible2* headerCellPacc = NULL;\r
}\r
}\r
\r
-VBufStorage_fieldNode_t* fillVBuf(IAccessible2* pacc, VBufStorage_buffer_t* buffer, VBufStorage_controlFieldNode_t* parentNode, VBufStorage_fieldNode_t* previousNode, IAccessibleTable* paccTable=NULL, IAccessibleTable2* paccTable2=NULL, long tableID=0) {\r
+void GeckoVBufBackend_t::versionSpecificInit(IAccessible2* pacc) {\r
+ IServiceProvider* serv = NULL;\r
+ if (pacc->QueryInterface(IID_IServiceProvider, (void**)&serv) != S_OK)\r
+ return;\r
+ IAccessibleApplication* iaApp = NULL;\r
+ if (serv->QueryService(IID_IAccessibleApplication, IID_IAccessibleApplication, (void**)&iaApp) != S_OK) {\r
+ serv->Release();\r
+ return;\r
+ }\r
+ serv->Release();\r
+ serv = NULL;\r
+\r
+ BSTR toolkitName = NULL;\r
+ if (iaApp->get_toolkitName(&toolkitName) != S_OK) {\r
+ iaApp->Release();\r
+ return;\r
+ }\r
+ BSTR toolkitVersion = NULL;\r
+ if (iaApp->get_toolkitVersion(&toolkitVersion) != S_OK) {\r
+ iaApp->Release();\r
+ SysFreeString(toolkitName);\r
+ return;\r
+ }\r
+ iaApp->Release();\r
+ iaApp = NULL;\r
+\r
+ if (wcscmp(toolkitName, L"Gecko") == 0) {\r
+ // Gecko <= 1.9.2.9 will crash if we try to retrieve headers on some table cells, so disable them.\r
+ UINT toolkitVersionLen = SysStringLen(toolkitVersion);\r
+ this->shouldDisableTableHeaders = (toolkitVersionLen >= 7 &&\r
+ wcsncmp(toolkitVersion, L"1.9.2.", 6) == 0 &&\r
+ // If there is another digit after 1.9.2.n, this is >= 1.9.2.10.\r
+ (toolkitVersionLen <= 7 || !iswdigit(toolkitVersion[7]))\r
+ );\r
+ }\r
+\r
+ SysFreeString(toolkitName);\r
+ SysFreeString(toolkitVersion);\r
+}\r
+\r
+VBufStorage_fieldNode_t* GeckoVBufBackend_t::fillVBuf(IAccessible2* pacc, VBufStorage_buffer_t* buffer, VBufStorage_controlFieldNode_t* parentNode, VBufStorage_fieldNode_t* previousNode, IAccessibleTable* paccTable, IAccessibleTable2* paccTable2, long tableID) {\r
int res;\r
DEBUG_MSG(L"Entered fillVBuf, with pacc at "<<pacc<<L", parentNode at "<<parentNode<<L", previousNode "<<previousNode);\r
assert(buffer); //buffer can't be NULL\r
parentNode->addAttribute(L"table-id", s.str());\r
if (res == S_OK) {\r
// IAccessibleTable2\r
- fillTableCellInfo_IATable2(parentNode, paccTableCell);\r
+ this->fillTableCellInfo_IATable2(parentNode, paccTableCell);\r
paccTableCell->Release();\r
paccTableCell = NULL;\r
} else // IAccessibleTable\r
if(childDefaction) SysFreeString(childDefaction);\r
#endif\r
DEBUG_MSG(L"calling fillVBuf with childPacc ");\r
- if((tempNode=fillVBuf(childPacc,buffer,parentNode,previousNode,paccTable,paccTable2,tableID))!=NULL) {\r
+ if((tempNode=this->fillVBuf(childPacc,buffer,parentNode,previousNode,paccTable,paccTable2,tableID))!=NULL) {\r
previousNode=tempNode;\r
} else {\r
DEBUG_MSG(L"Error in fillVBuf");\r
}\r
if(childPacc) {\r
DEBUG_MSG(L"calling _filVBufHelper with child object ");\r
- if((tempNode=fillVBuf(childPacc,buffer,parentNode,previousNode,paccTable,paccTable2,tableID))!=NULL) {\r
+ if((tempNode=this->fillVBuf(childPacc,buffer,parentNode,previousNode,paccTable,paccTable2,tableID))!=NULL) {\r
previousNode=tempNode;\r
} else {\r
DEBUG_MSG(L"Error in calling fillVBuf");\r
DEBUG_MSG(L"Could not get IAccessible2, returning");\r
return;\r
}\r
+ if (!oldNode) {\r
+ // This is the root node.\r
+ this->versionSpecificInit(pacc);\r
+ }\r
DEBUG_MSG(L"Calling fillVBuf");\r
- fillVBuf(pacc, buffer, NULL, NULL);\r
+ this->fillVBuf(pacc, buffer, NULL, NULL);\r
pacc->Release();\r
DEBUG_MSG(L"Rendering done");\r
}\r