bug 1107337 - support downcasting Accessible to OuterDocAccessible r=lsocks, davidb

This commit is contained in:
Trevor Saunders 2015-06-02 16:30:28 -04:00
parent 0c57a2bf4a
commit 49c7254fe8
3 changed files with 10 additions and 0 deletions

View File

@ -38,6 +38,7 @@ class HTMLLIAccessible;
class HyperTextAccessible;
class ImageAccessible;
class KeyBinding;
class OuterDocAccessible;
class ProxyAccessible;
class Relation;
class RootAccessible;
@ -619,6 +620,9 @@ public:
return mBits.proxy;
}
bool IsOuterDoc() const { return mType == eOuterDocType; }
OuterDocAccessible* AsOuterDoc();
bool IsProgress() const { return mType == eProgressType; }
bool IsRoot() const { return mType == eRootType; }

View File

@ -26,6 +26,7 @@ OuterDocAccessible::
OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc) :
AccessibleWrap(aContent, aDoc)
{
mType = eOuterDocType;
}
OuterDocAccessible::~OuterDocAccessible()

View File

@ -44,6 +44,11 @@ protected:
virtual void CacheChildren() override;
};
inline OuterDocAccessible*
Accessible::AsOuterDoc()
{
return IsOuterDoc() ? static_cast<OuterDocAccessible*>(this) : nullptr;
}
} // namespace a11y
} // namespace mozilla