bug 1196460 - add method to get wrapper of proxy for document containing this proxied accessible r=surkov

This commit is contained in:
Trevor Saunders 2015-08-11 15:57:58 -04:00
parent 83f4e2a702
commit 06230447cd
2 changed files with 24 additions and 0 deletions

View File

@ -9,12 +9,14 @@
#include "Compatibility.h"
#include "DocAccessible-inl.h"
#include "mozilla/a11y/DocAccessibleParent.h"
#include "EnumVariant.h"
#include "nsAccUtils.h"
#include "nsCoreUtils.h"
#include "nsIAccessibleEvent.h"
#include "nsWinUtils.h"
#include "mozilla/a11y/ProxyAccessible.h"
#include "ProxyWrappers.h"
#include "ServiceProvider.h"
#include "Relation.h"
#include "Role.h"
@ -1274,6 +1276,22 @@ AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
return NS_OK;
}
DocProxyAccessibleWrap*
AccessibleWrap::DocProxyWrapper() const
{
MOZ_ASSERT(IsProxy());
ProxyAccessible* proxy = Proxy();
if (!proxy) {
return nullptr;
}
AccessibleWrap* acc = WrapperFor(proxy->Document());
MOZ_ASSERT(acc->IsDoc());
return static_cast<DocProxyAccessibleWrap*>(acc);
}
////////////////////////////////////////////////////////////////////////////////
// AccessibleWrap

View File

@ -26,6 +26,7 @@
namespace mozilla {
namespace a11y {
class DocProxyAccessibleWrap;
class AccessibleWrap : public Accessible,
public ia2Accessible,
@ -183,6 +184,11 @@ protected:
uint32_t mID;
#endif
/**
* Return the wrapper for the document's proxy.
*/
DocProxyAccessibleWrap* DocProxyWrapper() const;
/**
* Creates ITypeInfo for LIBID_Accessibility if it's needed and returns it.
*/