mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
bug 1195471 - make getChildCountCB work with proxies r=davidb
This commit is contained in:
parent
88fa41bffd
commit
dcf750da4b
@ -822,12 +822,20 @@ getParentCB(AtkObject *aAtkObj)
|
||||
gint
|
||||
getChildCountCB(AtkObject *aAtkObj)
|
||||
{
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||
if (!accWrap || nsAccUtils::MustPrune(accWrap)) {
|
||||
return 0;
|
||||
if (AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj)) {
|
||||
if (nsAccUtils::MustPrune(accWrap)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return static_cast<gint>(accWrap->EmbeddedChildCount());
|
||||
}
|
||||
|
||||
ProxyAccessible* proxy = GetProxy(aAtkObj);
|
||||
if (proxy && !proxy->MustPruneChildren()) {
|
||||
return proxy->EmbeddedChildCount();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
AtkObject *
|
||||
|
@ -1727,6 +1727,22 @@ DocAccessibleChild::RecvTakeFocus(const uint64_t& aID)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DocAccessibleChild::RecvEmbeddedChildCount(const uint64_t& aID,
|
||||
uint32_t* aCount)
|
||||
{
|
||||
*aCount = 0;
|
||||
|
||||
Accessible* acc = IdToAccessible(aID);
|
||||
if (!acc) {
|
||||
return true;
|
||||
}
|
||||
|
||||
*aCount = acc->EmbeddedChildCount();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
DocAccessibleChild::RecvIndexOfEmbeddedChild(const uint64_t& aID,
|
||||
const uint64_t& aChildID,
|
||||
|
@ -434,6 +434,9 @@ public:
|
||||
|
||||
virtual bool RecvTakeFocus(const uint64_t& aID) override;
|
||||
|
||||
virtual bool RecvEmbeddedChildCount(const uint64_t& aID, uint32_t* aCount)
|
||||
override final;
|
||||
|
||||
virtual bool RecvIndexOfEmbeddedChild(const uint64_t& aID,
|
||||
const uint64_t& aChildID,
|
||||
uint32_t* aChildIdx) override final;
|
||||
|
@ -226,6 +226,7 @@ child:
|
||||
prio(high) sync Step(uint64_t aID) returns(double aStep);
|
||||
|
||||
prio(high) sync TakeFocus(uint64_t aID);
|
||||
prio(high) sync EmbeddedChildCount(uint64_t aID) returns(uint32_t aCount);
|
||||
prio(high) sync IndexOfEmbeddedChild(uint64_t aID, uint64_t aChildID)
|
||||
returns(uint32_t childIdx);
|
||||
prio(high) sync EmbeddedChildAt(uint64_t aID, uint32_t aChildIdx)
|
||||
|
@ -979,6 +979,14 @@ ProxyAccessible::TakeFocus()
|
||||
unused << mDoc->SendTakeFocus(mID);
|
||||
}
|
||||
|
||||
uint32_t
|
||||
ProxyAccessible::EmbeddedChildCount() const
|
||||
{
|
||||
uint32_t count;
|
||||
unused << mDoc->SendEmbeddedChildCount(mID, &count);
|
||||
return count;
|
||||
}
|
||||
|
||||
int32_t
|
||||
ProxyAccessible::IndexOfEmbeddedChild(const ProxyAccessible* aChild)
|
||||
{
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
|
||||
// XXX evaluate if this is fast enough.
|
||||
size_t IndexInParent() const { return Parent()->mChildren.IndexOf(this); }
|
||||
uint32_t EmbeddedChildCount() const;
|
||||
int32_t IndexOfEmbeddedChild(const ProxyAccessible*);
|
||||
ProxyAccessible* EmbeddedChildAt(size_t aChildIdx);
|
||||
bool MustPruneChildren() const;
|
||||
|
Loading…
Reference in New Issue
Block a user