зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1760939 part 1: Move EmbeddedChildCount to Accessible. r=eeejay
Differential Revision: https://phabricator.services.mozilla.com/D142027
This commit is contained in:
Родитель
57ea3e3fe6
Коммит
709573652e
|
@ -692,28 +692,11 @@ AtkObject* getParentCB(AtkObject* aAtkObj) {
|
|||
}
|
||||
|
||||
gint getChildCountCB(AtkObject* aAtkObj) {
|
||||
if (AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj)) {
|
||||
if (nsAccUtils::MustPrune(accWrap)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32_t count = accWrap->EmbeddedChildCount();
|
||||
if (count) {
|
||||
return static_cast<gint>(count);
|
||||
}
|
||||
|
||||
OuterDocAccessible* outerDoc = accWrap->AsOuterDoc();
|
||||
if (outerDoc && outerDoc->RemoteChildDoc()) {
|
||||
return 1;
|
||||
}
|
||||
Accessible* acc = GetInternalObj(aAtkObj);
|
||||
if (!acc || nsAccUtils::MustPrune(acc)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
RemoteAccessible* proxy = GetProxy(aAtkObj);
|
||||
if (proxy && !nsAccUtils::MustPrune(proxy)) {
|
||||
return proxy->EmbeddedChildCount();
|
||||
}
|
||||
|
||||
return 0;
|
||||
return static_cast<gint>(acc->EmbeddedChildCount());
|
||||
}
|
||||
|
||||
AtkObject* refChildCB(AtkObject* aAtkObj, gint aChildIndex) {
|
||||
|
|
|
@ -155,6 +155,11 @@ class Accessible {
|
|||
*/
|
||||
virtual GroupPos GroupPosition();
|
||||
|
||||
/**
|
||||
* Return embedded accessible children count.
|
||||
*/
|
||||
virtual uint32_t EmbeddedChildCount() = 0;
|
||||
|
||||
/**
|
||||
* Return embedded accessible child at the given index.
|
||||
*/
|
||||
|
|
|
@ -361,10 +361,7 @@ class LocalAccessible : public nsISupports, public Accessible {
|
|||
return childCount != 0 ? LocalChildAt(childCount - 1) : nullptr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return embedded accessible children count.
|
||||
*/
|
||||
uint32_t EmbeddedChildCount();
|
||||
virtual uint32_t EmbeddedChildCount() override;
|
||||
|
||||
/**
|
||||
* Return embedded accessible child at the given index.
|
||||
|
|
|
@ -94,7 +94,7 @@ void RemoteAccessibleBase<Derived>::ClearChildDoc(
|
|||
}
|
||||
|
||||
template <class Derived>
|
||||
uint32_t RemoteAccessibleBase<Derived>::EmbeddedChildCount() const {
|
||||
uint32_t RemoteAccessibleBase<Derived>::EmbeddedChildCount() {
|
||||
size_t count = 0, kids = mChildren.Length();
|
||||
for (size_t i = 0; i < kids; i++) {
|
||||
if (mChildren[i]->IsEmbeddedObject()) {
|
||||
|
|
|
@ -102,7 +102,7 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
|
|||
}
|
||||
return parent->mChildren.IndexOf(static_cast<const Derived*>(this));
|
||||
}
|
||||
uint32_t EmbeddedChildCount() const;
|
||||
virtual uint32_t EmbeddedChildCount() override;
|
||||
virtual int32_t IndexOfEmbeddedChild(Accessible* aChild) override;
|
||||
virtual Accessible* EmbeddedChildAt(uint32_t aChildIdx) override;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче