author | Eitan Isaacson <eitan@monotonous.org> |
Tue, 16 Feb 2021 20:05:10 +0000 | |
changeset 567732 | 98c963608de22f101191240f0675fbad03fa6f1b |
parent 567731 | 9e3376ccd1da2b2b065b121e05dd77ffdcf862a6 |
child 567733 | 087afb1d87d892535da910c627d9bae42c8d8fae |
push id | 38210 |
push user | nerli@mozilla.com |
push date | Wed, 17 Feb 2021 09:45:59 +0000 |
treeherder | mozilla-central@3d42785f84cb [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | Jamie |
bugs | 1692523 |
milestone | 87.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/accessible/android/AccessibleWrap.cpp +++ b/accessible/android/AccessibleWrap.cpp @@ -362,17 +362,17 @@ void AccessibleWrap::NavigateText(int32_ newAnchor = pivot.NextText(this, &start, &end, pivotGranularity); newOffset = end; } else { newAnchor = pivot.PrevText(this, &start, &end, pivotGranularity); newOffset = start; } if (newAnchor && (start != aStartOffset || end != aEndOffset)) { - if (IsTextLeaf() && newAnchor == Parent()) { + if (IsTextLeaf() && newAnchor == LocalParent()) { // For paragraphs, divs, spans, etc., we put a11y focus on the text leaf // node instead of the HyperTextAccessible. However, Pivot will always // return a HyperTextAccessible. Android doesn't support text navigation // landing on an accessible which is different to the originating // accessible. Therefore, if we're still within the same text leaf, // translate the offsets to the text leaf. int32_t thisChild = IndexInParent(); HyperTextAccessible* newHyper = newAnchor->AsHyperText(); @@ -851,17 +851,17 @@ mozilla::java::GeckoBundle::LocalRef Acc } bool mustPrune = IsProxy() ? nsAccUtils::MustPrune(Proxy()) : nsAccUtils::MustPrune(this); if (!mustPrune) { auto childCount = ChildCount(); nsTArray<int32_t> children(childCount); for (uint32_t i = 0; i < childCount; i++) { - auto child = static_cast<AccessibleWrap*>(GetChildAt(i)); + auto child = static_cast<AccessibleWrap*>(LocalChildAt(i)); children.AppendElement(child->VirtualViewID()); } GECKOBUNDLE_PUT(nodeInfo, "children", jni::IntArray::New(children.Elements(), children.Length())); } GECKOBUNDLE_FINISH(nodeInfo); @@ -909,17 +909,17 @@ bool AccessibleWrap::HandleLiveRegionEve nsString atomic; rv = attributes->GetStringProperty("container-atomic"_ns, atomic); Accessible* announcementTarget = this; nsAutoString announcement; if (atomic.EqualsIgnoreCase("true")) { Accessible* atomicAncestor = nullptr; for (Accessible* parent = announcementTarget; parent; - parent = parent->Parent()) { + parent = parent->LocalParent()) { dom::Element* element = parent->Elm(); if (element && element->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_atomic, nsGkAtoms::_true, eCaseMatters)) { atomicAncestor = parent; break; } }
--- a/accessible/android/AccessibleWrap.h +++ b/accessible/android/AccessibleWrap.h @@ -85,17 +85,17 @@ class AccessibleWrap : public Accessible static int32_t GetAndroidClass(role aRole); static int32_t GetInputType(const nsString& aInputTypeAttr); int32_t mID; private: virtual AccessibleWrap* WrapperParent() { - return static_cast<AccessibleWrap*>(Parent()); + return static_cast<AccessibleWrap*>(LocalParent()); } virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal, double* aMaxVal, double* aStep); virtual role WrapperRole() { return Role(); } void GetTextEquiv(nsString& aText);
--- a/accessible/android/DocAccessibleWrap.cpp +++ b/accessible/android/DocAccessibleWrap.cpp @@ -110,18 +110,18 @@ void DocAccessibleWrap::CacheViewportCal continue; } Accessible* visibleAcc = docAcc->GetAccessibleOrContainer(content); if (!visibleAcc) { continue; } - for (Accessible* acc = visibleAcc; acc && acc != docAcc->Parent(); - acc = acc->Parent()) { + for (Accessible* acc = visibleAcc; acc && acc != docAcc->LocalParent(); + acc = acc->LocalParent()) { if (inViewAccs.Contains(acc->UniqueID())) { break; } inViewAccs.Put(acc->UniqueID(), RefPtr{acc}); } } if (IPCAccessibilityActive()) { @@ -217,18 +217,18 @@ DocAccessibleWrap* DocAccessibleWrap::Ge return doc; } void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) { mFocusPath.Clear(); if (IPCAccessibilityActive()) { DocAccessibleChild* ipcDoc = IPCDoc(); nsTArray<BatchData> cacheData; - for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent(); - acc = static_cast<AccessibleWrap*>(acc->Parent())) { + for (AccessibleWrap* acc = aAccessible; acc && acc != this->LocalParent(); + acc = static_cast<AccessibleWrap*>(acc->LocalParent())) { nsAutoString name; acc->Name(name); nsAutoString textValue; acc->Value(textValue); nsAutoString nodeID; acc->WrapperDOMNodeID(nodeID); nsAutoString description; acc->Description(description); @@ -242,18 +242,18 @@ void DocAccessibleWrap::CacheFocusPath(A acc->MaxValue(), acc->Step(), attributes)); mFocusPath.Put(acc->UniqueID(), RefPtr{acc}); } ipcDoc->SendBatch(eBatch_FocusPath, cacheData); } else if (RefPtr<SessionAccessibility> sessionAcc = SessionAccessibility::GetInstanceFor(this)) { nsTArray<AccessibleWrap*> accessibles; - for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent(); - acc = static_cast<AccessibleWrap*>(acc->Parent())) { + for (AccessibleWrap* acc = aAccessible; acc && acc != this->LocalParent(); + acc = static_cast<AccessibleWrap*>(acc->LocalParent())) { accessibles.AppendElement(acc); mFocusPath.Put(acc->UniqueID(), RefPtr{acc}); } sessionAcc->ReplaceFocusPathCache(accessibles); } }
--- a/accessible/android/ProxyAccessibleWrap.cpp +++ b/accessible/android/ProxyAccessibleWrap.cpp @@ -57,18 +57,18 @@ already_AddRefed<nsIPersistentProperties Proxy()->Attributes(&attrs); return AttributeArrayToProperties(attrs); } uint32_t ProxyAccessibleWrap::ChildCount() const { return Proxy()->ChildrenCount(); } -Accessible* ProxyAccessibleWrap::GetChildAt(uint32_t aIndex) const { - ProxyAccessible* child = Proxy()->ChildAt(aIndex); +ProxyAccessible* child = Proxy()->ChildAt(aIndex); +Accessible* ProxyAccessibleWrap::LocalChildAt(uint32_t aIndex) const { return child ? WrapperFor(child) : nullptr; } ENameValueFlag ProxyAccessibleWrap::Name(nsString& aName) const { Proxy()->Name(aName); return eNameOK; }
--- a/accessible/android/ProxyAccessibleWrap.h +++ b/accessible/android/ProxyAccessibleWrap.h @@ -28,17 +28,17 @@ class ProxyAccessibleWrap : public Acces virtual void Shutdown() override; // Accessible virtual already_AddRefed<nsIPersistentProperties> Attributes() override; virtual uint32_t ChildCount() const override; - virtual Accessible* GetChildAt(uint32_t aIndex) const override; + virtual Accessible* LocalChildAt(uint32_t aIndex) const override; virtual ENameValueFlag Name(nsString& aName) const override; virtual void Value(nsString& aValue) const override; virtual uint64_t State() override; virtual nsIntRect Bounds() const override;
--- a/accessible/android/TraversalRule.cpp +++ b/accessible/android/TraversalRule.cpp @@ -74,45 +74,45 @@ uint16_t TraversalRule::Match(const Acce bool TraversalRule::IsSingleLineage(Accessible* aAccessible) { Accessible* child = aAccessible; while (child) { switch (child->ChildCount()) { case 0: return true; case 1: - child = child->FirstChild(); + child = child->LocalFirstChild(); break; case 2: if (Accessible* bullet = - child->Parent()->IsHTMLListItem() - ? child->Parent()->AsHTMLListItem()->Bullet() + child->LocalParent()->IsHTMLListItem() + ? child->LocalParent()->AsHTMLListItem()->Bullet() : nullptr) { - child = bullet->NextSibling(); + child = bullet->LocalNextSibling(); } else { return false; } break; default: return false; } } return true; } bool TraversalRule::IsListItemBullet(const Accessible* aAccessible) { - Accessible* parent = aAccessible->Parent(); + Accessible* parent = aAccessible->LocalParent(); return parent && parent->IsHTMLListItem() && parent->AsHTMLListItem()->Bullet() == aAccessible; } bool TraversalRule::IsFlatSubtree(const Accessible* aAccessible) { - for (auto child = aAccessible->FirstChild(); child; - child = child->NextSibling()) { + for (auto child = aAccessible->LocalFirstChild(); child; + child = child->LocalNextSibling()) { roles::Role role = child->Role(); if (role == roles::TEXT_LEAF || role == roles::STATICTEXT) { continue; } if (child->ChildCount() > 0 || child->ActionCount() > 0) { return false; }
--- a/accessible/atk/AccessibleWrap.cpp +++ b/accessible/atk/AccessibleWrap.cpp @@ -807,17 +807,17 @@ gint getIndexInParentCB(AtkObject* aAtkO return -1; } AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj); if (!accWrap) { return -1; } - Accessible* parent = accWrap->Parent(); + Accessible* parent = accWrap->LocalParent(); if (!parent) return -1; // No parent return parent->GetIndexOfEmbeddedChild(accWrap); } static void TranslateStates(uint64_t aState, roles::Role aRole, AtkStateSet* aStateSet) { // atk doesn't have a read only state so read only things shouldn't be @@ -1216,34 +1216,36 @@ nsresult AccessibleWrap::HandleAccEvent( break; case nsIAccessibleEvent::EVENT_SECTION_CHANGED: g_signal_emit_by_name(atkObj, "visible_data_changed"); break; case nsIAccessibleEvent::EVENT_SHOW: { AccMutationEvent* event = downcast_accEvent(aEvent); - Accessible* parentAcc = event ? event->Parent() : accessible->Parent(); + Accessible* parentAcc = + event ? event->LocalParent() : accessible->LocalParent(); AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc); NS_ENSURE_STATE(parent); auto obj = reinterpret_cast<MaiAtkObject*>(atkObj); obj->FireAtkShowHideEvent(parent, true, aEvent->IsFromUserInput()); return NS_OK; } case nsIAccessibleEvent::EVENT_HIDE: { // XXX - Handle native dialog accessibles. if (!accessible->IsRoot() && accessible->HasARIARole() && accessible->ARIARole() == roles::DIALOG) { guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT); g_signal_emit(atkObj, id, 0); } AccMutationEvent* event = downcast_accEvent(aEvent); - Accessible* parentAcc = event ? event->Parent() : accessible->Parent(); + Accessible* parentAcc = + event ? event->LocalParent() : accessible->LocalParent(); AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc); NS_ENSURE_STATE(parent); auto obj = reinterpret_cast<MaiAtkObject*>(atkObj); obj->FireAtkShowHideEvent(parent, false, aEvent->IsFromUserInput()); return NS_OK; } /* @@ -1480,33 +1482,34 @@ void AccessibleWrap::GetKeyBinding(Acces // Return all key bindings including access key and keyboard shortcut. // Get access key. nsAutoString keyBindingsStr; KeyBinding keyBinding = aAccessible->AccessKey(); if (!keyBinding.IsEmpty()) { keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat); - Accessible* parent = aAccessible->Parent(); + Accessible* parent = aAccessible->LocalParent(); roles::Role role = parent ? parent->Role() : roles::NOTHING; if (role == roles::PARENT_MENUITEM || role == roles::MENUITEM || role == roles::RADIO_MENU_ITEM || role == roles::CHECK_MENU_ITEM) { // It is submenu, expose keyboard shortcuts from menu hierarchy like // "s;<Alt>f:s" nsAutoString keysInHierarchyStr = keyBindingsStr; do { KeyBinding parentKeyBinding = parent->AccessKey(); if (!parentKeyBinding.IsEmpty()) { nsAutoString str; parentKeyBinding.ToString(str, KeyBinding::eAtkFormat); str.Append(':'); keysInHierarchyStr.Insert(str, 0); } - } while ((parent = parent->Parent()) && parent->Role() != roles::MENUBAR); + } while ((parent = parent->LocalParent()) && + parent->Role() != roles::MENUBAR); keyBindingsStr.Append(';'); keyBindingsStr.Append(keysInHierarchyStr); } } else { // No access key, add ';' to point this. keyBindingsStr.Append(';'); }
--- a/accessible/base/AccEvent.cpp +++ b/accessible/base/AccEvent.cpp @@ -99,18 +99,18 @@ AccTextChangeEvent::AccTextChangeEvent(A //////////////////////////////////////////////////////////////////////////////// // AccHideEvent //////////////////////////////////////////////////////////////////////////////// AccHideEvent::AccHideEvent(Accessible* aTarget, bool aNeedsShutdown) : AccMutationEvent(::nsIAccessibleEvent::EVENT_HIDE, aTarget), mNeedsShutdown(aNeedsShutdown) { - mNextSibling = mAccessible->NextSibling(); - mPrevSibling = mAccessible->PrevSibling(); + mNextSibling = mAccessible->LocalNextSibling(); + mPrevSibling = mAccessible->LocalPrevSibling(); } //////////////////////////////////////////////////////////////////////////////// // AccShowEvent //////////////////////////////////////////////////////////////////////////////// AccShowEvent::AccShowEvent(Accessible* aTarget) : AccMutationEvent(::nsIAccessibleEvent::EVENT_SHOW, aTarget) {
--- a/accessible/base/AccEvent.h +++ b/accessible/base/AccEvent.h @@ -238,31 +238,31 @@ class AccTreeMutationEvent : public AccE * Base class for show and hide accessible events. */ class AccMutationEvent : public AccTreeMutationEvent { public: AccMutationEvent(uint32_t aEventType, Accessible* aTarget) : AccTreeMutationEvent(aEventType, aTarget) { // Don't coalesce these since they are coalesced by reorder event. Coalesce // contained text change events. - mParent = mAccessible->Parent(); + mParent = mAccessible->LocalParent(); } virtual ~AccMutationEvent() {} // Event static const EventGroup kEventGroup = eMutationEvent; virtual unsigned int GetEventGroups() const override { return AccTreeMutationEvent::GetEventGroups() | (1U << eMutationEvent); } // MutationEvent bool IsShow() const { return mEventType == nsIAccessibleEvent::EVENT_SHOW; } bool IsHide() const { return mEventType == nsIAccessibleEvent::EVENT_HIDE; } - Accessible* Parent() const { return mParent; } + Accessible* LocalParent() const { return mParent; } protected: nsCOMPtr<nsINode> mNode; RefPtr<Accessible> mParent; RefPtr<AccTextChangeEvent> mTextChangeEvent; friend class EventTree; friend class NotificationController;
--- a/accessible/base/AccGroupInfo.cpp +++ b/accessible/base/AccGroupInfo.cpp @@ -15,33 +15,33 @@ AccGroupInfo::AccGroupInfo(const Accessi : mPosInSet(0), mSetSize(0), mParent(nullptr), mItem(aItem), mRole(aRole) { MOZ_COUNT_CTOR(AccGroupInfo); Update(); } void AccGroupInfo::Update() { mParent = nullptr; - Accessible* parent = mItem->Parent(); + Accessible* parent = mItem->LocalParent(); if (!parent) return; int32_t indexInParent = mItem->IndexInParent(); uint32_t siblingCount = parent->ChildCount(); if (indexInParent == -1 || indexInParent >= static_cast<int32_t>(siblingCount)) { NS_ERROR("Wrong index in parent! Tree invalidation problem."); return; } int32_t level = nsAccUtils::GetARIAOrDefaultLevel(mItem); // Compute position in set. mPosInSet = 1; for (int32_t idx = indexInParent - 1; idx >= 0; idx--) { - Accessible* sibling = parent->GetChildAt(idx); + Accessible* sibling = parent->LocalChildAt(idx); roles::Role siblingRole = sibling->Role(); // If the sibling is separator then the group is ended. if (siblingRole == roles::SEPARATOR) break; if (BaseRole(siblingRole) != mRole) { continue; } @@ -77,17 +77,17 @@ void AccGroupInfo::Update() { mPosInSet++; } // Compute set size. mSetSize = mPosInSet; for (uint32_t idx = indexInParent + 1; idx < siblingCount; idx++) { - Accessible* sibling = parent->GetChildAt(idx); + Accessible* sibling = parent->LocalChildAt(idx); roles::Role siblingRole = sibling->Role(); // If the sibling is separator then the group is ended. if (siblingRole == roles::SEPARATOR) break; if (BaseRole(siblingRole) != mRole) { continue; @@ -126,66 +126,66 @@ void AccGroupInfo::Update() { // ARIA tree and list can be arranged by using ARIA groups to organize levels. if (parentRole != roles::GROUPING) return; // Way #1 for ARIA tree (not ARIA treegrid): previous sibling of a group is a // parent. In other words the parent of the tree item will be a group and // the previous tree item of the group is a conceptual parent of the tree // item. if (mRole == roles::OUTLINEITEM) { - Accessible* parentPrevSibling = parent->PrevSibling(); + Accessible* parentPrevSibling = parent->LocalPrevSibling(); if (parentPrevSibling && parentPrevSibling->Role() == mRole) { mParent = parentPrevSibling; return; } } // Way #2 for ARIA list and tree: group is a child of an item. In other words // the parent of the item will be a group and containing item of the group is // a conceptual parent of the item. if (mRole == roles::LISTITEM || mRole == roles::OUTLINEITEM) { - Accessible* grandParent = parent->Parent(); + Accessible* grandParent = parent->LocalParent(); if (grandParent && grandParent->Role() == mRole) mParent = grandParent; } } Accessible* AccGroupInfo::FirstItemOf(const Accessible* aContainer) { // ARIA tree can be arranged by ARIA groups case #1 (previous sibling of a // group is a parent) or by aria-level. a11y::role containerRole = aContainer->Role(); - Accessible* item = aContainer->NextSibling(); + Accessible* item = aContainer->LocalNextSibling(); if (item) { if (containerRole == roles::OUTLINEITEM && item->Role() == roles::GROUPING) - item = item->FirstChild(); + item = item->LocalFirstChild(); if (item) { AccGroupInfo* itemGroupInfo = item->GetGroupInfo(); if (itemGroupInfo && itemGroupInfo->ConceptualParent() == aContainer) return item; } } // ARIA list and tree can be arranged by ARIA groups case #2 (group is // a child of an item). - item = aContainer->LastChild(); + item = aContainer->LocalLastChild(); if (!item) return nullptr; if (item->Role() == roles::GROUPING && (containerRole == roles::LISTITEM || containerRole == roles::OUTLINEITEM)) { - item = item->FirstChild(); + item = item->LocalFirstChild(); if (item) { AccGroupInfo* itemGroupInfo = item->GetGroupInfo(); if (itemGroupInfo && itemGroupInfo->ConceptualParent() == aContainer) return item; } } // Otherwise, it can be a direct child if the container is a list or tree. - item = aContainer->FirstChild(); + item = aContainer->LocalFirstChild(); if (ShouldReportRelations(item->Role(), containerRole)) return item; return nullptr; } uint32_t AccGroupInfo::TotalItemCount(Accessible* aContainer, bool* aIsHierarchical) { uint32_t itemCount = 0; @@ -226,20 +226,20 @@ uint32_t AccGroupInfo::TotalItemCount(Ac case roles::COMBOBOX_LIST: case roles::LISTBOX: case roles::DEFINITION_LIST: case roles::EDITCOMBOBOX: case roles::RADIO_GROUP: case roles::PAGETABLIST: { Accessible* childItem = AccGroupInfo::FirstItemOf(aContainer); if (!childItem) { - childItem = aContainer->FirstChild(); + childItem = aContainer->LocalFirstChild(); if (childItem && childItem->IsTextLeaf()) { // First child can be a text leaf, check its sibling for an item. - childItem = childItem->NextSibling(); + childItem = childItem->LocalNextSibling(); } } if (childItem) { GroupPos groupPos = childItem->GroupPosition(); itemCount = groupPos.setSize; if (groupPos.level && aIsHierarchical) { *aIsHierarchical = true; @@ -256,20 +256,20 @@ uint32_t AccGroupInfo::TotalItemCount(Ac Accessible* AccGroupInfo::NextItemTo(Accessible* aItem) { AccGroupInfo* groupInfo = aItem->GetGroupInfo(); if (!groupInfo) return nullptr; // If the item in middle of the group then search next item in siblings. if (groupInfo->PosInSet() >= groupInfo->SetSize()) return nullptr; - Accessible* parent = aItem->Parent(); + Accessible* parent = aItem->LocalParent(); uint32_t childCount = parent->ChildCount(); for (uint32_t idx = aItem->IndexInParent() + 1; idx < childCount; idx++) { - Accessible* nextItem = parent->GetChildAt(idx); + Accessible* nextItem = parent->LocalChildAt(idx); AccGroupInfo* nextGroupInfo = nextItem->GetGroupInfo(); if (nextGroupInfo && nextGroupInfo->ConceptualParent() == groupInfo->ConceptualParent()) { return nextItem; } } MOZ_ASSERT_UNREACHABLE(
--- a/accessible/base/AccIterator.cpp +++ b/accessible/base/AccIterator.cpp @@ -30,17 +30,17 @@ AccIterator::~AccIterator() { IteratorState* tmp = mState; mState = tmp->mParentState; delete tmp; } } Accessible* AccIterator::Next() { while (mState) { - Accessible* child = mState->mParent->GetChildAt(mState->mIndex++); + Accessible* child = mState->mParent->LocalChildAt(mState->mIndex++); if (!child) { IteratorState* tmp = mState; mState = mState->mParentState; delete tmp; continue; } @@ -131,28 +131,28 @@ Accessible* HTMLLabelIterator::Next() { } // Ignore ancestor label on not widget accessible. if (mLabelFilter == eSkipAncestorLabel || !mAcc->IsWidget()) return nullptr; // Go up tree to get a name of ancestor label if there is one (an ancestor // <label> implicitly points to us). Don't go up farther than form or // document. - Accessible* walkUp = mAcc->Parent(); + Accessible* walkUp = mAcc->LocalParent(); while (walkUp && !walkUp->IsDoc()) { nsIContent* walkUpEl = walkUp->GetContent(); if (IsLabel(walkUp) && !walkUpEl->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::_for)) { mLabelFilter = eSkipAncestorLabel; // prevent infinite loop return walkUp; } if (walkUpEl->IsHTMLElement(nsGkAtoms::form)) break; - walkUp = walkUp->Parent(); + walkUp = walkUp->LocalParent(); } return nullptr; } //////////////////////////////////////////////////////////////////////////////// // HTMLOutputIterator ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/base/AccessibleOrProxy.cpp +++ b/accessible/base/AccessibleOrProxy.cpp @@ -30,17 +30,17 @@ int32_t AccessibleOrProxy::IndexInParent } MOZ_ASSERT_UNREACHABLE("Proxy should have parent or outer doc."); return -1; } AccessibleOrProxy AccessibleOrProxy::Parent() const { if (IsAccessible()) { - return AsAccessible()->Parent(); + return AsAccessible()->LocalParent(); } ProxyAccessible* proxy = AsProxy(); if (!proxy) { return nullptr; } if (ProxyAccessible* parent = proxy->Parent()) {
--- a/accessible/base/AccessibleOrProxy.h +++ b/accessible/base/AccessibleOrProxy.h @@ -75,71 +75,71 @@ class AccessibleOrProxy { return AsProxy()->ChildAt(aIdx); } ProxyAccessible* childDoc = RemoteChildDoc(); if (childDoc && aIdx == 0) { return childDoc; } - return AsAccessible()->GetChildAt(aIdx); + return AsAccessible()->LocalChildAt(aIdx); } /** * Return the first child object. */ AccessibleOrProxy FirstChild() { if (IsProxy()) { return AsProxy()->FirstChild(); } ProxyAccessible* childDoc = RemoteChildDoc(); if (childDoc) { return childDoc; } - return AsAccessible()->FirstChild(); + return AsAccessible()->LocalFirstChild(); } /** * Return the last child object. */ AccessibleOrProxy LastChild() { if (IsProxy()) { return AsProxy()->LastChild(); } ProxyAccessible* childDoc = RemoteChildDoc(); if (childDoc) { return childDoc; } - return AsAccessible()->LastChild(); + return AsAccessible()->LocalLastChild(); } /** * Return the next sibling object. */ AccessibleOrProxy NextSibling() { if (IsProxy()) { return AsProxy()->NextSibling(); } - return AsAccessible()->NextSibling(); + return AsAccessible()->LocalNextSibling(); } /** * Return the prev sibling object. */ AccessibleOrProxy PrevSibling() { if (IsProxy()) { return AsProxy()->PrevSibling(); } - return AsAccessible()->PrevSibling(); + return AsAccessible()->LocalPrevSibling(); } role Role() const { if (IsProxy()) { return AsProxy()->Role(); } return AsAccessible()->Role();
--- a/accessible/base/EmbeddedObjCollector.cpp +++ b/accessible/base/EmbeddedObjCollector.cpp @@ -18,30 +18,30 @@ Accessible* EmbeddedObjCollector::GetAcc if (accessible) return accessible; return EnsureNGetObject(aIndex); } Accessible* EmbeddedObjCollector::EnsureNGetObject(uint32_t aIndex) { uint32_t childCount = mRoot->ChildCount(); while (mRootChildIdx < childCount) { - Accessible* child = mRoot->GetChildAt(mRootChildIdx++); + Accessible* child = mRoot->LocalChildAt(mRootChildIdx++); if (child->IsText()) continue; AppendObject(child); if (mObjects.Length() - 1 == aIndex) return mObjects[aIndex]; } return nullptr; } int32_t EmbeddedObjCollector::EnsureNGetIndex(Accessible* aAccessible) { uint32_t childCount = mRoot->ChildCount(); while (mRootChildIdx < childCount) { - Accessible* child = mRoot->GetChildAt(mRootChildIdx++); + Accessible* child = mRoot->LocalChildAt(mRootChildIdx++); if (child->IsText()) continue; AppendObject(child); if (child == aAccessible) return mObjects.Length() - 1; } return -1; }
--- a/accessible/base/EventQueue.cpp +++ b/accessible/base/EventQueue.cpp @@ -58,17 +58,17 @@ bool EventQueue::PushNameOrDescriptionCh if (!doName && !doDesc) { return false; } bool pushed = false; bool nameCheckAncestor = true; // Only continue traversing up the tree if it's possible that the parent // Accessible's name (or an Accessible being labelled by this Accessible or // an ancestor) can depend on this Accessible's name. - Accessible* parent = aTarget->Parent(); + Accessible* parent = aTarget->LocalParent(); while (parent && nsTextEquivUtils::HasNameRule(parent, eNameFromSubtreeIfReqRule)) { // Test possible name dependent parent. if (doName) { if (nameCheckAncestor && nsTextEquivUtils::HasNameRule(parent, eNameFromSubtreeRule)) { nsAutoString name; ENameValueFlag nameFlag = parent->Name(name); @@ -93,17 +93,17 @@ bool EventQueue::PushNameOrDescriptionCh Relation rel = parent->RelationByType(RelationType::DESCRIPTION_FOR); while (Accessible* relTarget = rel.Next()) { RefPtr<AccEvent> descChangeEvent = new AccEvent( nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE, relTarget); pushed |= PushEvent(descChangeEvent); } } - parent = parent->Parent(); + parent = parent->LocalParent(); } return pushed; } //////////////////////////////////////////////////////////////////////////////// // EventQueue: private void EventQueue::CoalesceEvents() {
--- a/accessible/base/EventTree.cpp +++ b/accessible/base/EventTree.cpp @@ -50,34 +50,34 @@ TreeMutation::TreeMutation(Accessible* a mParent->mStateFlags |= Accessible::eKidsMutating; } TreeMutation::~TreeMutation() { MOZ_ASSERT(mIsDone, "Done() must be called explicitly"); } void TreeMutation::AfterInsertion(Accessible* aChild) { - MOZ_ASSERT(aChild->Parent() == mParent); + MOZ_ASSERT(aChild->LocalParent() == mParent); if (static_cast<uint32_t>(aChild->mIndexInParent) < mStartIdx) { mStartIdx = aChild->mIndexInParent + 1; } if (!mQueueEvents) { return; } RefPtr<AccShowEvent> ev = new AccShowEvent(aChild); DebugOnly<bool> added = Controller()->QueueMutationEvent(ev); MOZ_ASSERT(added); aChild->SetShowEventTarget(true); } void TreeMutation::BeforeRemoval(Accessible* aChild, bool aNoShutdown) { - MOZ_ASSERT(aChild->Parent() == mParent); + MOZ_ASSERT(aChild->LocalParent() == mParent); if (static_cast<uint32_t>(aChild->mIndexInParent) < mStartIdx) { mStartIdx = aChild->mIndexInParent; } if (!mQueueEvents) { return; } @@ -262,17 +262,17 @@ EventTree* EventTree::FindOrInsert(Acces Accessible* parent = aContainer; while (parent) { // Reached a top, no match for a current event. if (parent == top) { break; } // We got a match. - if (parent->Parent() == node->mContainer) { + if (parent->LocalParent() == node->mContainer) { // Reject the node if it's contained by a show/hide event target uint32_t evCount = node->mDependentEvents.Length(); for (uint32_t idx = 0; idx < evCount; idx++) { AccMutationEvent* ev = node->mDependentEvents[idx]; if (ev->GetAccessible() == parent) { #ifdef A11Y_LOG if (logging::IsEnabled(logging::eEventTree)) { logging::MsgBegin("EVENTS_TREE", @@ -290,29 +290,29 @@ EventTree* EventTree::FindOrInsert(Acces } return nullptr; } } return node->FindOrInsert(aContainer); } - parent = parent->Parent(); + parent = parent->LocalParent(); MOZ_ASSERT(parent, "Wrong tree"); } // If the given container contains a current node // then // if show or hide of the given node contains a grand parent of the // current node then ignore the current node and its show and hide events // otherwise ignore the current node, but not its show and hide events Accessible* curParent = node->mContainer; while (curParent && !curParent->IsDoc()) { - if (curParent->Parent() != aContainer) { - curParent = curParent->Parent(); + if (curParent->LocalParent() != aContainer) { + curParent = curParent->LocalParent(); continue; } // Insert the tail node into the hierarchy between the current node and // its parent. node->mFireReorder = false; UniquePtr<EventTree>& nodeOwnerRef = prevNode ? prevNode->mNext : mFirst; UniquePtr<EventTree> newNode( @@ -325,18 +325,18 @@ EventTree* EventTree::FindOrInsert(Acces // under the given node if so. prevNode = nodeOwnerRef.get(); node = nodeOwnerRef->mNext.get(); UniquePtr<EventTree>* nodeRef = &nodeOwnerRef->mNext; EventTree* insNode = nodeOwnerRef->mFirst.get(); while (node) { Accessible* curParent = node->mContainer; while (curParent && !curParent->IsDoc()) { - if (curParent->Parent() != aContainer) { - curParent = curParent->Parent(); + if (curParent->LocalParent() != aContainer) { + curParent = curParent->LocalParent(); continue; } MOZ_ASSERT(!insNode->mNext); node->mFireReorder = false; insNode->mNext = std::move(*nodeRef); insNode = insNode->mNext.get(); @@ -521,17 +521,17 @@ void EventTree::Mutated(AccMutationEvent } } } } *node = std::move((*node)->mNext); break; } - cntr = cntr->Parent(); + cntr = cntr->LocalParent(); } if (cntr == aEv->mAccessible) { continue; } node = &(*node)->mNext; } AccMutationEvent* prevEvent = mDependentEvents.SafeLastElement(nullptr);
--- a/accessible/base/FocusManager.cpp +++ b/accessible/base/FocusManager.cpp @@ -63,43 +63,43 @@ bool FocusManager::IsFocused(const Acces return false; } bool FocusManager::IsFocusWithin(const Accessible* aContainer) const { Accessible* child = FocusedAccessible(); while (child) { if (child == aContainer) return true; - child = child->Parent(); + child = child->LocalParent(); } return false; } FocusManager::FocusDisposition FocusManager::IsInOrContainsFocus( const Accessible* aAccessible) const { Accessible* focus = FocusedAccessible(); if (!focus) return eNone; // If focused. if (focus == aAccessible) return eFocused; // If contains the focus. - Accessible* child = focus->Parent(); + Accessible* child = focus->LocalParent(); while (child) { if (child == aAccessible) return eContainsFocus; - child = child->Parent(); + child = child->LocalParent(); } // If contained by focus. - child = aAccessible->Parent(); + child = aAccessible->LocalParent(); while (child) { if (child == focus) return eContainedByFocus; - child = child->Parent(); + child = child->LocalParent(); } return eNone; } bool FocusManager::WasLastFocused(const Accessible* aAccessible) const { return mLastFocus == aAccessible; } @@ -281,18 +281,18 @@ void FocusManager::ProcessFocusEvent(Acc MOZ_ASSERT(!target->IsDefunct()); } } // Fire menu start/end events for ARIA menus. if (target->IsARIARole(nsGkAtoms::menuitem)) { // The focus was moved into menu. Accessible* ARIAMenubar = nullptr; - for (Accessible* parent = target->Parent(); parent; - parent = parent->Parent()) { + for (Accessible* parent = target->LocalParent(); parent; + parent = parent->LocalParent()) { if (parent->IsARIARole(nsGkAtoms::menubar)) { ARIAMenubar = parent; break; } // Go up in the parent chain of the menu hierarchy. if (!parent->IsARIARole(nsGkAtoms::menuitem) && !parent->IsARIARole(nsGkAtoms::menu)) {
--- a/accessible/base/Logging.cpp +++ b/accessible/base/Logging.cpp @@ -656,48 +656,48 @@ void logging::TreeInfo(const char* aMsg, } void logging::TreeInfo(const char* aMsg, uint32_t aExtraFlags, Accessible* aParent) { if (IsEnabledAll(logging::eTree | aExtraFlags)) { MsgBegin("TREE", "%s; doc: %p", aMsg, aParent->Document()); AccessibleInfo("container", aParent); for (uint32_t idx = 0; idx < aParent->ChildCount(); idx++) { - AccessibleInfo("child", aParent->GetChildAt(idx)); + AccessibleInfo("child", aParent->LocalChildAt(idx)); } MsgEnd(); } } void logging::Tree(const char* aTitle, const char* aMsgText, Accessible* aRoot, GetTreePrefix aPrefixFunc, void* aGetTreePrefixData) { logging::MsgBegin(aTitle, "%s", aMsgText); nsAutoString level; Accessible* root = aRoot; do { const char* prefix = aPrefixFunc ? aPrefixFunc(aGetTreePrefixData, root) : ""; printf("%s", NS_ConvertUTF16toUTF8(level).get()); logging::AccessibleInfo(prefix, root); - if (root->FirstChild() && !root->FirstChild()->IsDoc()) { + if (root->LocalFirstChild() && !root->LocalFirstChild()->IsDoc()) { level.AppendLiteral(u" "); - root = root->FirstChild(); + root = root->LocalFirstChild(); continue; } int32_t idxInParent = root != aRoot && root->mParent ? root->mParent->mChildren.IndexOf(root) : -1; if (idxInParent != -1 && idxInParent < static_cast<int32_t>(root->mParent->mChildren.Length() - 1)) { root = root->mParent->mChildren.ElementAt(idxInParent + 1); continue; } - while (root != aRoot && (root = root->Parent())) { + while (root != aRoot && (root = root->LocalParent())) { level.Cut(0, 2); int32_t idxInParent = !root->IsDoc() && root->mParent ? root->mParent->mChildren.IndexOf(root) : -1; if (idxInParent != -1 && idxInParent < static_cast<int32_t>(root->mParent->mChildren.Length() - 1)) { root = root->mParent->mChildren.ElementAt(idxInParent + 1);
--- a/accessible/base/MarkupMap.h +++ b/accessible/base/MarkupMap.h @@ -526,18 +526,19 @@ MARKUPMAP( tr, [](Element* aElement, Accessible* aContext) -> Accessible* { // If HTML:tr element is part of its HTML:table, which has CSS // display style other than 'table', then create a generic table row // accessible, because there's no underlying table layout and thus // native HTML table row class doesn't work. Refer to // CreateAccessibleByFrameType dual logic. Accessible* table = aContext->IsTable() ? aContext : nullptr; - if (!table && aContext->Parent() && aContext->Parent()->IsTable()) { - table = aContext->Parent(); + if (!table && aContext->LocalParent() && + aContext->LocalParent()->IsTable()) { + table = aContext->LocalParent(); } if (table) { nsIContent* parentContent = aElement->GetParent(); nsIFrame* parentFrame = parentContent->GetPrimaryFrame(); if (parentFrame && !parentFrame->IsTableWrapperFrame()) { parentContent = parentContent->GetParent(); parentFrame = parentContent->GetPrimaryFrame(); if (table->GetContent() == parentContent &&
--- a/accessible/base/NotificationController.cpp +++ b/accessible/base/NotificationController.cpp @@ -166,17 +166,17 @@ bool NotificationController::QueueMutati } } // We need to fire a reorder event after all of the events targeted at shown // or hidden children of a container. So either queue a new one, or move an // existing one to the end of the queue if the container already has a // reorder event. Accessible* target = aEvent->GetAccessible(); - Accessible* container = aEvent->GetAccessible()->Parent(); + Accessible* container = aEvent->GetAccessible()->LocalParent(); RefPtr<AccReorderEvent> reorder; if (!container->ReorderEventTarget()) { reorder = new AccReorderEvent(container); container->SetReorderEventTarget(true); mMutationMap.PutEvent(reorder); // Since this is the first child of container that is changing, the name // and/or description of dependent Accessibles may be changing. @@ -223,17 +223,17 @@ bool NotificationController::QueueMutati prevEvent = prevEvent->PrevEvent(); } if (prevEvent && prevEvent->GetEventType() == nsIAccessibleEvent::EVENT_HIDE && mutEvent->IsHide()) { AccHideEvent* prevHide = downcast_accEvent(prevEvent); AccTextChangeEvent* prevTextChange = prevHide->mTextChangeEvent; - if (prevTextChange && prevHide->Parent() == mutEvent->Parent()) { + if (prevTextChange && prevHide->LocalParent() == mutEvent->LocalParent()) { if (prevHide->mNextSibling == target) { target->AppendTextTo(prevTextChange->mModifiedText); prevHide->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } else if (prevHide->mPrevSibling == target) { nsString temp; target->AppendTextTo(temp); uint32_t extraLen = temp.Length(); @@ -243,17 +243,17 @@ bool NotificationController::QueueMutati prevTextChange->mStart -= extraLen; prevHide->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } } } else if (prevEvent && mutEvent->IsShow() && prevEvent->GetEventType() == nsIAccessibleEvent::EVENT_SHOW) { AccShowEvent* prevShow = downcast_accEvent(prevEvent); AccTextChangeEvent* prevTextChange = prevShow->mTextChangeEvent; - if (prevTextChange && prevShow->Parent() == target->Parent()) { + if (prevTextChange && prevShow->LocalParent() == target->LocalParent()) { int32_t index = target->IndexInParent(); int32_t prevIndex = prevShow->GetAccessible()->IndexInParent(); if (prevIndex + 1 == index) { target->AppendTextTo(prevTextChange->mModifiedText); prevShow->mTextChangeEvent.swap(mutEvent->mTextChangeEvent); } else if (index + 1 == prevIndex) { nsString temp; target->AppendTextTo(temp); @@ -324,17 +324,17 @@ void NotificationController::CoalesceMut // if a parent of the reorder event's target is being hidden that // hide event's target must have a parent that is also a reorder event // target. That means we don't need this reorder event. if (acc->HideEventTarget()) { DropMutationEvent(event); break; } - Accessible* parent = acc->Parent(); + Accessible* parent = acc->LocalParent(); if (parent->ReorderEventTarget()) { AccReorderEvent* reorder = downcast_accEvent( mMutationMap.GetEvent(parent, EventMap::ReorderEvent)); // We want to make sure that a reorder event comes after any show or // hide events targeted at the children of its target. We keep the // invariant that event generation goes up as you are farther in the // queue, so we want to use the spot of the event with the higher @@ -365,37 +365,37 @@ void NotificationController::CoalesceMut } DropMutationEvent(event); break; } acc = parent; } } else if (eventType == nsIAccessibleEvent::EVENT_SHOW) { - Accessible* parent = event->GetAccessible()->Parent(); + Accessible* parent = event->GetAccessible()->LocalParent(); while (parent) { if (parent->IsDoc()) { break; } // if the parent of a show event is being either shown or hidden then // we don't need to fire a show event for a subtree of that change. if (parent->ShowEventTarget() || parent->HideEventTarget()) { DropMutationEvent(event); break; } - parent = parent->Parent(); + parent = parent->LocalParent(); } } else { MOZ_ASSERT(eventType == nsIAccessibleEvent::EVENT_HIDE, "mutation event list has an invalid event"); AccHideEvent* hideEvent = downcast_accEvent(event); - Accessible* parent = hideEvent->Parent(); + Accessible* parent = hideEvent->LocalParent(); while (parent) { if (parent->IsDoc()) { break; } if (parent->HideEventTarget()) { DropMutationEvent(event); break; @@ -405,17 +405,17 @@ void NotificationController::CoalesceMut AccShowEvent* showEvent = downcast_accEvent( mMutationMap.GetEvent(parent, EventMap::ShowEvent)); if (showEvent->EventGeneration() < hideEvent->EventGeneration()) { DropMutationEvent(hideEvent); break; } } - parent = parent->Parent(); + parent = parent->LocalParent(); } } event = nextEvent; } } void NotificationController::ScheduleChildDocBinding(DocAccessible* aDocument) { @@ -523,17 +523,17 @@ void NotificationController::ProcessMuta nsDataHashtable<nsPtrHashKey<Accessible>, nsTArray<AccTreeMutationEvent*>> showEvents; for (AccTreeMutationEvent* event = mFirstMutationEvent; event; event = event->NextEvent()) { if (event->GetEventType() != nsIAccessibleEvent::EVENT_SHOW) { continue; } - Accessible* parent = event->GetAccessible()->Parent(); + Accessible* parent = event->GetAccessible()->LocalParent(); showEvents.GetOrInsert(parent).AppendElement(event); } // We need to fire show events for the children of an accessible in the order // of their indices at this point. So sort each set of events for the same // container by the index of their target. for (auto iter = showEvents.Iter(); !iter.Done(); iter.Next()) { struct AccIdxComparator { @@ -888,17 +888,17 @@ void NotificationController::WillRefresh if (IPCAccessibilityActive()) { size_t newDocCount = newChildDocs.Length(); for (size_t i = 0; i < newDocCount; i++) { DocAccessible* childDoc = newChildDocs[i]; if (childDoc->IsDefunct()) { continue; } - Accessible* parent = childDoc->Parent(); + Accessible* parent = childDoc->LocalParent(); DocAccessibleChild* parentIPCDoc = mDocument->IPCDoc(); MOZ_DIAGNOSTIC_ASSERT(parentIPCDoc); uint64_t id = reinterpret_cast<uintptr_t>(parent->UniqueID()); MOZ_DIAGNOSTIC_ASSERT(id); DocAccessibleChild* ipcDoc = childDoc->IPCDoc(); if (ipcDoc) { parentIPCDoc->SendBindChildDoc(ipcDoc, id); continue;
--- a/accessible/base/Pivot.cpp +++ b/accessible/base/Pivot.cpp @@ -160,18 +160,18 @@ AccessibleOrProxy Pivot::SearchForward(A HyperTextAccessible* Pivot::SearchForText(Accessible* aAnchor, bool aBackward) { if (!mRoot.IsAccessible()) { return nullptr; } Accessible* accessible = aAnchor; while (true) { Accessible* child = nullptr; - while ((child = (aBackward ? accessible->LastChild() - : accessible->FirstChild()))) { + while ((child = (aBackward ? accessible->LocalLastChild() + : accessible->LocalFirstChild()))) { accessible = child; if (child->IsHyperText()) { return child->AsHyperText(); } } Accessible* sibling = nullptr; Accessible* temp = accessible; @@ -187,18 +187,18 @@ HyperTextAccessible* Pivot::SearchForTex if (temp != aAnchor && temp->IsHyperText()) { return temp->AsHyperText(); } if (sibling) { break; } - sibling = aBackward ? temp->PrevSibling() : temp->NextSibling(); - } while ((temp = temp->Parent())); + sibling = aBackward ? temp->LocalPrevSibling() : temp->LocalNextSibling(); + } while ((temp = temp->LocalParent())); if (!sibling) { break; } accessible = sibling; if (accessible->IsHyperText()) { return accessible->AsHyperText(); @@ -242,19 +242,19 @@ Accessible* Pivot::NextText(Accessible* return nullptr; } int32_t tempStart = *aStartOffset, tempEnd = *aEndOffset; Accessible* tempPosition = aAnchor; // if we're starting on a text leaf, translate the offsets to the // HyperTextAccessible parent and start from there. - if (aAnchor->IsTextLeaf() && aAnchor->Parent() && - aAnchor->Parent()->IsHyperText()) { - HyperTextAccessible* text = aAnchor->Parent()->AsHyperText(); + if (aAnchor->IsTextLeaf() && aAnchor->LocalParent() && + aAnchor->LocalParent()->IsHyperText()) { + HyperTextAccessible* text = aAnchor->LocalParent()->AsHyperText(); tempPosition = text; int32_t childOffset = text->GetChildOffset(aAnchor); if (tempEnd == -1) { tempStart = 0; tempEnd = 0; } tempStart += childOffset; tempEnd += childOffset; @@ -277,41 +277,42 @@ Accessible* Pivot::NextText(Accessible* } tempPosition = text; } // If the search led to the parent of the node we started on (e.g. when // starting on a text leaf), start the text movement from the end of that // node, otherwise we just default to 0. if (tempEnd == -1) { - tempEnd = - text == curPosition->Parent() ? text->GetChildOffset(curPosition) : 0; + tempEnd = text == curPosition->LocalParent() + ? text->GetChildOffset(curPosition) + : 0; } // If there's no more text on the current node, try to find the next text // node; if there isn't one, bail out. if (tempEnd == static_cast<int32_t>(text->CharacterCount())) { if (tempPosition == mRoot.AsAccessible()) { return nullptr; } // If we're currently sitting on a link, try move to either the next // sibling or the parent, whichever is closer to the current end // offset. Otherwise, do a forward search for the next node to land on // (we don't do this in the first case because we don't want to go to the // subtree). - Accessible* sibling = tempPosition->NextSibling(); + Accessible* sibling = tempPosition->LocalNextSibling(); if (tempPosition->IsLink()) { if (sibling && sibling->IsLink()) { tempStart = tempEnd = -1; tempPosition = sibling; } else { tempStart = tempPosition->StartOffset(); tempEnd = tempPosition->EndOffset(); - tempPosition = tempPosition->Parent(); + tempPosition = tempPosition->LocalParent(); } } else { tempPosition = SearchForText(tempPosition, false); if (!tempPosition) { return nullptr; } tempStart = tempEnd = -1; @@ -381,19 +382,19 @@ Accessible* Pivot::PrevText(Accessible* return nullptr; } int32_t tempStart = *aStartOffset, tempEnd = *aEndOffset; Accessible* tempPosition = aAnchor; // if we're starting on a text leaf, translate the offsets to the // HyperTextAccessible parent and start from there. - if (aAnchor->IsTextLeaf() && aAnchor->Parent() && - aAnchor->Parent()->IsHyperText()) { - HyperTextAccessible* text = aAnchor->Parent()->AsHyperText(); + if (aAnchor->IsTextLeaf() && aAnchor->LocalParent() && + aAnchor->LocalParent()->IsHyperText()) { + HyperTextAccessible* text = aAnchor->LocalParent()->AsHyperText(); tempPosition = text; int32_t childOffset = text->GetChildOffset(aAnchor); if (tempStart == -1) { tempStart = nsAccUtils::TextLength(aAnchor); tempEnd = tempStart; } tempStart += childOffset; tempEnd += childOffset; @@ -417,17 +418,17 @@ Accessible* Pivot::PrevText(Accessible* } tempPosition = text; } // If the search led to the parent of the node we started on (e.g. when // starting on a text leaf), start the text movement from the end offset // of that node. Otherwise we just default to the last offset in the parent. if (tempStart == -1) { - if (tempPosition != curPosition && text == curPosition->Parent()) { + if (tempPosition != curPosition && text == curPosition->LocalParent()) { tempStart = text->GetChildOffset(curPosition) + nsAccUtils::TextLength(curPosition); } else { tempStart = text->CharacterCount(); } } // If there's no more text on the current node, try to find the previous @@ -437,27 +438,27 @@ Accessible* Pivot::PrevText(Accessible* return nullptr; } // If we're currently sitting on a link, try move to either the previous // sibling or the parent, whichever is closer to the current end // offset. Otherwise, do a forward search for the next node to land on // (we don't do this in the first case because we don't want to go to the // subtree). - Accessible* sibling = tempPosition->PrevSibling(); + Accessible* sibling = tempPosition->LocalPrevSibling(); if (tempPosition->IsLink()) { if (sibling && sibling->IsLink()) { HyperTextAccessible* siblingText = sibling->AsHyperText(); tempStart = tempEnd = siblingText ? siblingText->CharacterCount() : -1; tempPosition = sibling; } else { tempStart = tempPosition->StartOffset(); tempEnd = tempPosition->EndOffset(); - tempPosition = tempPosition->Parent(); + tempPosition = tempPosition->LocalParent(); } } else { HyperTextAccessible* tempText = SearchForText(tempPosition, true); if (!tempText) { return nullptr; } tempPosition = tempText;
--- a/accessible/base/TextAttrs.cpp +++ b/accessible/base/TextAttrs.cpp @@ -39,26 +39,26 @@ void TextAttrsMgr::GetAttributes(nsIPers ((mOffsetAcc && mOffsetAccIdx != -1 && aStartOffset && aEndOffset) || (!mOffsetAcc && mOffsetAccIdx == -1 && !aStartOffset && !aEndOffset && mIncludeDefAttrs && aAttributes)), "Wrong usage of TextAttrsMgr!"); // Embedded objects are combined into own range with empty attributes set. if (mOffsetAcc && !mOffsetAcc->IsText()) { for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) { - Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->LocalChildAt(childIdx); if (currAcc->IsText()) break; (*aStartOffset)--; } uint32_t childCount = mHyperTextAcc->ChildCount(); for (uint32_t childIdx = mOffsetAccIdx + 1; childIdx < childCount; childIdx++) { - Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->LocalChildAt(childIdx); if (currAcc->IsText()) break; (*aEndOffset)++; } return; } @@ -132,17 +132,17 @@ void TextAttrsMgr::GetAttributes(nsIPers if (mOffsetAcc) GetRange(attrArray, ArrayLength(attrArray), aStartOffset, aEndOffset); } void TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen, uint32_t* aStartOffset, uint32_t* aEndOffset) { // Navigate backward from anchor accessible to find start offset. for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) { - Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->LocalChildAt(childIdx); // Stop on embedded accessible since embedded accessibles are combined into // own range. if (!currAcc->IsText()) break; MOZ_ASSERT(nsCoreUtils::GetDOMElementFor(currAcc->GetContent()), "Text accessible has to have an associated DOM element"); @@ -158,17 +158,17 @@ void TextAttrsMgr::GetRange(TextAttr* aA if (offsetFound) break; *(aStartOffset) -= nsAccUtils::TextLength(currAcc); } // Navigate forward from anchor accessible to find end offset. uint32_t childLen = mHyperTextAcc->ChildCount(); for (uint32_t childIdx = mOffsetAccIdx + 1; childIdx < childLen; childIdx++) { - Accessible* currAcc = mHyperTextAcc->GetChildAt(childIdx); + Accessible* currAcc = mHyperTextAcc->LocalChildAt(childIdx); if (!currAcc->IsText()) break; MOZ_ASSERT(nsCoreUtils::GetDOMElementFor(currAcc->GetContent()), "Text accessible has to have an associated DOM element"); bool offsetFound = false; for (uint32_t attrIdx = 0; attrIdx < aAttrArrayLen; attrIdx++) { TextAttr* textAttr = aAttrArray[attrIdx];
--- a/accessible/base/TextRange.cpp +++ b/accessible/base/TextRange.cpp @@ -21,21 +21,21 @@ bool TextPoint::operator<(const TextPoin if (mContainer == aPoint.mContainer) return mOffset < aPoint.mOffset; // Build the chain of parents Accessible* p1 = mContainer; Accessible* p2 = aPoint.mContainer; AutoTArray<Accessible*, 30> parents1, parents2; do { parents1.AppendElement(p1); - p1 = p1->Parent(); + p1 = p1->LocalParent(); } while (p1); do { parents2.AppendElement(p2); - p2 = p2->Parent(); + p2 = p2->LocalParent(); } while (p2); // Find where the parent chain differs uint32_t pos1 = parents1.Length(), pos2 = parents2.Length(); for (uint32_t len = std::min(pos1, pos2); len > 0; --len) { Accessible* child1 = parents1.ElementAt(--pos1); Accessible* child2 = parents2.ElementAt(--pos2); if (child1 != child2) @@ -43,27 +43,27 @@ bool TextPoint::operator<(const TextPoin } if (pos1 != 0) { // If parents1 is a superset of parents2 then mContainer is a // descendant of aPoint.mContainer. The next element down in parents1 // is mContainer's ancestor that is the child of aPoint.mContainer. // We compare its end offset in aPoint.mContainer with aPoint.mOffset. Accessible* child = parents1.ElementAt(pos1 - 1); - MOZ_ASSERT(child->Parent() == aPoint.mContainer); + MOZ_ASSERT(child->LocalParent() == aPoint.mContainer); return child->EndOffset() < static_cast<uint32_t>(aPoint.mOffset); } if (pos2 != 0) { // If parents2 is a superset of parents1 then aPoint.mContainer is a // descendant of mContainer. The next element down in parents2 // is aPoint.mContainer's ancestor that is the child of mContainer. // We compare its start offset in mContainer with mOffset. Accessible* child = parents2.ElementAt(pos2 - 1); - MOZ_ASSERT(child->Parent() == mContainer); + MOZ_ASSERT(child->LocalParent() == mContainer); return static_cast<uint32_t>(mOffset) < child->StartOffset(); } NS_ERROR("Broken tree?!"); return false; } //////////////////////////////////////////////////////////////////////////////// @@ -78,17 +78,17 @@ TextRange::TextRange(HyperTextAccessible mStartOffset(aStartOffset), mEndOffset(aEndOffset) {} void TextRange::EmbeddedChildren(nsTArray<Accessible*>* aChildren) const { if (mStartContainer == mEndContainer) { int32_t startIdx = mStartContainer->GetChildIndexAtOffset(mStartOffset); int32_t endIdx = mStartContainer->GetChildIndexAtOffset(mEndOffset); for (int32_t idx = startIdx; idx <= endIdx; idx++) { - Accessible* child = mStartContainer->GetChildAt(idx); + Accessible* child = mStartContainer->LocalChildAt(idx); if (!child->IsText()) { aChildren->AppendElement(child); } } return; } Accessible* p1 = mStartContainer->GetChildAtOffset(mStartOffset); @@ -101,57 +101,57 @@ void TextRange::EmbeddedChildren(nsTArra // Traverse the tree up to the container and collect embedded objects. for (uint32_t idx = 0; idx < pos1 - 1; idx++) { Accessible* parent = parents1[idx + 1]; Accessible* child = parents1[idx]; uint32_t childCount = parent->ChildCount(); for (uint32_t childIdx = child->IndexInParent(); childIdx < childCount; childIdx++) { - Accessible* next = parent->GetChildAt(childIdx); + Accessible* next = parent->LocalChildAt(childIdx); if (!next->IsText()) { aChildren->AppendElement(next); } } } // Traverse through direct children in the container. int32_t endIdx = parents2[pos2 - 1]->IndexInParent(); int32_t childIdx = parents1[pos1 - 1]->IndexInParent() + 1; for (; childIdx < endIdx; childIdx++) { - Accessible* next = container->GetChildAt(childIdx); + Accessible* next = container->LocalChildAt(childIdx); if (!next->IsText()) { aChildren->AppendElement(next); } } // Traverse down from the container to end point. for (int32_t idx = pos2 - 2; idx > 0; idx--) { Accessible* parent = parents2[idx]; Accessible* child = parents2[idx - 1]; int32_t endIdx = child->IndexInParent(); for (int32_t childIdx = 0; childIdx < endIdx; childIdx++) { - Accessible* next = parent->GetChildAt(childIdx); + Accessible* next = parent->LocalChildAt(childIdx); if (!next->IsText()) { aChildren->AppendElement(next); } } } } void TextRange::Text(nsAString& aText) const { Accessible* current = mStartContainer->GetChildAtOffset(mStartOffset); uint32_t startIntlOffset = mStartOffset - mStartContainer->GetChildOffset(current); while (current && TextInternal(aText, current, startIntlOffset)) { - current = current->Parent(); + current = current->LocalParent(); if (!current) break; - current = current->NextSibling(); + current = current->LocalNextSibling(); } } void TextRange::Bounds(nsTArray<nsIntRect> aRects) const {} void TextRange::Normalize(ETextUnit aUnit) {} bool TextRange::Crop(Accessible* aContainer) { @@ -436,37 +436,37 @@ void TextRange::Set(HyperTextAccessible* mStartOffset = aStartOffset; mEndOffset = aEndOffset; } bool TextRange::TextInternal(nsAString& aText, Accessible* aCurrent, uint32_t aStartIntlOffset) const { bool moveNext = true; int32_t endIntlOffset = -1; - if (aCurrent->Parent() == mEndContainer && + if (aCurrent->LocalParent() == mEndContainer && mEndContainer->GetChildAtOffset(mEndOffset) == aCurrent) { uint32_t currentStartOffset = mEndContainer->GetChildOffset(aCurrent); endIntlOffset = mEndOffset - currentStartOffset; if (endIntlOffset == 0) return false; moveNext = false; } if (aCurrent->IsTextLeaf()) { aCurrent->AppendTextTo(aText, aStartIntlOffset, endIntlOffset - aStartIntlOffset); if (!moveNext) return false; } - Accessible* next = aCurrent->FirstChild(); + Accessible* next = aCurrent->LocalFirstChild(); if (next) { if (!TextInternal(aText, next, 0)) return false; } - next = aCurrent->NextSibling(); + next = aCurrent->LocalNextSibling(); if (next) { if (!TextInternal(aText, next, 0)) return false; } return moveNext; } void TextRange::MoveInternal(ETextUnit aUnit, int32_t aCount, @@ -486,21 +486,21 @@ Accessible* TextRange::CommonParent(Acce MOZ_ASSERT(aParents1->Length() == 0 || aParents2->Length() == 0, "Wrong arguments"); // Build the chain of parents. Accessible* p1 = aAcc1; Accessible* p2 = aAcc2; do { aParents1->AppendElement(p1); - p1 = p1->Parent(); + p1 = p1->LocalParent(); } while (p1); do { aParents2->AppendElement(p2); - p2 = p2->Parent(); + p2 = p2->LocalParent(); } while (p2); // Find where the parent chain differs *aPos1 = aParents1->Length(); *aPos2 = aParents2->Length(); Accessible* parent = nullptr; uint32_t len = 0; for (len = std::min(*aPos1, *aPos2); len > 0; --len) {
--- a/accessible/base/TextUpdater.cpp +++ b/accessible/base/TextUpdater.cpp @@ -30,17 +30,17 @@ void TextUpdater::Run(DocAccessible* aDo if (skipStart != minLen || oldLen != newLen) { TextUpdater updater(aDocument, aTextLeaf); updater.DoUpdate(aNewText, oldText, skipStart); } } void TextUpdater::DoUpdate(const nsAString& aNewText, const nsAString& aOldText, uint32_t aSkipStart) { - Accessible* parent = mTextLeaf->Parent(); + Accessible* parent = mTextLeaf->LocalParent(); if (!parent) return; mHyperText = parent->AsHyperText(); if (!mHyperText) { MOZ_ASSERT_UNREACHABLE("Text leaf parent is not hypertext!"); return; }
--- a/accessible/base/TreeWalker.cpp +++ b/accessible/base/TreeWalker.cpp @@ -115,17 +115,17 @@ bool TreeWalker::Seek(nsIContent* aChild } // If ARIA owned child. Accessible* child = mDoc->GetAccessible(childNode); if (child && child->IsRelocated()) { MOZ_ASSERT( !(mFlags & eScoped), "Walker should not be scoped when seeking into relocated children"); - if (child->Parent() != mContext) { + if (child->LocalParent() != mContext) { return false; } Accessible* ownedChild = nullptr; while ((ownedChild = mDoc->ARIAOwnedAt(mContext, mARIAOwnsIdx++)) && ownedChild != child) ;
--- a/accessible/base/nsAccUtils.cpp +++ b/accessible/base/nsAccUtils.cpp @@ -70,17 +70,17 @@ void nsAccUtils::SetAccGroupAttrs(nsIPer } int32_t nsAccUtils::GetDefaultLevel(const Accessible* aAccessible) { roles::Role role = aAccessible->Role(); if (role == roles::OUTLINEITEM) return 1; if (role == roles::ROW) { - Accessible* parent = aAccessible->Parent(); + Accessible* parent = aAccessible->LocalParent(); // It is a row inside flatten treegrid. Group level is always 1 until it // is overriden by aria-level attribute. if (parent && parent->Role() == roles::TREE_TABLE) return 1; } return 0; } @@ -234,38 +234,38 @@ nsStaticAtom* nsAccUtils::NormalizeARIAT Accessible* nsAccUtils::GetSelectableContainer(Accessible* aAccessible, uint64_t aState) { if (!aAccessible) return nullptr; if (!(aState & states::SELECTABLE)) return nullptr; Accessible* parent = aAccessible; - while ((parent = parent->Parent()) && !parent->IsSelect()) { + while ((parent = parent->LocalParent()) && !parent->IsSelect()) { if (parent->Role() == roles::PANE) return nullptr; } return parent; } bool nsAccUtils::IsDOMAttrTrue(const Accessible* aAccessible, nsAtom* aAttr) { dom::Element* el = aAccessible->Elm(); return el && el->AttrValueIs(kNameSpaceID_None, aAttr, nsGkAtoms::_true, eCaseMatters); } Accessible* nsAccUtils::TableFor(Accessible* aRow) { if (aRow) { - Accessible* table = aRow->Parent(); + Accessible* table = aRow->LocalParent(); if (table) { roles::Role tableRole = table->Role(); const nsRoleMapEntry* roleMapEntry = table->ARIARoleMap(); if (tableRole == roles::GROUPING || // if there's a rowgroup. (table->IsGenericHyperText() && !roleMapEntry && !table->IsTable())) { // or there is a wrapping text container - table = table->Parent(); + table = table->LocalParent(); if (table) tableRole = table->Role(); } return (tableRole == roles::TABLE || tableRole == roles::TREE_TABLE || tableRole == roles::MATHML_TABLE) ? table : nullptr; } @@ -279,17 +279,17 @@ HyperTextAccessible* nsAccUtils::GetText DocAccessible* doc = GetAccService()->GetDocAccessible(aNode->OwnerDoc()); Accessible* accessible = doc ? doc->GetAccessibleOrContainer(aNode) : nullptr; if (!accessible) return nullptr; do { HyperTextAccessible* textAcc = accessible->AsHyperText(); if (textAcc) return textAcc; - accessible = accessible->Parent(); + accessible = accessible->LocalParent(); } while (accessible); return nullptr; } nsIntPoint nsAccUtils::ConvertToScreenCoords(int32_t aX, int32_t aY, uint32_t aCoordinateType, Accessible* aAccessible) { @@ -339,17 +339,17 @@ void nsAccUtils::ConvertScreenCoordsTo(i } default: MOZ_ASSERT_UNREACHABLE("invalid coord type!"); } } nsIntPoint nsAccUtils::GetScreenCoordsForParent(Accessible* aAccessible) { - Accessible* parent = aAccessible->Parent(); + Accessible* parent = aAccessible->LocalParent(); if (!parent) return nsIntPoint(0, 0); nsIFrame* parentFrame = parent->GetFrame(); if (!parentFrame) return nsIntPoint(0, 0); nsRect rect = parentFrame->GetScreenRectInAppUnits(); return nsPoint(rect.X(), rect.Y()) .ToNearestPixels(parentFrame->PresContext()->AppUnitsPerDevPixel()); @@ -376,17 +376,17 @@ bool nsAccUtils::GetLiveAttrValue(uint32 bool nsAccUtils::IsTextInterfaceSupportCorrect(Accessible* aAccessible) { // Don't test for accessible docs, it makes us create accessibles too // early and fire mutation events before we need to if (aAccessible->IsDoc()) return true; bool foundText = false; uint32_t childCount = aAccessible->ChildCount(); for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) { - Accessible* child = aAccessible->GetChildAt(childIdx); + Accessible* child = aAccessible->LocalChildAt(childIdx); if (child->IsText()) { foundText = true; break; } } return !foundText || aAccessible->IsHyperText(); }
--- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -1006,17 +1006,17 @@ Accessible* nsAccessibilityService::Crea // native table based. if (isARIATablePart && (!newAcc || newAcc->IsGenericHyperText())) { if ((roleMapEntry->accTypes & eTableCell)) { if (aContext->IsTableRow()) newAcc = new ARIAGridCellAccessibleWrap(content, document); } else if (roleMapEntry->IsOfType(eTableRow)) { if (aContext->IsTable() || - (aContext->Parent() && aContext->Parent()->IsTable())) { + (aContext->LocalParent() && aContext->LocalParent()->IsTable())) { newAcc = new ARIARowAccessible(content, document); } } else if (roleMapEntry->IsOfType(eTable)) { newAcc = new ARIAGridAccessibleWrap(content, document); } } @@ -1342,18 +1342,20 @@ nsAccessibilityService::CreateAccessible else newAcc = new HyperTextAccessibleWrap(aContent, document); break; case eHTMLTableRowType: { // Accessible HTML table row may be a child of tbody/tfoot/thead of // accessible HTML table or a direct child of accessible of HTML table. Accessible* table = aContext->IsTable() ? aContext : nullptr; - if (!table && aContext->Parent() && aContext->Parent()->IsTable()) - table = aContext->Parent(); + if (!table && aContext->LocalParent() && + aContext->LocalParent()->IsTable()) { + table = aContext->LocalParent(); + } if (table) { nsIContent* parentContent = aContent->GetParentOrShadowHostNode()->AsContent(); nsIFrame* parentFrame = nullptr; if (parentContent) { parentFrame = parentContent->GetPrimaryFrame(); if (!parentFrame || !parentFrame->IsTableWrapperFrame()) {
--- a/accessible/base/nsAccessiblePivot.cpp +++ b/accessible/base/nsAccessiblePivot.cpp @@ -414,17 +414,17 @@ nsAccessiblePivot::RemoveObserver(nsIAcc bool nsAccessiblePivot::IsDescendantOf(Accessible* aAccessible, Accessible* aAncestor) { if (!aAncestor || aAncestor->IsDefunct()) return false; // XXX Optimize with IsInDocument() when appropriate. Blocked by bug 759875. Accessible* accessible = aAccessible; do { if (accessible == aAncestor) return true; - } while ((accessible = accessible->Parent())); + } while ((accessible = accessible->LocalParent())); return false; } bool nsAccessiblePivot::MovePivotInternal(Accessible* aPosition, PivotMoveReason aReason, bool aIsFromUserInput) { RefPtr<Accessible> oldPosition = std::move(mPosition);
--- a/accessible/base/nsTextEquivUtils.cpp +++ b/accessible/base/nsTextEquivUtils.cpp @@ -153,17 +153,17 @@ nsresult nsTextEquivUtils::AppendTextEqu // nsTextEquivUtils. Private. nsresult nsTextEquivUtils::AppendFromAccessibleChildren( const Accessible* aAccessible, nsAString* aString) { nsresult rv = NS_OK_NO_NAME_CLAUSE_HANDLED; uint32_t childCount = aAccessible->ChildCount(); for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) { - Accessible* child = aAccessible->GetChildAt(childIdx); + Accessible* child = aAccessible->LocalChildAt(childIdx); rv = AppendFromAccessible(child, aString); NS_ENSURE_SUCCESS(rv, rv); } return rv; } nsresult nsTextEquivUtils::AppendFromAccessible(Accessible* aAccessible,
--- a/accessible/generic/ARIAGridAccessible.cpp +++ b/accessible/generic/ARIAGridAccessible.cpp @@ -417,17 +417,17 @@ nsresult ARIAGridAccessible::SetARIASele return NS_OK; } // If the given accessible is cell that was unselected and its row is selected // then remove aria-selected from row and put aria-selected on // siblings cells. if (role == roles::GRID_CELL || role == roles::ROWHEADER || role == roles::COLUMNHEADER) { - Accessible* row = aAccessible->Parent(); + Accessible* row = aAccessible->LocalParent(); if (row && row->Role() == roles::ROW && nsAccUtils::IsARIASelected(row)) { rv = SetARIASelected(row, false, false); NS_ENSURE_SUCCESS(rv, rv); AccIterator cellIter(row, filters::GetCell); Accessible* cell = nullptr; while ((cell = cellIter.Next())) { @@ -530,17 +530,17 @@ TableAccessible* ARIAGridCellAccessible: uint32_t ARIAGridCellAccessible::ColIdx() const { Accessible* row = Row(); if (!row) return 0; int32_t indexInRow = IndexInParent(); uint32_t colIdx = 0; for (int32_t idx = 0; idx < indexInRow; idx++) { - Accessible* cell = row->GetChildAt(idx); + Accessible* cell = row->LocalChildAt(idx); if (cell->IsTableCell()) { colIdx += cell->AsTableCell()->ColExtent(); } } return colIdx; } @@ -558,17 +558,17 @@ bool ARIAGridCellAccessible::Selected() void ARIAGridCellAccessible::ApplyARIAState(uint64_t* aState) const { HyperTextAccessibleWrap::ApplyARIAState(aState); // Return if the gridcell has aria-selected="true". if (*aState & states::SELECTED) return; // Check aria-selected="true" on the row. - Accessible* row = Parent(); + Accessible* row = LocalParent(); if (!row || row->Role() != roles::ROW) return; nsIContent* rowContent = row->GetContent(); if (nsAccUtils::HasDefinedARIAToken(rowContent, nsGkAtoms::aria_selected) && !rowContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_selected, nsGkAtoms::_false, eCaseMatters)) *aState |= states::SELECTABLE | states::SELECTED; @@ -586,17 +586,17 @@ ARIAGridCellAccessible::NativeAttributes int32_t rowIdx = RowIndexFor(thisRow); if (rowIdx == -1) { // error return attributes.forget(); } int32_t colIdx = 0, colCount = 0; uint32_t childCount = thisRow->ChildCount(); for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) { - Accessible* child = thisRow->GetChildAt(childIdx); + Accessible* child = thisRow->LocalChildAt(childIdx); if (child == this) colIdx = colCount; roles::Role role = child->Role(); if (role == roles::CELL || role == roles::GRID_CELL || role == roles::ROWHEADER || role == roles::COLUMNHEADER) colCount++; }
--- a/accessible/generic/ARIAGridAccessible.h +++ b/accessible/generic/ARIAGridAccessible.h @@ -106,17 +106,17 @@ class ARIAGridCellAccessible : public Hy protected: virtual ~ARIAGridCellAccessible() {} /** * Return a containing row. */ Accessible* Row() const { - Accessible* row = Parent(); + Accessible* row = LocalParent(); return row && row->IsTableRow() ? row : nullptr; } /** * Return index of the given row. * Returns -1 upon error. */ int32_t RowIndexFor(Accessible* aRow) const;
--- a/accessible/generic/Accessible-inl.h +++ b/accessible/generic/Accessible-inl.h @@ -104,20 +104,20 @@ inline void Accessible::ScrollTo(uint32_ nsCoreUtils::ScrollTo(presShell, content, aHow); } } inline bool Accessible::InsertAfter(Accessible* aNewChild, Accessible* aRefChild) { MOZ_ASSERT(aNewChild, "No new child to insert"); - if (aRefChild && aRefChild->Parent() != this) { + if (aRefChild && aRefChild->LocalParent() != this) { #ifdef A11Y_LOG logging::TreeInfo("broken accessible tree", 0, "parent", this, - "prev sibling parent", aRefChild->Parent(), "child", + "prev sibling parent", aRefChild->LocalParent(), "child", aNewChild, nullptr); if (logging::IsEnabled(logging::eVerbose)) { logging::Tree("TREE", "Document tree", mDoc); logging::DOMTree("TREE", "DOM document tree", mDoc); } #endif MOZ_ASSERT_UNREACHABLE("Broken accessible tree"); mDoc->UnbindFromDocument(aNewChild);
--- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -454,17 +454,19 @@ bool Accessible::NativelyUnavailable() c return mContent->IsElement() && mContent->AsElement()->AttrValueIs( kNameSpaceID_None, nsGkAtoms::disabled, nsGkAtoms::_true, eCaseMatters); } Accessible* Accessible::FocusedChild() { Accessible* focus = FocusMgr()->FocusedAccessible(); - if (focus && (focus == this || focus->Parent() == this)) return focus; + if (focus && (focus == this || focus->LocalParent() == this)) { + return focus; + } return nullptr; } Accessible* Accessible::ChildAtPoint(int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) { // If we can't find the point in a child, we will return the fallback answer: // we return |this| if the point is within it, otherwise nullptr. @@ -506,17 +508,17 @@ Accessible* Accessible::ChildAtPoint(int // If 'this' accessible is not inside the popup then ignore the popup when // searching an accessible at point. DocAccessible* popupDoc = GetAccService()->GetDocAccessible(popupFrame->GetContent()->OwnerDoc()); Accessible* popupAcc = popupDoc->GetAccessibleOrContainer(popupFrame->GetContent()); Accessible* popupChild = this; while (popupChild && !popupChild->IsDoc() && popupChild != popupAcc) - popupChild = popupChild->Parent(); + popupChild = popupChild->LocalParent(); if (popupChild == popupAcc) startFrame = popupFrame; } nsPresContext* presContext = startFrame->PresContext(); nsRect screenRect = startFrame->GetScreenRectInAppUnits(); nsPoint offset(presContext->DevPixelsToAppUnits(aX) - screenRect.X(), presContext->DevPixelsToAppUnits(aY) - screenRect.Y()); @@ -540,17 +542,17 @@ Accessible* Accessible::ChildAtPoint(int Accessible* accessible = contentDocAcc->GetAccessibleOrContainer(content); if (!accessible) return fallbackAnswer; // Hurray! We have an accessible for the frame that layout gave us. // Since DOM node of obtained accessible may be out of flow then we should // ensure obtained accessible is a child of this accessible. Accessible* child = accessible; while (child != this) { - Accessible* parent = child->Parent(); + Accessible* parent = child->LocalParent(); if (!parent) { // Reached the top of the hierarchy. These bounds were inside an // accessible that is not a descendant of this one. return fallbackAnswer; } // If we landed on a legitimate child of |this|, and we want the direct // child, return it here. @@ -561,17 +563,17 @@ Accessible* Accessible::ChildAtPoint(int // Manually walk through accessible children and see if the are within this // point. Skip offscreen or invisible accessibles. This takes care of cases // where layout won't walk into things for us, such as image map areas and // sub documents (XXX: subdocuments should be handled by methods of // OuterDocAccessibles). uint32_t childCount = accessible->ChildCount(); for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) { - Accessible* child = accessible->GetChildAt(childIdx); + Accessible* child = accessible->LocalChildAt(childIdx); nsIntRect childRect = child->Bounds(); if (childRect.Contains(aX, aY) && (child->State() & states::INVISIBLE) == 0) { if (aWhichChild == eDeepestChild) return child->ChildAtPoint(aX, aY, eDeepestChild); return child; @@ -1220,31 +1222,31 @@ void Accessible::ApplyARIAState(uint64_t // role. This preserves the ability for screen readers to use readonly // (primarily on the document) as the hint for creating a virtual buffer. if (roleMapEntry->role != roles::NOTHING) *aState &= ~states::READONLY; if (mContent->HasID()) { // If has a role & ID and aria-activedescendant on the container, assume // focusable. const Accessible* ancestor = this; - while ((ancestor = ancestor->Parent()) && !ancestor->IsDoc()) { + while ((ancestor = ancestor->LocalParent()) && !ancestor->IsDoc()) { dom::Element* el = ancestor->Elm(); if (el && el->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_activedescendant)) { *aState |= states::FOCUSABLE; break; } } } } if (*aState & states::FOCUSABLE) { // Propogate aria-disabled from ancestors down to any focusable descendant. const Accessible* ancestor = this; - while ((ancestor = ancestor->Parent()) && !ancestor->IsDoc()) { + while ((ancestor = ancestor->LocalParent()) && !ancestor->IsDoc()) { dom::Element* el = ancestor->Elm(); if (el && el->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_disabled, nsGkAtoms::_true, eCaseMatters)) { *aState |= states::UNAVAILABLE; break; } } } else { @@ -1646,17 +1648,17 @@ Relation Accessible::RelationByType(Rela // (because it is system generated and has no idea about the hierarchy // above it). nsIFrame* frame = GetFrame(); if (frame) { nsView* view = frame->GetView(); if (view) { nsIScrollableFrame* scrollFrame = do_QueryFrame(frame); if (scrollFrame || view->GetWidget() || !frame->GetParent()) - rel.AppendTarget(Parent()); + rel.AppendTarget(LocalParent()); } } return rel; } case RelationType::NODE_PARENT_OF: { // ARIA tree or treegrid can do the hierarchy by @aria-level, ARIA trees @@ -1693,19 +1695,19 @@ Relation Accessible::RelationByType(Rela new RelatedAccIterator(Document(), mContent, nsGkAtoms::aria_flowto)); case RelationType::MEMBER_OF: { if (Role() == roles::RADIOBUTTON) { /* If we see a radio button role here, we're dealing with an aria * radio button (because input=radio buttons are * HTMLRadioButtonAccessibles) */ Relation rel = Relation(); - Accessible* currParent = Parent(); + Accessible* currParent = LocalParent(); while (currParent && currParent->Role() != roles::RADIO_GROUP) { - currParent = currParent->Parent(); + currParent = currParent->LocalParent(); } if (currParent && currParent->Role() == roles::RADIO_GROUP) { /* If we found a radiogroup parent, search for all * roles::RADIOBUTTON children and add them to our relation. * This search will include the radio button this method * was called from, which is expected. */ Pivot p = Pivot(currParent); @@ -2203,17 +2205,17 @@ bool Accessible::RemoveChild(Accessible* void Accessible::RelocateChild(uint32_t aNewIndex, Accessible* aChild) { MOZ_DIAGNOSTIC_ASSERT(aChild, "No child was given"); MOZ_DIAGNOSTIC_ASSERT(aChild->mParent == this, "A child from different subtree was given"); MOZ_DIAGNOSTIC_ASSERT(aChild->mIndexInParent != -1, "Unbound child was given"); MOZ_DIAGNOSTIC_ASSERT( - aChild->mParent->GetChildAt(aChild->mIndexInParent) == aChild, + aChild->mParent->LocalChildAt(aChild->mIndexInParent) == aChild, "Wrong index in parent"); MOZ_DIAGNOSTIC_ASSERT( static_cast<uint32_t>(aChild->mIndexInParent) != aNewIndex, "No move, same index"); MOZ_DIAGNOSTIC_ASSERT(aNewIndex <= mChildren.Length(), "Wrong new index was given"); RefPtr<AccHideEvent> hideEvent = new AccHideEvent(aChild, false); @@ -2252,17 +2254,17 @@ void Accessible::RelocateChild(uint32_t } RefPtr<AccShowEvent> showEvent = new AccShowEvent(aChild); DebugOnly<bool> added = mDoc->Controller()->QueueMutationEvent(showEvent); MOZ_ASSERT(added); aChild->SetShowEventTarget(true); } -Accessible* Accessible::GetChildAt(uint32_t aIndex) const { +Accessible* Accessible::LocalChildAt(uint32_t aIndex) const { Accessible* child = mChildren.SafeElementAt(aIndex, nullptr); if (!child) return nullptr; #ifdef DEBUG Accessible* realParent = child->mParent; NS_ASSERTION(!realParent || realParent == this, "Two accessibles have the same first child accessible!"); #endif @@ -2288,17 +2290,17 @@ Accessible* Accessible::GetEmbeddedChild if (mStateFlags & eHasTextKids) { if (!mEmbeddedObjCollector) mEmbeddedObjCollector.reset(new EmbeddedObjCollector(this)); return mEmbeddedObjCollector.get() ? mEmbeddedObjCollector->GetAccessibleAt(aIndex) : nullptr; } - return GetChildAt(aIndex); + return LocalChildAt(aIndex); } int32_t Accessible::GetIndexOfEmbeddedChild(Accessible* aChild) { if (mStateFlags & eHasTextKids) { if (!mEmbeddedObjCollector) mEmbeddedObjCollector.reset(new EmbeddedObjCollector(this)); return mEmbeddedObjCollector.get() ? mEmbeddedObjCollector->GetIndexAt(aChild) @@ -2353,17 +2355,17 @@ void Accessible::ToTextPoint(HyperTextAc *aOffset = aIsBefore ? 0 : (*aContainer)->CharacterCount(); return; } const Accessible* child = nullptr; const Accessible* parent = this; do { child = parent; - parent = parent->Parent(); + parent = parent->LocalParent(); } while (parent && !parent->IsHyperText()); if (parent) { *aContainer = const_cast<Accessible*>(parent)->AsHyperText(); *aOffset = (*aContainer) ->GetChildOffset(child->IndexInParent() + static_cast<int32_t>(!aIsBefore)); } @@ -2511,17 +2513,18 @@ void Accessible::SetCurrentItem(const Ac id->ToString(idStr); mContent->AsElement()->SetAttr( kNameSpaceID_None, nsGkAtoms::aria_activedescendant, idStr, true); } } Accessible* Accessible::ContainerWidget() const { if (HasARIARole() && mContent->HasID()) { - for (Accessible* parent = Parent(); parent; parent = parent->Parent()) { + for (Accessible* parent = LocalParent(); parent; + parent = parent->LocalParent()) { nsIContent* parentContent = parent->GetContent(); if (parentContent && parentContent->IsElement() && parentContent->AsElement()->HasAttr( kNameSpaceID_None, nsGkAtoms::aria_activedescendant)) { return parent; } // Don't cross DOM document boundaries. @@ -2560,17 +2563,17 @@ Accessible* Accessible::GetSiblingAtOffs } if (aError && mIndexInParent + aOffset >= static_cast<int32_t>(mParent->ChildCount())) { *aError = NS_OK; // fail peacefully return nullptr; } - Accessible* child = mParent->GetChildAt(mIndexInParent + aOffset); + Accessible* child = mParent->LocalChildAt(mIndexInParent + aOffset); if (aError && !child) *aError = NS_ERROR_UNEXPECTED; return child; } double Accessible::AttrNumericValue(nsAtom* aAttr) const { const nsRoleMapEntry* roleMapEntry = ARIARoleMap(); if (!roleMapEntry || roleMapEntry->valueRule == eNoValue) @@ -2655,67 +2658,67 @@ int32_t Accessible::GetLevelInternal() { roles::Role role = Role(); if (role == roles::OUTLINEITEM) { // Always expose 'level' attribute for 'outlineitem' accessible. The number // of nested 'grouping' accessibles containing 'outlineitem' accessible is // its level. level = 1; Accessible* parent = this; - while ((parent = parent->Parent())) { + while ((parent = parent->LocalParent())) { roles::Role parentRole = parent->Role(); if (parentRole == roles::OUTLINE) break; if (parentRole == roles::GROUPING) ++level; } } else if (role == roles::LISTITEM) { // Expose 'level' attribute on nested lists. We support two hierarchies: // a) list -> listitem -> list -> listitem (nested list is a last child // of listitem of the parent list); // b) list -> listitem -> group -> listitem (nested listitems are contained // by group that is a last child of the parent listitem). // Calculate 'level' attribute based on number of parent listitems. level = 0; Accessible* parent = this; - while ((parent = parent->Parent())) { + while ((parent = parent->LocalParent())) { roles::Role parentRole = parent->Role(); if (parentRole == roles::LISTITEM) ++level; else if (parentRole != roles::LIST && parentRole != roles::GROUPING) break; } if (level == 0) { // If this listitem is on top of nested lists then expose 'level' // attribute. - parent = Parent(); + parent = LocalParent(); uint32_t siblingCount = parent->ChildCount(); for (uint32_t siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) { - Accessible* sibling = parent->GetChildAt(siblingIdx); - - Accessible* siblingChild = sibling->LastChild(); + Accessible* sibling = parent->LocalChildAt(siblingIdx); + + Accessible* siblingChild = sibling->LocalLastChild(); if (siblingChild) { roles::Role lastChildRole = siblingChild->Role(); if (lastChildRole == roles::LIST || lastChildRole == roles::GROUPING) return 1; } } } else { ++level; // level is 1-index based } } else if (role == roles::COMMENT) { // For comments, count the ancestor elements with the same role to get the // level. level = 1; Accessible* parent = this; - while ((parent = parent->Parent())) { + while ((parent = parent->LocalParent())) { roles::Role parentRole = parent->Role(); if (parentRole == roles::COMMENT) { ++level; } } } return level;
--- a/accessible/generic/Accessible.h +++ b/accessible/generic/Accessible.h @@ -383,22 +383,22 @@ class Accessible : public nsISupports { virtual void RelocateChild(uint32_t aNewIndex, Accessible* aChild); ////////////////////////////////////////////////////////////////////////////// // Accessible tree traverse methods /** * Return parent accessible. */ - Accessible* Parent() const { return mParent; } + Accessible* LocalParent() const { return mParent; } /** * Return child accessible at the given index. */ - virtual Accessible* GetChildAt(uint32_t aIndex) const; + virtual Accessible* LocalChildAt(uint32_t aIndex) const; /** * Return child accessible count. */ virtual uint32_t ChildCount() const; /** * Return index of the given child accessible. @@ -410,27 +410,27 @@ class Accessible : public nsISupports { /** * Return index in parent accessible. */ virtual int32_t IndexInParent() const; /** * Return true if accessible has children; */ - bool HasChildren() const { return !!GetChildAt(0); } + bool HasChildren() const { return !!LocalChildAt(0); } /** * Return first/last/next/previous sibling of the accessible. */ - inline Accessible* NextSibling() const { return GetSiblingAtOffset(1); } - inline Accessible* PrevSibling() const { return GetSiblingAtOffset(-1); } - inline Accessible* FirstChild() const { return GetChildAt(0); } - inline Accessible* LastChild() const { + inline Accessible* LocalNextSibling() const { return GetSiblingAtOffset(1); } + inline Accessible* LocalPrevSibling() const { return GetSiblingAtOffset(-1); } + inline Accessible* LocalFirstChild() const { return LocalChildAt(0); } + inline Accessible* LocalLastChild() const { uint32_t childCount = ChildCount(); - return childCount != 0 ? GetChildAt(childCount - 1) : nullptr; + return childCount != 0 ? LocalChildAt(childCount - 1) : nullptr; } /** * Return embedded accessible children count. */ uint32_t EmbeddedChildCount(); /**
--- a/accessible/generic/ApplicationAccessible.cpp +++ b/accessible/generic/ApplicationAccessible.cpp @@ -75,17 +75,19 @@ GroupPos ApplicationAccessible::GroupPos Accessible* ApplicationAccessible::ChildAtPoint( int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) { return nullptr; } Accessible* ApplicationAccessible::FocusedChild() { Accessible* focus = FocusMgr()->FocusedAccessible(); - if (focus && focus->Parent() == this) return focus; + if (focus && focus->LocalParent() == this) { + return focus; + } return nullptr; } Relation ApplicationAccessible::RelationByType( RelationType aRelationType) const { return Relation(); }
--- a/accessible/generic/BaseAccessibles.cpp +++ b/accessible/generic/BaseAccessibles.cpp @@ -113,17 +113,17 @@ const Accessible* LinkableAccessible::Ac } return nullptr; } // XXX: The logic looks broken since the click listener may be registered // on non accessible node in parent chain but this node is skipped when tree // is traversed. const Accessible* walkUpAcc = this; - while ((walkUpAcc = walkUpAcc->Parent()) && !walkUpAcc->IsDoc()) { + while ((walkUpAcc = walkUpAcc->LocalParent()) && !walkUpAcc->IsDoc()) { if (walkUpAcc->LinkState() & states::LINKED) { if (aIsLink) { *aIsLink = true; } return walkUpAcc; } if (nsCoreUtils::HasClickListener(walkUpAcc->GetContent())) {
--- a/accessible/generic/DocAccessible-inl.h +++ b/accessible/generic/DocAccessible-inl.h @@ -23,17 +23,17 @@ namespace mozilla { namespace a11y { inline Accessible* DocAccessible::AccessibleOrTrueContainer( nsINode* aNode, bool aNoContainerIfPruned) const { // HTML comboboxes have no-content list accessible as an intermediate // containing all options. Accessible* container = GetAccessibleOrContainer(aNode, aNoContainerIfPruned); if (container && container->IsHTMLCombobox()) { - return container->FirstChild(); + return container->LocalFirstChild(); } return container; } inline nsIAccessiblePivot* DocAccessible::VirtualCursor() { if (!mVirtualCursor) { mVirtualCursor = new nsAccessiblePivot(this); mVirtualCursor->AddObserver(this);
--- a/accessible/generic/DocAccessible.cpp +++ b/accessible/generic/DocAccessible.cpp @@ -1757,17 +1757,17 @@ void DocAccessible::DoInitialUpdate() { } #endif // Fire reorder event after the document tree is constructed. Note, since // this reorder event is processed by parent document then events targeted to // this document may be fired prior to this reorder event. If this is // a problem then consider to keep event processing per tab document. if (!IsRoot()) { - RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(Parent()); + RefPtr<AccReorderEvent> reorderEvent = new AccReorderEvent(LocalParent()); ParentDocument()->FireDelayedEvent(reorderEvent); } if (IPCAccessibilityActive()) { DocAccessibleChild* ipcDoc = IPCDoc(); MOZ_ASSERT(ipcDoc); if (ipcDoc) { for (auto idx = 0U; idx < mChildren.Length(); idx++) { @@ -2030,17 +2030,17 @@ bool InsertIterator::Next() { // what means there's no container. Ignore the insertion too. if (container != Context()) { continue; } // HTML comboboxes have no-content list accessible as an intermediate // containing all options. if (container->IsHTMLCombobox()) { - container = container->FirstChild(); + container = container->LocalFirstChild(); } if (!container->IsAcceptableChild(node)) { continue; } #ifdef A11Y_LOG logging::TreeInfo("traversing an inserted node", logging::eVerbose, @@ -2092,22 +2092,22 @@ void DocAccessible::ProcessContentInsert } #ifdef A11Y_LOG logging::TreeInfo("children before insertion", logging::eVerbose, aContainer); #endif TreeMutation mt(aContainer); do { - Accessible* parent = iter.Child()->Parent(); + Accessible* parent = iter.Child()->LocalParent(); if (parent) { Accessible* previousSibling = iter.ChildBefore(); if (parent != aContainer || - iter.Child()->PrevSibling() != previousSibling) { - if (previousSibling && previousSibling->Parent() != aContainer) { + iter.Child()->LocalPrevSibling() != previousSibling) { + if (previousSibling && previousSibling->LocalParent() != aContainer) { // previousSibling hasn't been moved into aContainer yet. // previousSibling should be later in the insertion list, so the tree // will get adjusted when we process it later. MOZ_DIAGNOSTIC_ASSERT(parent == aContainer, "Child moving to new parent, but previous " "sibling in wrong parent"); continue; } @@ -2191,22 +2191,22 @@ void DocAccessible::FireEventsOnInsertio // if it did. if (aContainer->IsAlert() || aContainer->IsInsideAlert()) { Accessible* ancestor = aContainer; do { if (ancestor->IsAlert()) { FireDelayedEvent(nsIAccessibleEvent::EVENT_ALERT, ancestor); break; } - } while ((ancestor = ancestor->Parent())); + } while ((ancestor = ancestor->LocalParent())); } } void DocAccessible::ContentRemoved(Accessible* aChild) { - Accessible* parent = aChild->Parent(); + Accessible* parent = aChild->LocalParent(); MOZ_DIAGNOSTIC_ASSERT(parent, "Unattached accessible from tree"); #ifdef A11Y_LOG logging::TreeInfo("process content removal", 0, "container", parent, "child", aChild, nullptr); #endif // XXX: event coalescence may kill us @@ -2216,27 +2216,27 @@ void DocAccessible::ContentRemoved(Acces mt.BeforeRemoval(aChild); if (aChild->IsDefunct()) { MOZ_ASSERT_UNREACHABLE("Event coalescence killed the accessible"); mt.Done(); return; } - MOZ_DIAGNOSTIC_ASSERT(aChild->Parent(), "Alive but unparented #1"); + MOZ_DIAGNOSTIC_ASSERT(aChild->LocalParent(), "Alive but unparented #1"); if (aChild->IsRelocated()) { nsTArray<RefPtr<Accessible>>* owned = mARIAOwnsHash.Get(parent); MOZ_ASSERT(owned, "IsRelocated flag is out of sync with mARIAOwnsHash"); owned->RemoveElement(aChild); if (owned->Length() == 0) { mARIAOwnsHash.Remove(parent); } } - MOZ_DIAGNOSTIC_ASSERT(aChild->Parent(), "Unparented #2"); + MOZ_DIAGNOSTIC_ASSERT(aChild->LocalParent(), "Unparented #2"); parent->RemoveChild(aChild); UncacheChildrenInSubtree(aChild); mt.Done(); } void DocAccessible::ContentRemoved(nsIContent* aContentNode) { // If child node is not accessible then look for its accessible children. @@ -2335,17 +2335,17 @@ void DocAccessible::DoARIAOwnsRelocation child, nullptr); #endif if (owned->IndexOf(child) < idx) { continue; // ignore second entry of same ID } // Same child on same position, no change. - if (child->Parent() == aOwner) { + if (child->LocalParent() == aOwner) { int32_t indexInParent = child->IndexInParent(); // The child is being placed in its current index, // eg. aria-owns='id1 id2 id3' is changed to aria-owns='id3 id2 id1'. if (indexInParent == static_cast<int32_t>(insertIdx)) { MOZ_ASSERT(child->IsRelocated(), "A child, having an index in parent from aria ownded " "indices range, has to be aria owned"); @@ -2367,25 +2367,25 @@ void DocAccessible::DoARIAOwnsRelocation idx++; continue; } } MOZ_ASSERT(owned->SafeElementAt(idx) != child, "Already in place!"); // A new child is found, check for loops. - if (child->Parent() != aOwner) { + if (child->LocalParent() != aOwner) { // Child is aria-owned by another container, skip. if (child->IsRelocated()) { continue; } Accessible* parent = aOwner; while (parent && parent != child && !parent->IsDoc()) { - parent = parent->Parent(); + parent = parent->LocalParent(); } // A referred child cannot be a parent of the owner. if (parent == child) { continue; } } if (MoveChild(child, aOwner, insertIdx)) { @@ -2410,17 +2410,17 @@ void DocAccessible::PutChildrenBack(nsTA for (auto idx = aStartIdx; idx < aChildren->Length(); idx++) { Accessible* child = aChildren->ElementAt(idx); if (!child->IsInDocument()) { continue; } // Remove the child from the owner - Accessible* owner = child->Parent(); + Accessible* owner = child->LocalParent(); if (!owner) { NS_ERROR("Cannot put the child back. No parent, a broken tree."); continue; } #ifdef A11Y_LOG logging::TreeInfo("aria owns put child back", 0, "old parent", owner, "child", child, nullptr); @@ -2434,19 +2434,19 @@ void DocAccessible::PutChildrenBack(nsTA Accessible* origContainer = AccessibleOrTrueContainer(content->GetFlattenedTreeParentNode()); if (origContainer) { TreeWalker walker(origContainer); if (walker.Seek(content)) { Accessible* prevChild = walker.Prev(); if (prevChild) { idxInParent = prevChild->IndexInParent() + 1; - MOZ_DIAGNOSTIC_ASSERT(origContainer == prevChild->Parent(), + MOZ_DIAGNOSTIC_ASSERT(origContainer == prevChild->LocalParent(), "Broken tree"); - origContainer = prevChild->Parent(); + origContainer = prevChild->LocalParent(); } else { idxInParent = 0; } } } // The child may have already be in its ordinal place for 2 reasons: // 1. It was the last ordinal child, and the first aria-owned child. @@ -2455,37 +2455,39 @@ void DocAccessible::PutChildrenBack(nsTA // 2. The preceding adopted children were just reclaimed, eg: // given: <ul id="list"><li id="b"></li></ul> // after load: $("list").setAttribute("aria-owns", "a b"); // later: $("list").setAttribute("aria-owns", ""); if (origContainer != owner || child->IndexInParent() != idxInParent) { DebugOnly<bool> moved = MoveChild(child, origContainer, idxInParent); MOZ_ASSERT(moved, "Failed to put child back."); } else { - MOZ_ASSERT(!child->PrevSibling() || !child->PrevSibling()->IsRelocated(), + MOZ_ASSERT(!child->LocalPrevSibling() || + !child->LocalPrevSibling()->IsRelocated(), "No relocated child should appear before this one"); - MOZ_ASSERT(!child->NextSibling() || child->NextSibling()->IsRelocated(), + MOZ_ASSERT(!child->LocalNextSibling() || + child->LocalNextSibling()->IsRelocated(), "No ordinal child should appear after this one"); } } aChildren->RemoveLastElements(aChildren->Length() - aStartIdx); } bool DocAccessible::MoveChild(Accessible* aChild, Accessible* aNewParent, int32_t aIdxInParent) { MOZ_ASSERT(aChild, "No child"); - MOZ_ASSERT(aChild->Parent(), "No parent"); + MOZ_ASSERT(aChild->LocalParent(), "No parent"); // We can't guarantee MoveChild works correctly for accessibilities storing // children outside mChildren. MOZ_ASSERT( aIdxInParent <= static_cast<int32_t>(aNewParent->mChildren.Length()), "Wrong insertion point for a moving child"); - Accessible* curParent = aChild->Parent(); + Accessible* curParent = aChild->LocalParent(); if (!aNewParent->IsAcceptableChild(aChild->GetContent())) { return false; } #ifdef A11Y_LOG logging::TreeInfo("move child", 0, "old parent", curParent, "new parent", aNewParent, "child", aChild, nullptr); @@ -2550,17 +2552,17 @@ bool DocAccessible::MoveChild(Accessible void DocAccessible::CacheChildrenInSubtree(Accessible* aRoot, Accessible** aFocusedAcc) { // If the accessible is focused then report a focus event after all related // mutation events. if (aFocusedAcc && !*aFocusedAcc && FocusMgr()->HasDOMFocus(aRoot->GetContent())) *aFocusedAcc = aRoot; - Accessible* root = aRoot->IsHTMLCombobox() ? aRoot->FirstChild() : aRoot; + Accessible* root = aRoot->IsHTMLCombobox() ? aRoot->LocalFirstChild() : aRoot; if (root->KidsFromDOM()) { TreeMutation mt(root, TreeMutation::kNoEvents); TreeWalker walker(root); while (Accessible* child = walker.Next()) { if (child->IsBoundToParent()) { MoveChild(child, root, root->mChildren.Length()); continue; }
--- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -287,38 +287,38 @@ void HyperTextAccessible::TextSubstring( int32_t endChildIdx = GetChildIndexAtOffset(endOffset); if (endChildIdx == -1) return; if (startChildIdx == endChildIdx) { int32_t childOffset = GetChildOffset(startChildIdx); if (childOffset == -1) return; - Accessible* child = GetChildAt(startChildIdx); + Accessible* child = LocalChildAt(startChildIdx); child->AppendTextTo(aText, startOffset - childOffset, endOffset - startOffset); return; } int32_t startChildOffset = GetChildOffset(startChildIdx); if (startChildOffset == -1) return; - Accessible* startChild = GetChildAt(startChildIdx); + Accessible* startChild = LocalChildAt(startChildIdx); startChild->AppendTextTo(aText, startOffset - startChildOffset); for (int32_t childIdx = startChildIdx + 1; childIdx < endChildIdx; childIdx++) { - Accessible* child = GetChildAt(childIdx); + Accessible* child = LocalChildAt(childIdx); child->AppendTextTo(aText); } int32_t endChildOffset = GetChildOffset(endChildIdx); if (endChildOffset == -1) return; - Accessible* endChild = GetChildAt(endChildIdx); + Accessible* endChild = LocalChildAt(endChildIdx); endChild->AppendTextTo(aText, 0, endOffset - endChildOffset); } uint32_t HyperTextAccessible::DOMPointToOffset(nsINode* aNode, int32_t aNodeOffset, bool aIsEndOffset) const { if (!aNode) return 0; @@ -401,34 +401,35 @@ uint32_t HyperTextAccessible::DOMPointTo uint32_t HyperTextAccessible::TransformOffset(Accessible* aDescendant, uint32_t aOffset, bool aIsEndOffset) const { // From the descendant, go up and get the immediate child of this hypertext. uint32_t offset = aOffset; Accessible* descendant = aDescendant; while (descendant) { - Accessible* parent = descendant->Parent(); + Accessible* parent = descendant->LocalParent(); if (parent == this) return GetChildOffset(descendant) + offset; // This offset no longer applies because the passed-in text object is not // a child of the hypertext. This happens when there are nested hypertexts, // e.g. <div>abc<h1>def</h1>ghi</div>. Thus we need to adjust the offset // to make it relative the hypertext. // If the end offset is not supposed to be inclusive and the original point // is not at 0 offset then the returned offset should be after an embedded // character the original point belongs to. if (aIsEndOffset) { // Similar to our special casing in FindOffset, we add handling for // bulleted lists here because PeekOffset returns the inner text node // for a list when it should return the list bullet. // We manually set the offset so the error doesn't propagate up. if (offset == 0 && parent && parent->IsHTMLListItem() && - descendant->PrevSibling() && descendant->PrevSibling()->GetFrame() && - descendant->PrevSibling()->GetFrame()->IsBulletFrame()) { + descendant->LocalPrevSibling() && + descendant->LocalPrevSibling()->GetFrame() && + descendant->LocalPrevSibling()->GetFrame()->IsBulletFrame()) { offset = 0; } else { offset = (offset > 0 || descendant->IndexInParent() > 0) ? 1 : 0; } } else { offset = 0; } @@ -450,17 +451,17 @@ DOMPoint HyperTextAccessible::OffsetToDO return DOMPoint(textEditor->GetRoot(), 0); } } } int32_t childIdx = GetChildIndexAtOffset(aOffset); if (childIdx == -1) return DOMPoint(); - Accessible* child = GetChildAt(childIdx); + Accessible* child = LocalChildAt(childIdx); int32_t innerOffset = aOffset - GetChildOffset(childIdx); // A text leaf case. if (child->IsTextLeaf()) { // The point is inside the text node. This is always true for any text leaf // except a last child one. See assertion below. if (aOffset < GetChildOffset(childIdx + 1)) { nsIContent* content = child->GetContent(); @@ -504,17 +505,17 @@ uint32_t HyperTextAccessible::FindOffset // We can have an empty text leaf as our only child. Since empty text // leaves are not accessible we then have no children, but 0 is a valid // innerOffset. if (childIdx == -1) { NS_ASSERTION(innerOffset == 0 && !text->ChildCount(), "No childIdx?"); return DOMPointToOffset(text->GetNode(), 0, aDirection == eDirNext); } - child = text->GetChildAt(childIdx); + child = text->LocalChildAt(childIdx); // HTML list items may need special processing because PeekOffset doesn't // work with list bullets. if (text->IsHTMLListItem()) { HTMLLIAccessible* li = text->AsHTMLListItem(); if (child == li->Bullet()) { // XXX: the logic is broken for multichar bullets in moving by // char/cluster/word cases. @@ -1259,17 +1260,17 @@ int32_t HyperTextAccessible::GetLevelInt return heading->AccessibilityLevel(); } return AccessibleWrap::GetLevelInternal(); } void HyperTextAccessible::SetMathMLXMLRoles( nsIPersistentProperties* aAttributes) { // Add MathML xmlroles based on the position inside the parent. - Accessible* parent = Parent(); + Accessible* parent = LocalParent(); if (parent) { switch (parent->Role()) { case roles::MATHML_CELL: case roles::MATHML_ENCLOSED: case roles::MATHML_ERROR: case roles::MATHML_MATH: case roles::MATHML_ROW: case roles::MATHML_SQUARE_ROOT: @@ -1279,20 +1280,20 @@ void HyperTextAccessible::SetMathMLXMLRo // See http://www.w3.org/TR/MathML3/chapter3.html#presm.inferredmrow // XXX We should probably do something similar for MATHML_FENCED, but // operators do not appear in the accessible tree. See bug 1175747. nsIMathMLFrame* mathMLFrame = do_QueryFrame(GetFrame()); if (mathMLFrame) { nsEmbellishData embellishData; mathMLFrame->GetEmbellishData(embellishData); if (NS_MATHML_EMBELLISH_IS_FENCE(embellishData.flags)) { - if (!PrevSibling()) { + if (!LocalPrevSibling()) { nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::xmlroles, nsGkAtoms::open_fence); - } else if (!NextSibling()) { + } else if (!LocalNextSibling()) { nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::xmlroles, nsGkAtoms::close_fence); } } if (NS_MATHML_EMBELLISH_IS_SEPARATOR(embellishData.flags)) { nsAccUtils::SetAccAttr(aAttributes, nsGkAtoms::xmlroles, nsGkAtoms::separator_); } @@ -1537,17 +1538,17 @@ nsIntRect HyperTextAccessible::TextBound int32_t childIdx = GetChildIndexAtOffset(startOffset); if (childIdx == -1) return nsIntRect(); nsIntRect bounds; int32_t prevOffset = GetChildOffset(childIdx); int32_t offset1 = startOffset - prevOffset; while (childIdx < static_cast<int32_t>(ChildCount())) { - nsIFrame* frame = GetChildAt(childIdx++)->GetFrame(); + nsIFrame* frame = LocalChildAt(childIdx++)->GetFrame(); if (!frame) { MOZ_ASSERT_UNREACHABLE("No frame for a child!"); continue; } int32_t nextOffset = GetChildOffset(childIdx); if (nextOffset >= static_cast<int32_t>(endOffset)) { bounds.UnionRect( @@ -1580,26 +1581,26 @@ nsIntRect HyperTextAccessible::TextBound bounds.MoveTo(boundsX, boundsY); return bounds; } already_AddRefed<TextEditor> HyperTextAccessible::GetEditor() const { if (!mContent->HasFlag(NODE_IS_EDITABLE)) { // If we're inside an editable container, then return that container's // editor - Accessible* ancestor = Parent(); + Accessible* ancestor = LocalParent(); while (ancestor) { HyperTextAccessible* hyperText = ancestor->AsHyperText(); if (hyperText) { // Recursion will stop at container doc because it has its own impl // of GetEditor() return hyperText->GetEditor(); } - ancestor = ancestor->Parent(); + ancestor = ancestor->LocalParent(); } return nullptr; } nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mContent); nsCOMPtr<nsIEditingSession> editingSession; docShell->GetEditingSession(getter_AddRefs(editingSession)); @@ -2032,18 +2033,19 @@ void HyperTextAccessible::RangeByChild(A HyperTextAccessible* ht = aChild->AsHyperText(); if (ht) { aRange.Set(mDoc, ht, 0, ht, ht->CharacterCount()); return; } Accessible* child = aChild; Accessible* parent = nullptr; - while ((parent = child->Parent()) && !(ht = parent->AsHyperText())) + while ((parent = child->LocalParent()) && !(ht = parent->AsHyperText())) { child = parent; + } // If no text then return collapsed text range, otherwise return a range // containing the text enclosed by the given child. if (ht) { int32_t childIdx = child->IndexInParent(); int32_t startOffset = ht->GetChildOffset(childIdx); int32_t endOffset = child->IsTextLeaf() ? ht->GetChildOffset(childIdx + 1) : startOffset; @@ -2052,17 +2054,19 @@ void HyperTextAccessible::RangeByChild(A } void HyperTextAccessible::RangeAtPoint(int32_t aX, int32_t aY, a11y::TextRange& aRange) const { Accessible* child = mDoc->ChildAtPoint(aX, aY, eDeepestChild); if (!child) return; Accessible* parent = nullptr; - while ((parent = child->Parent()) && !parent->IsHyperText()) child = parent; + while ((parent = child->LocalParent()) && !parent->IsHyperText()) { + child = parent; + } // Return collapsed text range for the point. if (parent) { HyperTextAccessible* ht = parent->AsHyperText(); int32_t offset = ht->GetChildOffset(child); aRange.Set(mDoc, ht, offset, ht, offset); } } @@ -2117,31 +2121,31 @@ bool HyperTextAccessible::InsertChildAt( } Relation HyperTextAccessible::RelationByType(RelationType aType) const { Relation rel = Accessible::RelationByType(aType); switch (aType) { case RelationType::NODE_CHILD_OF: if (HasOwnContent() && mContent->IsMathMLElement()) { - Accessible* parent = Parent(); + Accessible* parent = LocalParent(); if (parent) { nsIContent* parentContent = parent->GetContent(); if (parentContent && parentContent->IsMathMLElement(nsGkAtoms::mroot_)) { // Add a relation pointing to the parent <mroot>. rel.AppendTarget(parent); } } } break; case RelationType::NODE_PARENT_OF: if (HasOwnContent() && mContent->IsMathMLElement(nsGkAtoms::mroot_)) { - Accessible* base = GetChildAt(0); - Accessible* index = GetChildAt(1); + Accessible* base = LocalChildAt(0); + Accessible* index = LocalChildAt(1); if (base && index) { // Append the <mroot> children in the order index, base. rel.AppendTarget(index); rel.AppendTarget(base); } } break; default: @@ -2247,17 +2251,17 @@ int32_t HyperTextAccessible::GetChildInd } return (index == offsetCount) ? -1 : index; } } uint32_t childCount = ChildCount(); while (mOffsets.Length() < childCount) { - Accessible* child = GetChildAt(mOffsets.Length()); + Accessible* child = LocalChildAt(mOffsets.Length()); lastOffset += nsAccUtils::TextLength(child); mOffsets.AppendElement(lastOffset); if (aOffset < lastOffset) return mOffsets.Length() - 1; } if (aOffset == lastOffset) return mOffsets.Length() - 1; return -1;
--- a/accessible/generic/HyperTextAccessible.h +++ b/accessible/generic/HyperTextAccessible.h @@ -162,17 +162,17 @@ class HyperTextAccessible : public Acces bool CharAt(int32_t aOffset, nsAString& aChar, int32_t* aStartOffset = nullptr, int32_t* aEndOffset = nullptr) { NS_ASSERTION(!aStartOffset == !aEndOffset, "Offsets should be both defined or both undefined!"); int32_t childIdx = GetChildIndexAtOffset(aOffset); if (childIdx == -1) return false; - Accessible* child = GetChildAt(childIdx); + Accessible* child = LocalChildAt(childIdx); child->AppendTextTo(aChar, aOffset - GetChildOffset(childIdx), 1); if (aStartOffset && aEndOffset) { *aStartOffset = aOffset; *aEndOffset = aOffset + aChar.Length(); } return true; } @@ -255,17 +255,17 @@ class HyperTextAccessible : public Acces int32_t GetChildIndexAtOffset(uint32_t aOffset) const; /** * Return child accessible at the given text offset. * * @param aOffset [in] the given text offset */ Accessible* GetChildAtOffset(uint32_t aOffset) const { - return GetChildAt(GetChildIndexAtOffset(aOffset)); + return LocalChildAt(GetChildIndexAtOffset(aOffset)); } /** * Return true if the given offset/range is valid. */ bool IsValidOffset(int32_t aOffset); bool IsValidRange(int32_t aStartOffset, int32_t aEndOffset);
--- a/accessible/generic/OuterDocAccessible.cpp +++ b/accessible/generic/OuterDocAccessible.cpp @@ -80,17 +80,17 @@ role OuterDocAccessible::NativeRole() co Accessible* OuterDocAccessible::ChildAtPoint(int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) { nsIntRect docRect = Bounds(); if (!docRect.Contains(aX, aY)) return nullptr; // Always return the inner doc as direct child accessible unless bounds // outside of it. - Accessible* child = GetChildAt(0); + Accessible* child = LocalChildAt(0); NS_ENSURE_TRUE(child, nullptr); if (aWhichChild == eDeepestChild) { #if defined(XP_WIN) // On Windows, OuterDocAccessible::GetChildAt can return a proxy wrapper // for a remote document. These aren't real Accessibles and // shouldn't be returned except to the Windows a11y code (which doesn't use // eDeepestChild). Calling ChildAtPoint on these will crash! @@ -219,18 +219,18 @@ Accessible* OuterDocAccessible::RemoteCh uint32_t OuterDocAccessible::ChildCount() const { uint32_t result = mChildren.Length(); if (!result && RemoteChildDocAccessible()) { result = 1; } return result; } -Accessible* OuterDocAccessible::GetChildAt(uint32_t aIndex) const { - Accessible* result = AccessibleWrap::GetChildAt(aIndex); +Accessible* OuterDocAccessible::LocalChildAt(uint32_t aIndex) const { + Accessible* result = AccessibleWrap::LocalChildAt(aIndex); if (result || aIndex) { return result; } // If we are asking for child 0 and GetChildAt doesn't return anything, try // to get the remote child doc and return that instead. return RemoteChildDocAccessible(); }
--- a/accessible/generic/OuterDocAccessible.h +++ b/accessible/generic/OuterDocAccessible.h @@ -54,17 +54,17 @@ class OuterDocAccessible final : public EWhichChildAtPoint aWhichChild) override; virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override; virtual bool RemoveChild(Accessible* aAccessible) override; virtual bool IsAcceptableChild(nsIContent* aEl) const override; #if defined(XP_WIN) virtual uint32_t ChildCount() const override; - virtual Accessible* GetChildAt(uint32_t aIndex) const override; + virtual Accessible* LocalChildAt(uint32_t aIndex) const override; #endif // defined(XP_WIN) protected: virtual ~OuterDocAccessible() override; }; inline OuterDocAccessible* Accessible::AsOuterDoc() { return IsOuterDoc() ? static_cast<OuterDocAccessible*>(this) : nullptr;
--- a/accessible/generic/RootAccessible.cpp +++ b/accessible/generic/RootAccessible.cpp @@ -496,17 +496,17 @@ void RootAccessible::HandlePopupShownEve // Don't fire menupopup events for combobox and autocomplete lists. nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_START, aAccessible); return; } if (role == roles::COMBOBOX_LIST) { // Fire expanded state change event for comboboxes and autocompeletes. - Accessible* combobox = aAccessible->Parent(); + Accessible* combobox = aAccessible->LocalParent(); if (!combobox) return; if (combobox->IsCombobox() || combobox->IsAutoComplete()) { RefPtr<AccEvent> event = new AccStateChangeEvent(combobox, states::EXPANDED, true); nsEventShell::FireEvent(event); } @@ -545,17 +545,17 @@ void RootAccessible::HandlePopupHidingEv // autocomplete popups. Accessible* popup = document->GetAccessible(aPopupNode); if (!popup) { Accessible* popupContainer = document->GetContainerAccessible(aPopupNode); if (!popupContainer) return; uint32_t childCount = popupContainer->ChildCount(); for (uint32_t idx = 0; idx < childCount; idx++) { - Accessible* child = popupContainer->GetChildAt(idx); + Accessible* child = popupContainer->LocalChildAt(idx); if (child->IsAutoCompletePopup()) { popup = child; break; } } // No popup no events. Focus is managed by DOM. This is a case for // menupopups of menus on Linux since there are no accessible for popups.
--- a/accessible/generic/TableAccessible.cpp +++ b/accessible/generic/TableAccessible.cpp @@ -70,17 +70,17 @@ bool TableAccessible::IsProbablyLayoutTa } // Check for legitimate data table attributes. if (el->Element::HasNonEmptyAttr(nsGkAtoms::summary)) { RETURN_LAYOUT_ANSWER(false, "Has summary -- legitimate table structures"); } // Check for legitimate data table elements. - Accessible* caption = thisacc->FirstChild(); + Accessible* caption = thisacc->LocalFirstChild(); if (caption && caption->IsHTMLCaption() && caption->HasChildren()) { RETURN_LAYOUT_ANSWER(false, "Not empty caption -- legitimate table structures"); } for (nsIContent* childElm = el->GetFirstChild(); childElm; childElm = childElm->GetNextSibling()) { if (!childElm->IsHTMLElement()) continue; @@ -130,17 +130,17 @@ bool TableAccessible::IsProbablyLayoutTa roleMapEntry->role != roles::COLUMNHEADER && roleMapEntry->role != roles::ROWHEADER && roleMapEntry->role != roles::GRID_CELL) { RETURN_LAYOUT_ANSWER(true, "Repurposed cell with different role"); } } if (cell->ChildCount() == 1 && - cell->FirstChild()->IsAbbreviation()) { + cell->LocalFirstChild()->IsAbbreviation()) { RETURN_LAYOUT_ANSWER( false, "has abbr -- legitimate table structures"); } } } } } } @@ -193,17 +193,17 @@ bool TableAccessible::IsProbablyLayoutTa // forward. // Check for styled background color across rows (alternating background // color is a common feature for data tables). auto childCount = thisacc->ChildCount(); nscolor rowColor = 0; nscolor prevRowColor; for (auto childIdx = 0U; childIdx < childCount; childIdx++) { - Accessible* child = thisacc->GetChildAt(childIdx); + Accessible* child = thisacc->LocalChildAt(childIdx); if (child->IsHTMLTableRow()) { prevRowColor = rowColor; nsIFrame* rowFrame = child->GetFrame(); MOZ_ASSERT(rowFrame, "Table hierarchy got screwed up"); if (!rowFrame) { RETURN_LAYOUT_ANSWER(false, "Unexpected table hierarchy"); }
--- a/accessible/html/HTMLElementAccessibles.cpp +++ b/accessible/html/HTMLElementAccessibles.cpp @@ -155,17 +155,17 @@ HTMLSummaryAccessible* HTMLSummaryAccess return nullptr; } HTMLSummaryAccessible* summaryAccessible = nullptr; for (uint32_t i = 0; i < details->ChildCount(); i++) { // Iterate through the children of our details accessible to locate main // summary. This iteration includes the anonymous summary if the details // element was not explicitly created with one. - Accessible* child = details->GetChildAt(i); + Accessible* child = details->LocalChildAt(i); auto* summary = mozilla::dom::HTMLSummaryElement::FromNodeOrNull(child->GetContent()); if (summary && summary->IsMainSummary()) { summaryAccessible = static_cast<HTMLSummaryAccessible*>(child); break; } }
--- a/accessible/html/HTMLFormControlAccessible.cpp +++ b/accessible/html/HTMLFormControlAccessible.cpp @@ -444,17 +444,17 @@ nsresult HTMLFileInputAccessible::Handle // Redirect state change events for inherited states to child controls. Note, // unavailable state is not redirected. That's a standard for unavailable // state handling. AccStateChangeEvent* event = downcast_accEvent(aEvent); if (event && (event->GetState() == states::BUSY || event->GetState() == states::REQUIRED || event->GetState() == states::HASPOPUP || event->GetState() == states::INVALID)) { - Accessible* button = GetChildAt(0); + Accessible* button = LocalChildAt(0); if (button && button->Role() == roles::PUSHBUTTON) { RefPtr<AccStateChangeEvent> childEvent = new AccStateChangeEvent( button, event->GetState(), event->IsStateEnabled(), event->FromUserInput()); nsEventShell::FireEvent(childEvent); } } @@ -464,17 +464,17 @@ nsresult HTMLFileInputAccessible::Handle Accessible* HTMLFileInputAccessible::CurrentItem() const { // Allow aria-activedescendant to override. if (Accessible* item = HyperTextAccessibleWrap::CurrentItem()) { return item; } // The HTML file input itself gets DOM focus, not the button inside it. // For a11y, we want the button to get focus. - Accessible* button = FirstChild(); + Accessible* button = LocalFirstChild(); if (!button) { MOZ_ASSERT_UNREACHABLE("File input doesn't contain a button"); return nullptr; } MOZ_ASSERT(button->IsButton()); return button; } @@ -628,17 +628,17 @@ Relation HTMLGroupboxAccessible::Relatio HTMLLegendAccessible::HTMLLegendAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc) {} Relation HTMLLegendAccessible::RelationByType(RelationType aType) const { Relation rel = HyperTextAccessibleWrap::RelationByType(aType); if (aType != RelationType::LABEL_FOR) return rel; - Accessible* groupbox = Parent(); + Accessible* groupbox = LocalParent(); if (groupbox && groupbox->Role() == roles::GROUPING) rel.AppendTarget(groupbox); return rel; } //////////////////////////////////////////////////////////////////////////////// // HTMLFigureAccessible @@ -686,17 +686,17 @@ nsIContent* HTMLFigureAccessible::Captio HTMLFigcaptionAccessible::HTMLFigcaptionAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc) {} Relation HTMLFigcaptionAccessible::RelationByType(RelationType aType) const { Relation rel = HyperTextAccessibleWrap::RelationByType(aType); if (aType != RelationType::LABEL_FOR) return rel; - Accessible* figure = Parent(); + Accessible* figure = LocalParent(); if (figure && figure->GetContent()->NodeInfo()->Equals( nsGkAtoms::figure, mContent->GetNameSpaceID())) { rel.AppendTarget(figure); } return rel; }
--- a/accessible/html/HTMLImageMapAccessible.cpp +++ b/accessible/html/HTMLImageMapAccessible.cpp @@ -36,22 +36,22 @@ HTMLImageMapAccessible::HTMLImageMapAcce role HTMLImageMapAccessible::NativeRole() const { return roles::IMAGE_MAP; } //////////////////////////////////////////////////////////////////////////////// // HTMLImageMapAccessible: HyperLinkAccessible uint32_t HTMLImageMapAccessible::AnchorCount() { return ChildCount(); } Accessible* HTMLImageMapAccessible::AnchorAt(uint32_t aAnchorIndex) { - return GetChildAt(aAnchorIndex); + return LocalChildAt(aAnchorIndex); } already_AddRefed<nsIURI> HTMLImageMapAccessible::AnchorURIAt( uint32_t aAnchorIndex) const { - Accessible* area = GetChildAt(aAnchorIndex); + Accessible* area = LocalChildAt(aAnchorIndex); if (!area) return nullptr; nsIContent* linkContent = area->GetContent(); return linkContent ? linkContent->GetHrefURI() : nullptr; } //////////////////////////////////////////////////////////////////////////////// // HTMLImageMapAccessible: public
--- a/accessible/html/HTMLSelectAccessible.cpp +++ b/accessible/html/HTMLSelectAccessible.cpp @@ -166,17 +166,17 @@ uint64_t HTMLSelectOptionAccessible::Nat state &= ~(states::OFFSCREEN | states::INVISIBLE); state |= selectState & states::OPAQUE1; } } else { // XXX list frames are weird, don't rely on Accessible's general // visibility implementation unless they get reimplemented in layout state &= ~states::OFFSCREEN; // <select> is not collapsed: compare bounds to calculate OFFSCREEN - Accessible* listAcc = Parent(); + Accessible* listAcc = LocalParent(); if (listAcc) { nsIntRect optionRect = Bounds(); nsIntRect listRect = listAcc->Bounds(); if (optionRect.Y() < listRect.Y() || optionRect.YMost() > listRect.YMost()) { state |= states::OFFSCREEN; } } @@ -229,18 +229,20 @@ void HTMLSelectOptionAccessible::SetSele HTMLOptionElement* option = HTMLOptionElement::FromNode(mContent); if (option) option->SetSelected(aSelect); } //////////////////////////////////////////////////////////////////////////////// // HTMLSelectOptionAccessible: Widgets Accessible* HTMLSelectOptionAccessible::ContainerWidget() const { - Accessible* parent = Parent(); - if (parent && parent->IsHTMLOptGroup()) parent = parent->Parent(); + Accessible* parent = LocalParent(); + if (parent && parent->IsHTMLOptGroup()) { + parent = parent->LocalParent(); + } return parent && parent->IsListControl() ? parent : nullptr; } //////////////////////////////////////////////////////////////////////////////// // HTMLSelectOptGroupAccessible //////////////////////////////////////////////////////////////////////////////// @@ -454,17 +456,17 @@ uint64_t HTMLComboboxListAccessible::Nat return state; } nsRect HTMLComboboxListAccessible::RelativeBounds( nsIFrame** aBoundingFrame) const { *aBoundingFrame = nullptr; - Accessible* comboAcc = Parent(); + Accessible* comboAcc = LocalParent(); if (!comboAcc) return nsRect(); if (0 == (comboAcc->State() & states::COLLAPSED)) { return HTMLSelectListAccessible::RelativeBounds(aBoundingFrame); } // Get the first option. nsIContent* content = mContent->GetFirstChild();
--- a/accessible/html/HTMLSelectAccessible.h +++ b/accessible/html/HTMLSelectAccessible.h @@ -83,35 +83,39 @@ class HTMLSelectOptionAccessible : publi virtual ENameValueFlag NativeName(nsString& aName) const override; private: /** * Return a select accessible the option belongs to if any. */ Accessible* GetSelect() const { Accessible* parent = mParent; - if (parent && parent->IsHTMLOptGroup()) parent = parent->Parent(); + if (parent && parent->IsHTMLOptGroup()) { + parent = parent->LocalParent(); + } if (parent && parent->IsListControl()) { - Accessible* combobox = parent->Parent(); + Accessible* combobox = parent->LocalParent(); return combobox && combobox->IsCombobox() ? combobox : mParent; } return nullptr; } /** * Return a combobox accessible the option belongs to if any. */ Accessible* GetCombobox() const { Accessible* parent = mParent; - if (parent && parent->IsHTMLOptGroup()) parent = parent->Parent(); + if (parent && parent->IsHTMLOptGroup()) { + parent = parent->LocalParent(); + } if (parent && parent->IsListControl()) { - Accessible* combobox = parent->Parent(); + Accessible* combobox = parent->LocalParent(); return combobox && combobox->IsCombobox() ? combobox : nullptr; } return nullptr; } }; /*
--- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -89,17 +89,17 @@ HTMLTableCellAccessible::NativeAttribute nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx); // abbr attribute // Pick up object attribute from abbr DOM element (a child of the cell) or // from abbr DOM attribute. nsAutoString abbrText; if (ChildCount() == 1) { - Accessible* abbr = FirstChild(); + Accessible* abbr = LocalFirstChild(); if (abbr->IsAbbreviation()) { nsIContent* firstChildNode = abbr->GetContent()->GetFirstChild(); if (firstChildNode) { nsTextEquivUtils::AppendTextEquivFromTextContent(firstChildNode, &abbrText); } } } @@ -138,17 +138,17 @@ GroupPos HTMLTableCellAccessible::GroupP return HyperTextAccessibleWrap::GroupPosition(); } //////////////////////////////////////////////////////////////////////////////// // HTMLTableCellAccessible: TableCellAccessible implementation TableAccessible* HTMLTableCellAccessible::Table() const { Accessible* parent = const_cast<HTMLTableCellAccessible*>(this); - while ((parent = parent->Parent())) { + while ((parent = parent->LocalParent())) { if (parent->IsTable()) return parent->AsTable(); } return nullptr; } uint32_t HTMLTableCellAccessible::ColIdx() const { nsTableCellFrame* cellFrame = GetCellFrame(); @@ -793,14 +793,16 @@ nsTableWrapperFrame* HTMLTableAccessible } //////////////////////////////////////////////////////////////////////////////// // HTMLCaptionAccessible //////////////////////////////////////////////////////////////////////////////// Relation HTMLCaptionAccessible::RelationByType(RelationType aType) const { Relation rel = HyperTextAccessible::RelationByType(aType); - if (aType == RelationType::LABEL_FOR) rel.AppendTarget(Parent()); + if (aType == RelationType::LABEL_FOR) { + rel.AppendTarget(LocalParent()); + } return rel; } role HTMLCaptionAccessible::NativeRole() const { return roles::CAPTION; }
--- a/accessible/ipc/DocAccessibleChildBase.cpp +++ b/accessible/ipc/DocAccessibleChildBase.cpp @@ -64,33 +64,33 @@ void DocAccessibleChildBase::SerializeTr #if defined(XP_WIN) aTree.AppendElement(AccessibleData(id, msaaId, role, childCount, interfaces)); #else aTree.AppendElement(AccessibleData(id, role, childCount, interfaces)); #endif for (uint32_t i = 0; i < childCount; i++) { - SerializeTree(aRoot->GetChildAt(i), aTree); + SerializeTree(aRoot->LocalChildAt(i), aTree); } } void DocAccessibleChildBase::InsertIntoIpcTree(Accessible* aParent, Accessible* aChild, uint32_t aIdxInParent) { uint64_t parentID = aParent->IsDoc() ? 0 : reinterpret_cast<uint64_t>(aParent->UniqueID()); nsTArray<AccessibleData> shownTree; ShowEventData data(parentID, aIdxInParent, shownTree, true); SerializeTree(aChild, data.NewTree()); MaybeSendShowEvent(data, false); } void DocAccessibleChildBase::ShowEvent(AccShowEvent* aShowEvent) { - Accessible* parent = aShowEvent->Parent(); + Accessible* parent = aShowEvent->LocalParent(); uint64_t parentID = parent->IsDoc() ? 0 : reinterpret_cast<uint64_t>(parent->UniqueID()); uint32_t idxInParent = aShowEvent->GetAccessible()->IndexInParent(); nsTArray<AccessibleData> shownTree; ShowEventData data(parentID, idxInParent, shownTree, false); SerializeTree(aShowEvent->GetAccessible(), data.NewTree()); MaybeSendShowEvent(data, aShowEvent->IsFromUserInput()); }
--- a/accessible/mac/AccessibleWrap.mm +++ b/accessible/mac/AccessibleWrap.mm @@ -166,17 +166,17 @@ nsresult AccessibleWrap::HandleAccEvent( eventTarget = selEvent->Widget(); break; } case nsIAccessibleEvent::EVENT_TEXT_INSERTED: case nsIAccessibleEvent::EVENT_TEXT_REMOVED: { Accessible* acc = aEvent->GetAccessible(); // If there is a text input ancestor, use it as the event source. while (acc && GetTypeFromRole(acc->Role()) != [mozTextAccessible class]) { - acc = acc->Parent(); + acc = acc->LocalParent(); } eventTarget = acc ? acc : aEvent->GetAccessible(); break; } default: eventTarget = aEvent->GetAccessible(); break; }
--- a/accessible/mac/HyperTextAccessibleWrap.mm +++ b/accessible/mac/HyperTextAccessibleWrap.mm @@ -69,27 +69,27 @@ bool HyperTextIterator::NormalizeForward mCurrentStartOffset >= static_cast<int32_t>(mCurrentContainer->CharacterCount())) { // If this is the end of the current container, mutate to its parent's // end offset. if (!mCurrentContainer->IsLink()) { // If we are not a link, it is a root hypertext accessible. return false; } - if (!mCurrentContainer->Parent() || - !mCurrentContainer->Parent()->IsHyperText()) { + if (!mCurrentContainer->LocalParent() || + !mCurrentContainer->LocalParent()->IsHyperText()) { // If we are a link, but our parent is not a hypertext accessible // treat the current container as the root hypertext accessible. // This can be the case with some XUL containers that are not // hypertext accessibles. return false; } uint32_t endOffset = mCurrentContainer->EndOffset(); if (endOffset != 0) { - mCurrentContainer = mCurrentContainer->Parent()->AsHyperText(); + mCurrentContainer = mCurrentContainer->LocalParent()->AsHyperText(); mCurrentStartOffset = endOffset; if (mCurrentContainer == mEndContainer && mCurrentStartOffset >= mEndOffset) { // Reached end boundary. return false; } @@ -138,27 +138,27 @@ bool HyperTextIterator::NormalizeForward bool HyperTextIterator::NormalizeBackward() { if (mCurrentStartOffset == 0) { // If this is the start of the current container, mutate to its parent's // start offset. if (!mCurrentContainer->IsLink()) { // If we are not a link, it is a root hypertext accessible. return false; } - if (!mCurrentContainer->Parent() || - !mCurrentContainer->Parent()->IsHyperText()) { + if (!mCurrentContainer->LocalParent() || + !mCurrentContainer->LocalParent()->IsHyperText()) { // If we are a link, but our parent is not a hypertext accessible // treat the current container as the root hypertext accessible. // This can be the case with some XUL containers that are not // hypertext accessibles. return false; } uint32_t startOffset = mCurrentContainer->StartOffset(); - mCurrentContainer = mCurrentContainer->Parent()->AsHyperText(); + mCurrentContainer = mCurrentContainer->LocalParent()->AsHyperText(); mCurrentStartOffset = startOffset; // Call NormalizeBackward recursively to get top-most link if at the // beginning of one, or innermost link if at the end. NormalizeBackward(); return true; } else { Accessible* link = @@ -514,21 +514,21 @@ void HyperTextAccessibleWrap::ParagraphA FindTextPoint(aOffset, eDirNext, eSelectParagraph, eDefaultBehavior); if (!end.mContainer || end < here) { // If we didn't find a word end, or if we wrapped around (bug 1652833), // return with no result. return; } - if (end.mOffset == -1 && Parent() && Parent()->IsHyperText()) { + if (end.mOffset == -1 && LocalParent() && LocalParent()->IsHyperText()) { // If end offset is -1 we didn't find a paragraph boundary. // This must be an inline container, go to its parent to // retrieve paragraph boundaries. - static_cast<HyperTextAccessibleWrap*>(Parent()->AsHyperText()) + static_cast<HyperTextAccessibleWrap*>(LocalParent()->AsHyperText()) ->ParagraphAt(StartOffset(), aStartContainer, aStartOffset, aEndContainer, aEndOffset); return; } TextPoint start = static_cast<HyperTextAccessibleWrap*>(end.mContainer) ->FindTextPoint(end.mOffset, eDirPrevious, eSelectParagraph, eDefaultBehavior); @@ -546,19 +546,19 @@ void HyperTextAccessibleWrap::StyleAt(in int32_t* aEndOffset) { // Get the range of the text leaf at this offset. // A text leaf represents a stretch of like-styled text. auto leaf = LeafAtOffset(aOffset); if (!leaf) { return; } - MOZ_ASSERT(leaf->Parent()->IsHyperText()); + MOZ_ASSERT(leaf->LocalParent()->IsHyperText()); HyperTextAccessibleWrap* container = - static_cast<HyperTextAccessibleWrap*>(leaf->Parent()->AsHyperText()); + static_cast<HyperTextAccessibleWrap*>(leaf->LocalParent()->AsHyperText()); if (!container) { return; } *aStartContainer = *aEndContainer = container; container->RangeOfChild(leaf, aStartOffset, aEndOffset); } @@ -589,17 +589,17 @@ void HyperTextAccessibleWrap::PreviousCl FindTextPoint(aOffset, eDirPrevious, eSelectCluster, eDefaultBehavior); *aPrevContainer = prev.mContainer; *aPrevOffset = prev.mOffset; } void HyperTextAccessibleWrap::RangeOfChild(Accessible* aChild, int32_t* aStartOffset, int32_t* aEndOffset) { - MOZ_ASSERT(aChild->Parent() == this); + MOZ_ASSERT(aChild->LocalParent() == this); *aStartOffset = *aEndOffset = -1; int32_t index = GetIndexOf(aChild); if (index != -1) { *aStartOffset = GetChildOffset(index); // If this is the last child index + 1 will return the total // chracter count. *aEndOffset = GetChildOffset(index + 1); } @@ -612,17 +612,17 @@ Accessible* HyperTextAccessibleWrap::Lea // in between two accessibles. int32_t innerOffset = aOffset > 0 ? aOffset - 1 : aOffset; do { int32_t childIdx = text->GetChildIndexAtOffset(innerOffset); if (childIdx == -1) { return text; } - child = text->GetChildAt(childIdx); + child = text->LocalChildAt(childIdx); if (!child || nsAccUtils::MustPrune(text)) { return text; } innerOffset -= text->GetChildOffset(childIdx); text = child->AsHyperText(); } while (text); @@ -660,39 +660,39 @@ TextPoint HyperTextAccessibleWrap::FindT // We can have an empty text leaf as our only child. Since empty text // leaves are not accessible we then have no children, but 0 is a valid // innerOffset. if (childIdx == -1) { NS_ASSERTION(innerOffset == 0 && !text->ChildCount(), "No childIdx?"); return TextPoint(text, 0); } - child = text->GetChildAt(childIdx); + child = text->LocalChildAt(childIdx); if (child->IsHyperText() && !child->ChildCount()) { // If this is a childless hypertext, jump to its // previous or next sibling, depending on // direction. if (aDirection == eDirPrevious && childIdx > 0) { - child = text->GetChildAt(--childIdx); + child = text->LocalChildAt(--childIdx); } else if (aDirection == eDirNext && childIdx + 1 < static_cast<int32_t>(text->ChildCount())) { - child = text->GetChildAt(++childIdx); + child = text->LocalChildAt(++childIdx); } } int32_t childOffset = text->GetChildOffset(childIdx); if (child->IsHyperText() && aDirection == eDirPrevious && childIdx > 0 && innerOffset - childOffset == 0) { // If we are searching backwards, and this is the begining of a // segment, get the previous sibling so that layout will start // its search there. childIdx--; innerOffset -= text->GetChildOffset(childIdx); - child = text->GetChildAt(childIdx); + child = text->LocalChildAt(childIdx); } else { innerOffset -= childOffset; } text = child->AsHyperText(); } while (text); nsIFrame* childFrame = child->GetFrame(); @@ -752,17 +752,18 @@ TextPoint HyperTextAccessibleWrap::FindT pos.mResultContent, pos.mContentOffset, aDirection == eDirNext) : 0; return TextPoint(container, offset); } HyperTextAccessibleWrap* HyperTextAccessibleWrap::EditableRoot() { Accessible* editable = nullptr; - for (Accessible* acc = this; acc && acc != Document(); acc = acc->Parent()) { + for (Accessible* acc = this; acc && acc != Document(); + acc = acc->LocalParent()) { if (acc->NativeState() & states::EDITABLE) { editable = acc; } else { break; } } return static_cast<HyperTextAccessibleWrap*>(editable->AsHyperText());
--- a/accessible/mac/mozSelectableElements.mm +++ b/accessible/mac/mozSelectableElements.mm @@ -294,19 +294,19 @@ using namespace mozilla::a11y; if (acc && acc->IsContent() && acc->GetContent()->IsXULElement(nsGkAtoms::menuitem)) { // We need to provide a marker character. This is the visible "√" you see // on dropdown menus. In our a11y tree this is a single child text node // of the menu item. // We do this only with XUL menuitems that conform to the native theme, and // not with aria menu items that might have a pseudo element or something. if (acc->ChildCount() == 1 && - acc->FirstChild()->Role() == roles::STATICTEXT) { + acc->LocalFirstChild()->Role() == roles::STATICTEXT) { nsAutoString marker; - acc->FirstChild()->Name(marker); + acc->LocalFirstChild()->Name(marker); if (marker.Length() == 1) { return nsCocoaUtils::ToNSString(marker); } } } return nil; }
--- a/accessible/mac/mozTableAccessible.mm +++ b/accessible/mac/mozTableAccessible.mm @@ -465,21 +465,21 @@ enum CachedBool { eCachedBoolMiss, eCach - (NSArray*)moxColumns { if (Accessible* acc = mGeckoAccessible.AsAccessible()) { if (acc->IsContent() && acc->GetContent()->IsXULElement(nsGkAtoms::tree)) { XULTreeAccessible* treeAcc = (XULTreeAccessible*)acc; NSMutableArray* cols = [[NSMutableArray alloc] init]; // XUL trees store their columns in a group at the tree's first // child. Here, we iterate over that group to get each column's // native accessible and add it to our col array. - Accessible* treeColumns = treeAcc->GetChildAt(0); + Accessible* treeColumns = treeAcc->LocalChildAt(0); if (treeColumns) { uint32_t colCount = treeColumns->ChildCount(); for (uint32_t i = 0; i < colCount; i++) { - Accessible* treeColumnItem = treeColumns->GetChildAt(i); + Accessible* treeColumnItem = treeColumns->LocalChildAt(i); [cols addObject:GetNativeFromGeckoAccessible(treeColumnItem)]; } return cols; } } } // Webkit says we shouldn't expose any cols for aria-tree // so we return an empty array here
--- a/accessible/windows/ia2/ia2Accessible.cpp +++ b/accessible/windows/ia2/ia2Accessible.cpp @@ -170,17 +170,17 @@ ia2Accessible::role(long* aRole) { } #undef ROLE // Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call // the IA2 role a ROLE_OUTLINEITEM. MOZ_ASSERT(!acc->IsProxy()); if (geckoRole == roles::ROW) { - Accessible* xpParent = acc->Parent(); + Accessible* xpParent = acc->LocalParent(); if (xpParent && xpParent->Role() == roles::TREE_TABLE) *aRole = ROLE_SYSTEM_OUTLINEITEM; } return S_OK; } // XXX Use MOZ_CAN_RUN_SCRIPT_BOUNDARY for now due to bug 1543294. @@ -456,17 +456,17 @@ ia2Accessible::get_accessibleWithCaret(I if (acc->IsDefunct()) return CO_E_OBJNOTCONNECTED; int32_t caretOffset = -1; Accessible* accWithCaret = SelectionMgr()->AccessibleWithCaret(&caretOffset); if (!accWithCaret || acc->Document() != accWithCaret->Document()) return S_FALSE; Accessible* child = accWithCaret; - while (!child->IsDoc() && child != acc) child = child->Parent(); + while (!child->IsDoc() && child != acc) child = child->LocalParent(); if (child != acc) return S_FALSE; *aAccessible = static_cast<IAccessible2*>(static_cast<AccessibleWrap*>(accWithCaret)); (*aAccessible)->AddRef(); *aCaretOffset = caretOffset; return S_OK;
--- a/accessible/windows/ia2/ia2AccessibleComponent.cpp +++ b/accessible/windows/ia2/ia2AccessibleComponent.cpp @@ -50,25 +50,25 @@ ia2AccessibleComponent::get_locationInPa uint64_t state = acc->State(); if (state & states::INVISIBLE) return S_OK; nsIntRect rect = acc->Bounds(); // The coordinates of the returned position are relative to this object's // parent or relative to the screen on which this object is rendered if it // has no parent. - if (!acc->Parent()) { + if (!acc->LocalParent()) { *aX = rect.X(); *aY = rect.Y(); return S_OK; } // The coordinates of the bounding box are given relative to the parent's // coordinate system. - nsIntRect parentRect = acc->Parent()->Bounds(); + nsIntRect parentRect = acc->LocalParent()->Bounds(); *aX = rect.X() - parentRect.X(); *aY = rect.Y() - parentRect.Y(); return S_OK; } STDMETHODIMP ia2AccessibleComponent::get_foreground(IA2Color* aForeground) { if (!aForeground) return E_INVALIDARG;
--- a/accessible/windows/msaa/AccessibleWrap.cpp +++ b/accessible/windows/msaa/AccessibleWrap.cpp @@ -198,17 +198,17 @@ AccessibleWrap::QueryInterface(REFIID ii STDMETHODIMP AccessibleWrap::get_accParent(IDispatch __RPC_FAR* __RPC_FAR* ppdispParent) { if (!ppdispParent) return E_INVALIDARG; *ppdispParent = nullptr; if (IsDefunct()) return CO_E_OBJNOTCONNECTED; - Accessible* xpParentAcc = Parent(); + Accessible* xpParentAcc = LocalParent(); if (!xpParentAcc) return S_FALSE; *ppdispParent = NativeAccessible(xpParentAcc); return S_OK; } STDMETHODIMP AccessibleWrap::get_accChildCount(long __RPC_FAR* pcountChildren) { @@ -436,17 +436,17 @@ AccessibleWrap::get_accRole( } #undef ROLE // Special case, if there is a ROLE_ROW inside of a ROLE_TREE_TABLE, then call // the MSAA role a ROLE_OUTLINEITEM for consistency and compatibility. We need // this because ARIA has a role of "row" for both grid and treegrid if (geckoRole == roles::ROW) { - Accessible* xpParent = Parent(); + Accessible* xpParent = LocalParent(); if (xpParent && xpParent->Role() == roles::TREE_TABLE) msaaRole = ROLE_SYSTEM_OUTLINEITEM; } // -- Try enumerated role if (msaaRole != USE_ROLE_STRING) { pvarRole->vt = VT_I4; pvarRole->lVal = msaaRole; // Normal enumerated role @@ -889,35 +889,35 @@ AccessibleWrap::accNavigate( switch (navDir) { case NAVDIR_FIRSTCHILD: if (IsProxy()) { if (!nsAccUtils::MustPrune(Proxy())) { navAccessible = WrapperFor(Proxy()->FirstChild()); } } else { - if (!nsAccUtils::MustPrune(this)) navAccessible = FirstChild(); + if (!nsAccUtils::MustPrune(this)) navAccessible = LocalFirstChild(); } break; case NAVDIR_LASTCHILD: if (IsProxy()) { if (!nsAccUtils::MustPrune(Proxy())) { navAccessible = WrapperFor(Proxy()->LastChild()); } } else { - if (!nsAccUtils::MustPrune(this)) navAccessible = LastChild(); + if (!nsAccUtils::MustPrune(this)) navAccessible = LocalLastChild(); } break; case NAVDIR_NEXT: navAccessible = - IsProxy() ? WrapperFor(Proxy()->NextSibling()) : NextSibling(); + IsProxy() ? WrapperFor(Proxy()->NextSibling()) : LocalNextSibling(); break; case NAVDIR_PREVIOUS: navAccessible = - IsProxy() ? WrapperFor(Proxy()->PrevSibling()) : PrevSibling(); + IsProxy() ? WrapperFor(Proxy()->PrevSibling()) : LocalPrevSibling(); break; case NAVDIR_DOWN: case NAVDIR_LEFT: case NAVDIR_RIGHT: case NAVDIR_UP: return E_NOTIMPL; // MSAA relationship extensions to accNavigate @@ -1347,17 +1347,17 @@ static already_AddRefed<IDispatch> GetPr return disp.forget(); } bool AccessibleWrap::IsRootForHWND() { if (IsRoot()) { return true; } HWND thisHwnd = GetHWNDFor(this); - AccessibleWrap* parent = static_cast<AccessibleWrap*>(Parent()); + AccessibleWrap* parent = static_cast<AccessibleWrap*>(LocalParent()); MOZ_ASSERT(parent); HWND parentHwnd = GetHWNDFor(parent); return thisHwnd != parentHwnd; } already_AddRefed<IAccessible> AccessibleWrap::GetIAccessibleFor( const VARIANT& aVarChild, bool* aIsDefunct) { if (aVarChild.vt != VT_I4) return nullptr; @@ -1415,17 +1415,17 @@ already_AddRefed<IAccessible> Accessible return nullptr; } return GetRemoteIAccessibleFor(varChild); } if (varChild.lVal > 0) { // Gecko child indices are 0-based in contrast to indices used in MSAA. MOZ_ASSERT(!IsProxy()); - Accessible* xpAcc = GetChildAt(varChild.lVal - 1); + Accessible* xpAcc = LocalChildAt(varChild.lVal - 1); if (!xpAcc) { return nullptr; } *aIsDefunct = xpAcc->IsDefunct(); static_cast<AccessibleWrap*>(xpAcc)->GetNativeInterface( getter_AddRefs(result)); return result.forget(); } @@ -1454,17 +1454,17 @@ already_AddRefed<IAccessible> Accessible while (parent && parent != document) { if (parent == this) { *aIsDefunct = child->IsDefunct(); static_cast<AccessibleWrap*>(child)->GetNativeInterface( getter_AddRefs(result)); return result.forget(); } - parent = parent->Parent(); + parent = parent->LocalParent(); } } // Now see about the case that both this accessible and the target one are // proxied. if (IsProxy()) { DocAccessibleParent* proxyDoc = Proxy()->Document(); RefPtr<IDispatch> disp = GetProxiedAccessibleInSubtree(proxyDoc, varChild);
--- a/accessible/windows/msaa/EnumVariant.cpp +++ b/accessible/windows/msaa/EnumVariant.cpp @@ -19,27 +19,27 @@ IMPL_IUNKNOWN_QUERY_TAIL_AGGREGATED(mAnc STDMETHODIMP ChildrenEnumVariant::Next(ULONG aCount, VARIANT FAR* aItems, ULONG FAR* aCountFetched) { if (!aItems || !aCountFetched) return E_INVALIDARG; *aCountFetched = 0; - if (mAnchorAcc->IsDefunct() || mAnchorAcc->GetChildAt(mCurIndex) != mCurAcc) + if (mAnchorAcc->IsDefunct() || mAnchorAcc->LocalChildAt(mCurIndex) != mCurAcc) return CO_E_OBJNOTCONNECTED; ULONG countFetched = 0; while (mCurAcc && countFetched < aCount) { VariantInit(aItems + countFetched); IDispatch* accNative = AccessibleWrap::NativeAccessible(mCurAcc); ++mCurIndex; - mCurAcc = mAnchorAcc->GetChildAt(mCurIndex); + mCurAcc = mAnchorAcc->LocalChildAt(mCurIndex); // Don't output the accessible and count it as having been fetched unless // it is non-null MOZ_ASSERT(accNative); if (!accNative) { continue; } @@ -50,31 +50,31 @@ ChildrenEnumVariant::Next(ULONG aCount, (*aCountFetched) = countFetched; return countFetched < aCount ? S_FALSE : S_OK; } STDMETHODIMP ChildrenEnumVariant::Skip(ULONG aCount) { - if (mAnchorAcc->IsDefunct() || mAnchorAcc->GetChildAt(mCurIndex) != mCurAcc) + if (mAnchorAcc->IsDefunct() || mAnchorAcc->LocalChildAt(mCurIndex) != mCurAcc) return CO_E_OBJNOTCONNECTED; mCurIndex += aCount; - mCurAcc = mAnchorAcc->GetChildAt(mCurIndex); + mCurAcc = mAnchorAcc->LocalChildAt(mCurIndex); return mCurAcc ? S_OK : S_FALSE; } STDMETHODIMP ChildrenEnumVariant::Reset() { if (mAnchorAcc->IsDefunct()) return CO_E_OBJNOTCONNECTED; mCurIndex = 0; - mCurAcc = mAnchorAcc->GetChildAt(0); + mCurAcc = mAnchorAcc->LocalChildAt(0); return S_OK; } STDMETHODIMP ChildrenEnumVariant::Clone(IEnumVARIANT** aEnumVariant) { if (!aEnumVariant) return E_INVALIDARG;
--- a/accessible/windows/msaa/EnumVariant.h +++ b/accessible/windows/msaa/EnumVariant.h @@ -14,17 +14,19 @@ namespace mozilla { namespace a11y { /** * Used to fetch accessible children. */ class ChildrenEnumVariant final : public IEnumVARIANT { public: explicit ChildrenEnumVariant(AccessibleWrap* aAnchor) - : mAnchorAcc(aAnchor), mCurAcc(mAnchorAcc->GetChildAt(0)), mCurIndex(0) {} + : mAnchorAcc(aAnchor), + mCurAcc(mAnchorAcc->LocalChildAt(0)), + mCurIndex(0) {} // IUnknown DECL_IUNKNOWN // IEnumVariant virtual /* [local] */ HRESULT STDMETHODCALLTYPE Next( /* [in] */ ULONG aCount, /* [length_is][size_is][out] */ VARIANT* aItems,
--- a/accessible/xul/XULElementAccessibles.cpp +++ b/accessible/xul/XULElementAccessibles.cpp @@ -84,19 +84,19 @@ uint64_t XULLabelAccessible::NativeState return HyperTextAccessibleWrap::NativeState() | states::READONLY; } Relation XULLabelAccessible::RelationByType(RelationType aType) const { Relation rel = HyperTextAccessibleWrap::RelationByType(aType); // The label for xul:groupbox is generated from the first xul:label if (aType == RelationType::LABEL_FOR) { - Accessible* parent = Parent(); + Accessible* parent = LocalParent(); if (parent && parent->Role() == roles::GROUPING && - parent->GetChildAt(0) == this) { + parent->LocalChildAt(0) == this) { nsIContent* parentContent = parent->GetContent(); if (parentContent && parentContent->IsXULElement(nsGkAtoms::groupbox)) { rel.AppendTarget(parent); } } } return rel;
--- a/accessible/xul/XULFormControlAccessible.cpp +++ b/accessible/xul/XULFormControlAccessible.cpp @@ -217,17 +217,17 @@ ENameValueFlag XULGroupboxAccessible::Na return eNameOK; } Relation XULGroupboxAccessible::RelationByType(RelationType aType) const { Relation rel = AccessibleWrap::RelationByType(aType); // The label for xul:groupbox is generated from the first xul:label if (aType == RelationType::LABELLED_BY && ChildCount() > 0) { - Accessible* childAcc = GetChildAt(0); + Accessible* childAcc = LocalChildAt(0); if (childAcc->Role() == roles::LABEL && childAcc->GetContent()->IsXULElement(nsGkAtoms::label)) { rel.AppendTarget(childAcc); } } return rel; } @@ -358,22 +358,22 @@ XULToolbarButtonAccessible::XULToolbarBu DocAccessible* aDoc) : XULButtonAccessible(aContent, aDoc) {} void XULToolbarButtonAccessible::GetPositionAndSizeInternal(int32_t* aPosInSet, int32_t* aSetSize) { int32_t setSize = 0; int32_t posInSet = 0; - Accessible* parent = Parent(); + Accessible* parent = LocalParent(); if (!parent) return; uint32_t childCount = parent->ChildCount(); for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) { - Accessible* child = parent->GetChildAt(childIdx); + Accessible* child = parent->LocalChildAt(childIdx); if (IsSeparator(child)) { // end of a group of buttons if (posInSet) break; // we've found our group, so we're done setSize = 0; // not our group, so start a new group } else { setSize++; // another button in the group
--- a/accessible/xul/XULListboxAccessible.cpp +++ b/accessible/xul/XULListboxAccessible.cpp @@ -128,17 +128,17 @@ Accessible* XULListboxAccessible::CellAt RefPtr<dom::Element> element; control->GetItemAtIndex(aRowIndex, getter_AddRefs(element)); if (!element) return nullptr; Accessible* row = mDoc->GetAccessible(element); NS_ENSURE_TRUE(row, nullptr); - return row->GetChildAt(aColumnIndex); + return row->LocalChildAt(aColumnIndex); } bool XULListboxAccessible::IsColSelected(uint32_t aColIdx) { nsCOMPtr<nsIDOMXULMultiSelectControlElement> control = Elm()->AsXULMultiSelectControl(); NS_ASSERTION(control, "Doesn't implement nsIDOMXULMultiSelectControlElement."); @@ -497,9 +497,11 @@ void XULListitemAccessible::ActionNameAt else aName.AssignLiteral("check"); } } //////////////////////////////////////////////////////////////////////////////// // XULListitemAccessible: Widgets -Accessible* XULListitemAccessible::ContainerWidget() const { return Parent(); } +Accessible* XULListitemAccessible::ContainerWidget() const { + return LocalParent(); +}
--- a/accessible/xul/XULMenuAccessible.cpp +++ b/accessible/xul/XULMenuAccessible.cpp @@ -72,26 +72,26 @@ uint64_t XULMenuitemAccessible::NativeSt bool isSelected = false; nsCOMPtr<nsIDOMXULSelectControlItemElement> item = Elm()->AsXULSelectControlItem(); NS_ENSURE_TRUE(item, state); item->GetSelected(&isSelected); // Is collapsed? bool isCollapsed = false; - Accessible* parent = Parent(); + Accessible* parent = LocalParent(); if (parent && parent->State() & states::INVISIBLE) isCollapsed = true; if (isSelected) { state |= states::SELECTED; // Selected and collapsed? if (isCollapsed) { // Set selected option offscreen/invisible according to combobox state - Accessible* grandParent = parent->Parent(); + Accessible* grandParent = parent->LocalParent(); if (!grandParent) return state; NS_ASSERTION(grandParent->IsCombobox(), "grandparent of combobox listitem is not combobox"); uint64_t grandParentState = grandParent->State(); state &= ~(states::OFFSCREEN | states::INVISIBLE); state |= (grandParentState & states::OFFSCREEN) | (grandParentState & states::INVISIBLE) | (grandParentState & states::OPAQUE1); @@ -140,17 +140,17 @@ KeyBinding XULMenuitemAccessible::Access // menu are't registered by EventStateManager. nsAutoString accesskey; mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::accesskey, accesskey); if (accesskey.IsEmpty()) return KeyBinding(); uint32_t modifierKey = 0; - Accessible* parentAcc = Parent(); + Accessible* parentAcc = LocalParent(); if (parentAcc) { if (parentAcc->NativeRole() == roles::MENUBAR) { // If top level menu item, add Alt+ or whatever modifier text to string // No need to cache pref service, this happens rarely if (gMenuAccesskeyModifier == -1) { // Need to initialize cached global accesskey pref gMenuAccesskeyModifier = Preferences::GetInt("ui.key.menuAccessKey", 0); } @@ -364,17 +364,17 @@ XULMenupopupAccessible::XULMenupopupAcce uint64_t XULMenupopupAccessible::NativeState() const { uint64_t state = Accessible::NativeState(); #ifdef DEBUG // We are onscreen if our parent is active bool isActive = mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::menuactive); if (!isActive) { - Accessible* parent = Parent(); + Accessible* parent = LocalParent(); if (parent) { nsIContent* parentContent = parent->GetContent(); if (parentContent && parentContent->IsElement()) isActive = parentContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open); } } @@ -406,17 +406,17 @@ role XULMenupopupAccessible::NativeRole( } if (mParent) { if (mParent->IsCombobox() || mParent->IsAutoComplete()) return roles::COMBOBOX_LIST; if (mParent->Role() == roles::PUSHBUTTON) { // Some widgets like the search bar have several popups, owned by buttons. - Accessible* grandParent = mParent->Parent(); + Accessible* grandParent = mParent->LocalParent(); if (grandParent && grandParent->IsAutoComplete()) return roles::COMBOBOX_LIST; } } // If accessible is not bound to the tree (this happens while children are // cached) return general role. return roles::MENUPOPUP; @@ -449,17 +449,17 @@ Accessible* XULMenupopupAccessible::Cont return nullptr; nsMenuFrame* menuFrame = do_QueryFrame(menuPopupFrame->GetParent()); if (!menuFrame) // context menu or popups return nullptr; nsMenuParent* menuParent = menuFrame->GetMenuParent(); if (!menuParent) // menulist or menubutton - return menuPopup->Parent(); + return menuPopup->LocalParent(); if (menuParent->IsMenuBar()) { // menubar menu nsMenuBarFrame* menuBarFrame = static_cast<nsMenuBarFrame*>(menuParent); return document->GetAccessible(menuBarFrame->GetContent()); } // different kind of popups like panel or tooltip if (!menuParent->IsMenu()) return nullptr;
--- a/accessible/xul/XULSelectControlAccessible.cpp +++ b/accessible/xul/XULSelectControlAccessible.cpp @@ -101,17 +101,17 @@ uint32_t XULSelectControlAccessible::Sel selectControl->GetSelectedIndex(&index); return (index >= 0) ? 1 : 0; } return 0; } bool XULSelectControlAccessible::AddItemToSelection(uint32_t aIndex) { - Accessible* item = GetChildAt(aIndex); + Accessible* item = LocalChildAt(aIndex); if (!item || !item->GetContent()) return false; nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm = item->GetContent()->AsElement()->AsXULSelectControlItem(); if (!itemElm) return false; bool isItemSelected = false; itemElm->GetSelected(&isItemSelected); @@ -129,17 +129,17 @@ bool XULSelectControlAccessible::AddItem selectControl->SetSelectedItem(item->Elm()); } } return true; } bool XULSelectControlAccessible::RemoveItemFromSelection(uint32_t aIndex) { - Accessible* item = GetChildAt(aIndex); + Accessible* item = LocalChildAt(aIndex); if (!item || !item->GetContent()) return false; nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm = item->GetContent()->AsElement()->AsXULSelectControlItem(); if (!itemElm) return false; bool isItemSelected = false; itemElm->GetSelected(&isItemSelected); @@ -157,17 +157,17 @@ bool XULSelectControlAccessible::RemoveI selectControl->SetSelectedItem(nullptr); } } return true; } bool XULSelectControlAccessible::IsItemSelected(uint32_t aIndex) { - Accessible* item = GetChildAt(aIndex); + Accessible* item = LocalChildAt(aIndex); if (!item || !item->GetContent()) return false; nsCOMPtr<nsIDOMXULSelectControlItemElement> itemElm = item->GetContent()->AsElement()->AsXULSelectControlItem(); if (!itemElm) return false; bool isItemSelected = false; itemElm->GetSelected(&isItemSelected);
--- a/accessible/xul/XULTreeAccessible.cpp +++ b/accessible/xul/XULTreeAccessible.cpp @@ -335,19 +335,21 @@ bool XULTreeAccessible::SelectAll() { } return false; } //////////////////////////////////////////////////////////////////////////////// // XULTreeAccessible: Accessible implementation -Accessible* XULTreeAccessible::GetChildAt(uint32_t aIndex) const { +Accessible* XULTreeAccessible::LocalChildAt(uint32_t aIndex) const { uint32_t childCount = Accessible::ChildCount(); - if (aIndex < childCount) return Accessible::GetChildAt(aIndex); + if (aIndex < childCount) { + return Accessible::LocalChildAt(aIndex); + } return GetTreeItemAccessible(aIndex - childCount); } uint32_t XULTreeAccessible::ChildCount() const { // Tree's children count is row count + treecols count. uint32_t childCount = Accessible::ChildCount(); if (!mTreeView) return childCount; @@ -850,17 +852,17 @@ void XULTreeItemAccessibleBase::Dispatch nsCoreUtils::DispatchClickEvent(tree, mRow, column, pseudoElm); } } Accessible* XULTreeItemAccessibleBase::GetSiblingAtOffset( int32_t aOffset, nsresult* aError) const { if (aError) *aError = NS_OK; // fail peacefully - return mParent->GetChildAt(IndexInParent() + aOffset); + return mParent->LocalChildAt(IndexInParent() + aOffset); } //////////////////////////////////////////////////////////////////////////////// // XULTreeItemAccessibleBase: protected implementation bool XULTreeItemAccessibleBase::IsExpandable() const { bool isContainer = false; mTreeView->IsContainer(mRow, &isContainer); @@ -981,17 +983,17 @@ Accessible* XULTreeColumAccessible::GetS RefPtr<dom::XULTreeElement> tree = nsCoreUtils::GetTree(mContent); if (tree) { nsCOMPtr<nsITreeView> treeView = tree->GetView(FlushType::None); if (treeView) { int32_t rowCount = 0; treeView->GetRowCount(&rowCount); if (rowCount > 0 && aOffset <= rowCount) { - XULTreeAccessible* treeAcc = Parent()->AsXULTree(); + XULTreeAccessible* treeAcc = LocalParent()->AsXULTree(); if (treeAcc) return treeAcc->GetTreeItemAccessible(aOffset - 1); } } } return nullptr; }
--- a/accessible/xul/XULTreeAccessible.h +++ b/accessible/xul/XULTreeAccessible.h @@ -40,17 +40,17 @@ class XULTreeAccessible : public Accessi // Accessible virtual void Shutdown() override; virtual void Value(nsString& aValue) const override; virtual a11y::role NativeRole() const override; virtual uint64_t NativeState() const override; virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) override; - virtual Accessible* GetChildAt(uint32_t aIndex) const override; + virtual Accessible* LocalChildAt(uint32_t aIndex) const override; virtual uint32_t ChildCount() const override; virtual Relation RelationByType(RelationType aType) const override; // SelectAccessible virtual void SelectedItems(nsTArray<Accessible*>* aItems) override; virtual uint32_t SelectedItemCount() override; virtual Accessible* GetSelectedItem(uint32_t aIndex) override; virtual bool IsItemSelected(uint32_t aIndex) override;
--- a/accessible/xul/XULTreeGridAccessible.cpp +++ b/accessible/xul/XULTreeGridAccessible.cpp @@ -112,19 +112,19 @@ Accessible* XULTreeGridAccessible::CellA return rowAcc->GetCellAccessible(column); } void XULTreeGridAccessible::ColDescription(uint32_t aColIdx, nsString& aDescription) { aDescription.Truncate(); - Accessible* treeColumns = Accessible::GetChildAt(0); + Accessible* treeColumns = Accessible::LocalChildAt(0); if (treeColumns) { - Accessible* treeColumnItem = treeColumns->GetChildAt(aColIdx); + Accessible* treeColumnItem = treeColumns->LocalChildAt(aColIdx); if (treeColumnItem) treeColumnItem->Name(aDescription); } } bool XULTreeGridAccessible::IsColSelected(uint32_t aColIdx) { // If all the row has been selected, then all the columns are selected. // Because we can't select a column alone. return SelectedItemCount() == RowCount(); @@ -272,17 +272,17 @@ Accessible* XULTreeGridRowAccessible::Ch mTree->GetCellAt(clientX, clientY, cellInfo, rv); // Return if we failed to find tree cell in the row for the given point. if (cellInfo.mRow != mRow || !cellInfo.mCol) return nullptr; return GetCellAccessible(cellInfo.mCol); } -Accessible* XULTreeGridRowAccessible::GetChildAt(uint32_t aIndex) const { +Accessible* XULTreeGridRowAccessible::LocalChildAt(uint32_t aIndex) const { if (IsDefunct()) return nullptr; RefPtr<nsTreeColumn> column = nsCoreUtils::GetSensibleColumnAt(mTree, aIndex); if (!column) return nullptr; return GetCellAccessible(column); } @@ -478,17 +478,17 @@ bool XULTreeGridCellAccessible::DoAction return false; } //////////////////////////////////////////////////////////////////////////////// // XULTreeGridCellAccessible: TableCell TableAccessible* XULTreeGridCellAccessible::Table() const { - Accessible* grandParent = mParent->Parent(); + Accessible* grandParent = mParent->LocalParent(); if (grandParent) return grandParent->AsTable(); return nullptr; } uint32_t XULTreeGridCellAccessible::ColIdx() const { uint32_t colIdx = 0; RefPtr<nsTreeColumn> column = mColumn; @@ -625,17 +625,17 @@ Accessible* XULTreeGridCellAccessible::G for (int32_t index = aOffset; index > 0 && columnAtOffset; index--) { column = nsCoreUtils::GetNextSensibleColumn(columnAtOffset); column.swap(columnAtOffset); } } if (!columnAtOffset) return nullptr; - RefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(Parent()); + RefPtr<XULTreeItemAccessibleBase> rowAcc = do_QueryObject(LocalParent()); return rowAcc->GetCellAccessible(columnAtOffset); } void XULTreeGridCellAccessible::DispatchClickEvent( nsIContent* aContent, uint32_t aActionIndex) const { if (IsDefunct()) return; RefPtr<dom::XULTreeElement> tree = mTree;
--- a/accessible/xul/XULTreeGridAccessible.h +++ b/accessible/xul/XULTreeGridAccessible.h @@ -60,17 +60,17 @@ class XULTreeGridAccessible : public XUL }; /** * Represents accessible for XUL tree item in the case when XUL tree has * multiple columns. */ class XULTreeGridRowAccessible final : public XULTreeItemAccessibleBase { public: - using Accessible::GetChildAt; + using Accessible::LocalChildAt; XULTreeGridRowAccessible(nsIContent* aContent, DocAccessible* aDoc, Accessible* aParent, dom::XULTreeElement* aTree, nsITreeView* aTreeView, int32_t aRow); // nsISupports and cycle collection NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULTreeGridRowAccessible, @@ -78,17 +78,17 @@ class XULTreeGridRowAccessible final : p // Accessible virtual void Shutdown() override; virtual a11y::role NativeRole() const override; virtual ENameValueFlag Name(nsString& aName) const override; virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY, EWhichChildAtPoint aWhichChild) override; - virtual Accessible* GetChildAt(uint32_t aIndex) const override; + virtual Accessible* LocalChildAt(uint32_t aIndex) const override; virtual uint32_t ChildCount() const override; // XULTreeItemAccessibleBase XULTreeGridCellAccessible* GetCellAccessible( nsTreeColumn* aColumn) const final; virtual void RowInvalidated(int32_t aStartColIdx, int32_t aEndColIdx) override;