mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 10:33:33 +00:00
bug 1219528 - add ProxyAccessible::{Next,Prev}Sibling() and ProxyAccessible::{First,Last}Child() r=davidb
This commit is contained in:
parent
5c2750f5a6
commit
e9c2a868bb
@ -46,6 +46,21 @@ public:
|
||||
|
||||
uint32_t ChildrenCount() const { return mChildren.Length(); }
|
||||
ProxyAccessible* ChildAt(uint32_t aIdx) const { return mChildren[aIdx]; }
|
||||
ProxyAccessible* FirstChild() const
|
||||
{ return mChildren.Length() ? mChildren[0] : nullptr; }
|
||||
ProxyAccessible* LastChild() const
|
||||
{ return mChildren.Length() ? mChildren[mChildren.Length() - 1] : nullptr; }
|
||||
ProxyAccessible* PrevSibling() const
|
||||
{
|
||||
size_t idx = IndexInParent();
|
||||
return idx > 0 ? Parent()->mChildren[idx - 1] : nullptr;
|
||||
}
|
||||
ProxyAccessible* NextSibling() const
|
||||
{
|
||||
size_t idx = IndexInParent();
|
||||
return idx < Parent()->mChildren.Length() ? Parent()->mChildren[idx + 1]
|
||||
: nullptr;
|
||||
}
|
||||
|
||||
// XXX evaluate if this is fast enough.
|
||||
size_t IndexInParent() const { return Parent()->mChildren.IndexOf(this); }
|
||||
|
Loading…
Reference in New Issue
Block a user