From cdc489e31834a5485268b6b77dc2a16f83bc8e0c Mon Sep 17 00:00:00 2001 From: James Teh Date: Fri, 1 Apr 2022 09:49:58 +0000 Subject: [PATCH] Bug 1735970 part 7: Make AccIterable::Next return an Accessible. r=morgan We need to be able to iterate through explicitly associated headers for both local and remote Accessibles. AccIterable will serve nicely as a base class, but it needs to support the Accessible base class to do that. Differential Revision: https://phabricator.services.mozilla.com/D141210 --- accessible/base/AccIterator.h | 2 +- accessible/base/Relation.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/accessible/base/AccIterator.h b/accessible/base/AccIterator.h index 3bc63fe81d8d..1077c4d1d14d 100644 --- a/accessible/base/AccIterator.h +++ b/accessible/base/AccIterator.h @@ -23,7 +23,7 @@ namespace a11y { class AccIterable { public: virtual ~AccIterable() {} - virtual LocalAccessible* Next() = 0; + virtual Accessible* Next() = 0; private: friend class Relation; diff --git a/accessible/base/Relation.h b/accessible/base/Relation.h index c25c6f7fd7ef..96ec39fc7b28 100644 --- a/accessible/base/Relation.h +++ b/accessible/base/Relation.h @@ -75,7 +75,7 @@ class Relation { * compute and return the next related accessible. */ inline LocalAccessible* Next() { - LocalAccessible* target = nullptr; + Accessible* target = nullptr; while (mFirstIter && !(target = mFirstIter->Next())) { mFirstIter = std::move(mFirstIter->mNextIter); @@ -83,7 +83,7 @@ class Relation { if (!mFirstIter) mLastIter = nullptr; - return target; + return target ? target->AsLocal() : nullptr; } private: