diff --git a/accessible/base/AccIterator.cpp b/accessible/base/AccIterator.cpp index b816144fbe7..b56b577ffe3 100644 --- a/accessible/base/AccIterator.cpp +++ b/accessible/base/AccIterator.cpp @@ -335,64 +335,6 @@ IDRefsIterator::Next() } -//////////////////////////////////////////////////////////////////////////////// -// ARIAOwnedByIterator -//////////////////////////////////////////////////////////////////////////////// - -ARIAOwnedByIterator::ARIAOwnedByIterator(const Accessible* aDependent) : - RelatedAccIterator(aDependent->Document(), aDependent->GetContent(), - nsGkAtoms::aria_owns), mDependent(aDependent) -{ -} - -Accessible* -ARIAOwnedByIterator::Next() -{ - Accessible* owner = RelatedAccIterator::Next(); - Accessible* cur = owner; - while (cur) { - if (cur == mDependent) - return Next(); // owner cannot be a child of dependent. - - if (cur->IsDoc()) - break; // don't cross document boundaries - - cur = cur->Parent(); - } - - return owner; -} - - -//////////////////////////////////////////////////////////////////////////////// -// ARIAOwnsIterator -//////////////////////////////////////////////////////////////////////////////// - -ARIAOwnsIterator::ARIAOwnsIterator(const Accessible* aOwner) : - mIter(aOwner->Document(), aOwner->GetContent(), nsGkAtoms::aria_owns), - mOwner(aOwner) -{ -} - -Accessible* -ARIAOwnsIterator::Next() -{ - Accessible* child = mIter.Next(); - const Accessible* cur = mOwner; - while (cur) { - if (cur == child) - return Next(); // cannot own its own parent - - if (cur->IsDoc()) - break; // don't cross document boundaries - - cur = cur->Parent(); - } - - return child; -} - - //////////////////////////////////////////////////////////////////////////////// // SingleAccIterator //////////////////////////////////////////////////////////////////////////////// diff --git a/accessible/base/AccIterator.h b/accessible/base/AccIterator.h index 62aca0d4918..c7251025383 100644 --- a/accessible/base/AccIterator.h +++ b/accessible/base/AccIterator.h @@ -248,47 +248,6 @@ private: }; -/** - * Iterates over related accessible referred by aria-owns. - */ -class ARIAOwnedByIterator final : public RelatedAccIterator -{ -public: - explicit ARIAOwnedByIterator(const Accessible* aDependent); - virtual ~ARIAOwnedByIterator() { } - - virtual Accessible* Next() override; - -private: - ARIAOwnedByIterator() = delete; - ARIAOwnedByIterator(const ARIAOwnedByIterator&) = delete; - ARIAOwnedByIterator& operator = (const ARIAOwnedByIterator&) = delete; - - const Accessible* mDependent; -}; - - -/** - * Iterates over related accessible referred by aria-owns. - */ -class ARIAOwnsIterator final : public AccIterable -{ -public: - explicit ARIAOwnsIterator(const Accessible* aOwner); - virtual ~ARIAOwnsIterator() { } - - virtual Accessible* Next() override; - -private: - ARIAOwnsIterator() = delete; - ARIAOwnsIterator(const ARIAOwnsIterator&) = delete; - ARIAOwnsIterator& operator = (const ARIAOwnsIterator&) = delete; - - IDRefsIterator mIter; - const Accessible* mOwner; -}; - - /** * Iterator that points to a single accessible returning it on the first call * to Next(). diff --git a/accessible/generic/Accessible.cpp b/accessible/generic/Accessible.cpp index 6f97835bb9b..a3e72048af2 100644 --- a/accessible/generic/Accessible.cpp +++ b/accessible/generic/Accessible.cpp @@ -1603,8 +1603,7 @@ Accessible::RelationByType(RelationType aType) } case RelationType::NODE_CHILD_OF: { - Relation rel(new ARIAOwnedByIterator(this)); - + Relation rel; // This is an ARIA tree or treegrid that doesn't use owns, so we need to // get the parent the hard way. if (mRoleMapEntry && (mRoleMapEntry->role == roles::OUTLINEITEM || @@ -1633,8 +1632,6 @@ Accessible::RelationByType(RelationType aType) } case RelationType::NODE_PARENT_OF: { - Relation rel(new ARIAOwnsIterator(this)); - // ARIA tree or treegrid can do the hierarchy by @aria-level, ARIA trees // also can be organized by groups. if (mRoleMapEntry && @@ -1644,10 +1641,10 @@ Accessible::RelationByType(RelationType aType) mRoleMapEntry->role == roles::OUTLINE || mRoleMapEntry->role == roles::LIST || mRoleMapEntry->role == roles::TREE_TABLE)) { - rel.AppendIter(new ItemIterator(this)); + return Relation(new ItemIterator(this)); } - return rel; + return Relation(); } case RelationType::CONTROLLED_BY: diff --git a/accessible/tests/mochitest/relations/test_general.html b/accessible/tests/mochitest/relations/test_general.html index 9c2a405cde0..ae4cc811e0e 100644 --- a/accessible/tests/mochitest/relations/test_general.html +++ b/accessible/tests/mochitest/relations/test_general.html @@ -74,15 +74,6 @@ testRelation("treeitem1", RELATION_NODE_CHILD_OF, "tree"); testRelation("treeitem2", RELATION_NODE_CHILD_OF, "tree"); - // aria-owns, bad relations - testRelation("ariaowns_container", RELATION_NODE_CHILD_OF, null); - testRelation("ariaowns_self", RELATION_NODE_CHILD_OF, null); - testRelation("ariaowns_uncle", RELATION_NODE_CHILD_OF, "ariaowns_self"); - - testRelation("ariaowns_container", RELATION_NODE_PARENT_OF, null); - testRelation("ariaowns_self", RELATION_NODE_PARENT_OF, "ariaowns_uncle"); - testRelation("ariaowns_uncle", RELATION_NODE_PARENT_OF, null); - // 'node child of' relation for outlineitem role testRelation("treeitem3", RELATION_NODE_CHILD_OF, "tree"); testRelation("treeitem4", RELATION_NODE_CHILD_OF, "tree"); @@ -94,8 +85,6 @@ testRelation("tree2_ti1b", RELATION_NODE_CHILD_OF, "tree2_ti1"); // 'node child of' relation for row role in grid. - // Relation for row associated using aria-owns should exist. - testRelation("simplegrid-ownrow", RELATION_NODE_CHILD_OF, "simplegrid"); // Relation for row associated using aria-level should exist. testRelation("simplegrid-row3", RELATION_NODE_CHILD_OF, "simplegrid-row2"); @@ -140,8 +129,6 @@ ["treegridrow1", "treegridrow2"]); // 'node parent of' relation on ARIA grid. - // Should only have relation to child added through aria-owns. - testRelation("simplegrid", RELATION_NODE_PARENT_OF, "simplegrid-ownrow"); // 'node parent of' relation on ARIA grid's row. // Should only have relation to child through aria-level. testRelation("simplegrid-row2", RELATION_NODE_PARENT_OF, @@ -319,13 +306,7 @@ -