зеркало из https://github.com/mozilla/gecko-dev.git
bug 1162621 - proxy Accessible::IndexOfEmbeddedChild r=davidb
This is a bit dirty, we should be able to implement this just in the main process by looking at the role of the children. However doing it this way is simpler and allows us to share code with the non e10s case.
This commit is contained in:
Родитель
087aff8cbd
Коммит
291c2322bb
|
@ -855,6 +855,13 @@ getIndexInParentCB(AtkObject* aAtkObj)
|
||||||
{
|
{
|
||||||
// We don't use Accessible::IndexInParent() because we don't include text
|
// We don't use Accessible::IndexInParent() because we don't include text
|
||||||
// leaf nodes as children in ATK.
|
// leaf nodes as children in ATK.
|
||||||
|
if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
|
||||||
|
if (ProxyAccessible* parent = proxy->Parent())
|
||||||
|
return parent->IndexOfEmbeddedChild(proxy);
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
|
||||||
if (!accWrap) {
|
if (!accWrap) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -1618,6 +1618,22 @@ DocAccessibleChild::RecvTakeFocus(const uint64_t& aID)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
DocAccessibleChild::RecvIndexOfEmbeddedChild(const uint64_t& aID,
|
||||||
|
const uint64_t& aChildID,
|
||||||
|
uint32_t* aChildIdx)
|
||||||
|
{
|
||||||
|
*aChildIdx = 0;
|
||||||
|
|
||||||
|
Accessible* parent = IdToAccessible(aID);
|
||||||
|
Accessible* child = IdToAccessible(aChildID);
|
||||||
|
if (!parent || !child)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
*aChildIdx = parent->GetIndexOfEmbeddedChild(child);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
DocAccessibleChild::RecvChildAtPoint(const uint64_t& aID,
|
DocAccessibleChild::RecvChildAtPoint(const uint64_t& aID,
|
||||||
const int32_t& aX,
|
const int32_t& aX,
|
||||||
|
|
|
@ -393,6 +393,10 @@ public:
|
||||||
|
|
||||||
virtual bool RecvTakeFocus(const uint64_t& aID) override;
|
virtual bool RecvTakeFocus(const uint64_t& aID) override;
|
||||||
|
|
||||||
|
virtual bool RecvIndexOfEmbeddedChild(const uint64_t& aID,
|
||||||
|
const uint64_t& aChildID,
|
||||||
|
uint32_t* aChildIdx) override final;
|
||||||
|
|
||||||
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,
|
||||||
|
|
|
@ -211,6 +211,8 @@ child:
|
||||||
prio(high) sync Step(uint64_t aID) returns(double aStep);
|
prio(high) sync Step(uint64_t aID) returns(double aStep);
|
||||||
|
|
||||||
prio(high) sync TakeFocus(uint64_t aID);
|
prio(high) sync TakeFocus(uint64_t aID);
|
||||||
|
prio(high) sync IndexOfEmbeddedChild(uint64_t aID, uint64_t aChildID)
|
||||||
|
returns(uint32_t childIdx);
|
||||||
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);
|
||||||
|
|
|
@ -903,6 +903,15 @@ ProxyAccessible::TakeFocus()
|
||||||
unused << mDoc->SendTakeFocus(mID);
|
unused << mDoc->SendTakeFocus(mID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t
|
||||||
|
ProxyAccessible::IndexOfEmbeddedChild(const ProxyAccessible* aChild)
|
||||||
|
{
|
||||||
|
uint64_t childID = aChild->mID;
|
||||||
|
uint32_t childIdx;
|
||||||
|
unused << mDoc->SendIndexOfEmbeddedChild(mID, childID, &childIdx);
|
||||||
|
return childIdx;
|
||||||
|
}
|
||||||
|
|
||||||
ProxyAccessible*
|
ProxyAccessible*
|
||||||
ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY,
|
ProxyAccessible::ChildAtPoint(int32_t aX, int32_t aY,
|
||||||
Accessible::EWhichChildAtPoint aWhichChild)
|
Accessible::EWhichChildAtPoint aWhichChild)
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
|
|
||||||
// XXX evaluate if this is fast enough.
|
// XXX evaluate if this is fast enough.
|
||||||
size_t IndexInParent() const { return mParent->mChildren.IndexOf(this); }
|
size_t IndexInParent() const { return mParent->mChildren.IndexOf(this); }
|
||||||
|
int32_t IndexOfEmbeddedChild(const ProxyAccessible*);
|
||||||
bool MustPruneChildren() const;
|
bool MustPruneChildren() const;
|
||||||
|
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
Загрузка…
Ссылка в новой задаче