зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1730088 part 4: Move CaretOffset to HyperTextAccessibleBase. r=eeejay
The implementation for RemoteAccessibleBase is just a stub; we don't cache the caret yet. However, this needs to be in HyperTextAccessibleBase because it is used by ConvertMagicOffset, which will be moved in an upcoming patch. Differential Revision: https://phabricator.services.mozilla.com/D127209
This commit is contained in:
Родитель
adae2323e9
Коммит
90725f7aed
|
@ -53,6 +53,11 @@ class HyperTextAccessibleBase {
|
|||
*/
|
||||
uint32_t CharacterCount() const;
|
||||
|
||||
/**
|
||||
* Get caret offset, if no caret then -1.
|
||||
*/
|
||||
virtual int32_t CaretOffset() const = 0;
|
||||
|
||||
protected:
|
||||
virtual const Accessible* Acc() const = 0;
|
||||
Accessible* Acc() {
|
||||
|
|
|
@ -260,7 +260,7 @@ class HyperTextAccessible : public AccessibleWrap,
|
|||
/**
|
||||
* Get/set caret offset, if no caret then -1.
|
||||
*/
|
||||
int32_t CaretOffset() const;
|
||||
virtual int32_t CaretOffset() const override;
|
||||
void SetCaretOffset(int32_t aOffset);
|
||||
|
||||
/**
|
||||
|
|
|
@ -223,6 +223,10 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
|
|||
: nullptr;
|
||||
}
|
||||
|
||||
// HyperTextAccessibleBase
|
||||
// XXX Implement this once it's cached.
|
||||
virtual int32_t CaretOffset() const override { return -1; }
|
||||
|
||||
protected:
|
||||
RemoteAccessibleBase(uint64_t aID, Derived* aParent,
|
||||
DocAccessibleParent* aDoc, role aRole, AccType aType,
|
||||
|
|
|
@ -72,7 +72,7 @@ void ScrollToPoint(uint32_t aScrollType, int32_t aX, int32_t aY);
|
|||
void Announce(const nsString& aAnnouncement, uint16_t aPriority);
|
||||
|
||||
int32_t CaretLineNumber();
|
||||
int32_t CaretOffset();
|
||||
virtual int32_t CaretOffset() const override;
|
||||
void SetCaretOffset(int32_t aOffset);
|
||||
|
||||
int32_t CharacterCount();
|
||||
|
|
|
@ -154,7 +154,7 @@ int32_t RemoteAccessible::CaretLineNumber() {
|
|||
return line;
|
||||
}
|
||||
|
||||
int32_t RemoteAccessible::CaretOffset() {
|
||||
int32_t RemoteAccessible::CaretOffset() const {
|
||||
int32_t offset = 0;
|
||||
Unused << mDoc->SendCaretOffset(mID, &offset);
|
||||
return offset;
|
||||
|
|
|
@ -637,7 +637,11 @@ bool RemoteAccessible::RemoveFromSelection(int32_t aSelectionNum) {
|
|||
return SUCCEEDED(acc->removeSelection(static_cast<long>(aSelectionNum)));
|
||||
}
|
||||
|
||||
int32_t RemoteAccessible::CaretOffset() {
|
||||
int32_t RemoteAccessible::CaretOffset() const {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
return RemoteAccessibleBase<RemoteAccessible>::CaretOffset();
|
||||
}
|
||||
|
||||
RefPtr<IAccessibleText> acc = QueryInterface<IAccessibleText>(this);
|
||||
if (!acc) {
|
||||
return -1;
|
||||
|
|
Загрузка…
Ссылка в новой задаче