Bug 1730088 part 3: Move CharacterCount to HyperTextAccessibleBase. r=eeejay

Differential Revision: https://phabricator.services.mozilla.com/D127208
This commit is contained in:
James Teh 2021-10-07 04:22:44 +00:00
Родитель 68d5471fbc
Коммит adae2323e9
3 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -64,4 +64,8 @@ int32_t HyperTextAccessibleBase::GetChildOffset(uint32_t aChildIndex,
return lastTextOffset; return lastTextOffset;
} }
uint32_t HyperTextAccessibleBase::CharacterCount() const {
return GetChildOffset(Acc()->ChildCount());
}
} // namespace mozilla::a11y } // namespace mozilla::a11y

Просмотреть файл

@ -48,6 +48,11 @@ class HyperTextAccessibleBase {
virtual int32_t GetChildOffset(uint32_t aChildIndex, virtual int32_t GetChildOffset(uint32_t aChildIndex,
bool aInvalidateAfter = false) const; bool aInvalidateAfter = false) const;
/**
* Return character count within the hypertext accessible.
*/
uint32_t CharacterCount() const;
protected: protected:
virtual const Accessible* Acc() const = 0; virtual const Accessible* Acc() const = 0;
Accessible* Acc() { Accessible* Acc() {

Просмотреть файл

@ -144,11 +144,6 @@ class HyperTextAccessible : public AccessibleWrap,
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
// TextAccessible // 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). * Get a character at the given offset (don't support magic offsets).
*/ */