From 6bb1e36bb790d92199f2d9946253d4f1a4d470a0 Mon Sep 17 00:00:00 2001 From: James Teh Date: Thu, 4 May 2023 00:53:43 +0000 Subject: [PATCH] Bug 1826242: Use the cache for RemoteAccessible::CaretOffset on non-Windows. r=nlapre Differential Revision: https://phabricator.services.mozilla.com/D176980 --- accessible/ipc/other/RemoteAccessible.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/accessible/ipc/other/RemoteAccessible.cpp b/accessible/ipc/other/RemoteAccessible.cpp index 96f7dc106077..4799c6df04df 100644 --- a/accessible/ipc/other/RemoteAccessible.cpp +++ b/accessible/ipc/other/RemoteAccessible.cpp @@ -165,6 +165,10 @@ int32_t RemoteAccessible::CaretLineNumber() { } int32_t RemoteAccessible::CaretOffset() const { + if (StaticPrefs::accessibility_cache_enabled_AtStartup()) { + return RemoteAccessibleBase::CaretOffset(); + } + int32_t offset = 0; Unused << mDoc->SendCaretOffset(mID, &offset); return offset;