diff --git a/accessible/basetypes/HyperTextAccessibleBase.cpp b/accessible/basetypes/HyperTextAccessibleBase.cpp index c2272a039dd1..f9f4a48cf48e 100644 --- a/accessible/basetypes/HyperTextAccessibleBase.cpp +++ b/accessible/basetypes/HyperTextAccessibleBase.cpp @@ -64,4 +64,8 @@ int32_t HyperTextAccessibleBase::GetChildOffset(uint32_t aChildIndex, return lastTextOffset; } +uint32_t HyperTextAccessibleBase::CharacterCount() const { + return GetChildOffset(Acc()->ChildCount()); +} + } // namespace mozilla::a11y diff --git a/accessible/basetypes/HyperTextAccessibleBase.h b/accessible/basetypes/HyperTextAccessibleBase.h index a3fbbc5e1ec2..eca948b50f62 100644 --- a/accessible/basetypes/HyperTextAccessibleBase.h +++ b/accessible/basetypes/HyperTextAccessibleBase.h @@ -48,6 +48,11 @@ class HyperTextAccessibleBase { virtual int32_t GetChildOffset(uint32_t aChildIndex, bool aInvalidateAfter = false) const; + /** + * Return character count within the hypertext accessible. + */ + uint32_t CharacterCount() const; + protected: virtual const Accessible* Acc() const = 0; Accessible* Acc() { diff --git a/accessible/generic/HyperTextAccessible.h b/accessible/generic/HyperTextAccessible.h index 0d9d0bfff564..16e7dea224b8 100644 --- a/accessible/generic/HyperTextAccessible.h +++ b/accessible/generic/HyperTextAccessible.h @@ -144,11 +144,6 @@ class HyperTextAccessible : public HyperTextAccessibleBase, ////////////////////////////////////////////////////////////////////////////// // TextAccessible - /** - * Return character count within the hypertext accessible. - */ - uint32_t CharacterCount() const { return GetChildOffset(ChildCount()); } - /** * Get a character at the given offset (don't support magic offsets). */