Bug 1171995 - Part 1: Add FocusedChild to proxy accessibles r=tbsaunde

This commit is contained in:
Lorien Hu 2015-07-16 17:34:51 -04:00
parent e32873b594
commit 5e32e582c2
5 changed files with 34 additions and 0 deletions

View File

@ -1652,6 +1652,24 @@ DocAccessibleChild::RecvEmbeddedChildAt(const uint64_t& aID,
return true; return true;
} }
bool
DocAccessibleChild::RecvFocusedChild(const uint64_t& aID,
uint64_t* aChild,
bool* aOk)
{
*aChild = 0;
*aOk = false;
Accessible* acc = IdToAccessible(aID);
if (acc) {
Accessible* child = acc->FocusedChild();
if (child) {
*aChild = reinterpret_cast<uint64_t>(child->UniqueID());
*aOk = true;
}
}
return true;
}
bool bool
DocAccessibleChild::RecvChildAtPoint(const uint64_t& aID, DocAccessibleChild::RecvChildAtPoint(const uint64_t& aID,
const int32_t& aX, const int32_t& aX,

View File

@ -411,6 +411,10 @@ public:
virtual bool RecvEmbeddedChildAt(const uint64_t& aID, const uint32_t& aIdx, virtual bool RecvEmbeddedChildAt(const uint64_t& aID, const uint32_t& aIdx,
uint64_t* aChildID) override final; uint64_t* aChildID) override final;
virtual bool RecvFocusedChild(const uint64_t& aID,
uint64_t* aChild,
bool* aOk) override;
virtual bool RecvChildAtPoint(const uint64_t& aID, virtual bool RecvChildAtPoint(const uint64_t& aID,
const int32_t& aX, const int32_t& aX,
const int32_t& aY, const int32_t& aY,

View File

@ -222,6 +222,8 @@ child:
returns(uint32_t childIdx); returns(uint32_t childIdx);
prio(high) sync EmbeddedChildAt(uint64_t aID, uint32_t aChildIdx) prio(high) sync EmbeddedChildAt(uint64_t aID, uint32_t aChildIdx)
returns(uint64_t aChild); returns(uint64_t aChild);
prio(high) sync FocusedChild(uint64_t aID)
returns(uint64_t aChild, bool aOk);
prio(high) sync ChildAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aWhich) prio(high) sync ChildAtPoint(uint64_t aID, int32_t aX, int32_t aY, uint32_t aWhich)
returns(uint64_t aChild, bool aOk); returns(uint64_t aChild, bool aOk);
prio(high) sync Bounds(uint64_t aID) returns(nsIntRect aRect); prio(high) sync Bounds(uint64_t aID) returns(nsIntRect aRect);

View File

@ -924,6 +924,15 @@ ProxyAccessible::EmbeddedChildAt(size_t aChildIdx)
return mDoc->GetAccessible(childID); return mDoc->GetAccessible(childID);
} }
ProxyAccessible*
ProxyAccessible::FocusedChild()
{
uint64_t childID = 0;
bool ok = false;
unused << mDoc->SendFocusedChild(mID, &childID, &ok);
return ok ? mDoc->GetAccessible(childID) : nullptr;
}
ProxyAccessible* ProxyAccessible*
ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY, ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY,
Accessible::EWhichChildAtPoint aWhichChild) Accessible::EWhichChildAtPoint aWhichChild)

View File

@ -277,6 +277,7 @@ public:
double Step(); double Step();
void TakeFocus(); void TakeFocus();
ProxyAccessible* FocusedChild();
ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY, ProxyAccessible* ChildAtPoint(int32_t aX, int32_t aY,
Accessible::EWhichChildAtPoint aWhichChild); Accessible::EWhichChildAtPoint aWhichChild);
nsIntRect Bounds(); nsIntRect Bounds();