Bug 630180 - ###!!! ASSERTION: No parent accessible where we're not direct child of window: 'xpParentAcc', file .../msaa/nsAccessibleWrap.cpp, r=davidb, a=davidb

This commit is contained in:
Alexander Surkov 2011-02-22 21:54:46 +08:00
Родитель 954f979755
Коммит dd348a8ee2
3 изменённых файлов: 11 добавлений и 5 удалений

Просмотреть файл

@ -359,6 +359,8 @@ public:
//////////////////////////////////////////////////////////////////////////////
// Downcasting
inline bool IsApplication() const { return mFlags & eApplicationAccessible; }
inline bool IsHyperText() const { return mFlags & eHyperTextAccessible; }
nsHyperTextAccessible* AsHyperText();
@ -505,8 +507,9 @@ protected:
* @note keep these flags in sync with ChildrenFlags
*/
enum AccessibleTypes {
eHyperTextAccessible = 1 << 2,
eTextLeafAccessible = 1 << 3
eApplicationAccessible = 1 << 2,
eHyperTextAccessible = 1 << 3,
eTextLeafAccessible = 1 << 4
};
//////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -55,6 +55,7 @@
nsApplicationAccessible::nsApplicationAccessible() :
nsAccessibleWrap(nsnull, nsnull)
{
mFlags |= eApplicationAccessible;
}
////////////////////////////////////////////////////////////////////////////////

Просмотреть файл

@ -215,11 +215,13 @@ __try {
}
nsAccessible* xpParentAcc = GetParent();
NS_ASSERTION(xpParentAcc,
"No parent accessible where we're not direct child of window");
if (!xpParentAcc) {
if (IsApplication())
return S_OK;
if (!xpParentAcc)
NS_ERROR("No parent accessible. Should we really assert here?");
return E_UNEXPECTED;
}
*ppdispParent = NativeAccessible(xpParentAcc);