Bug 1832647 - Remove cache enabled check in Android. r=Jamie

Differential Revision: https://phabricator.services.mozilla.com/D177807
This commit is contained in:
Eitan Isaacson 2023-05-13 00:11:51 +00:00
Родитель 1bdfc3e820
Коммит e6869d9efd
4 изменённых файлов: 8 добавлений и 36 удалений

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

@ -27,7 +27,6 @@
#include "mozilla/a11y/PDocAccessibleChild.h"
#include "mozilla/jni/GeckoBundleUtils.h"
#include "mozilla/StaticPrefs_accessibility.h"
#include "mozilla/a11y/DocAccessibleParent.h"
// icu TRUE conflicting with java::sdk::Boolean::TRUE()
@ -201,9 +200,7 @@ nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
break;
}
case nsIAccessibleEvent::EVENT_REORDER: {
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
sessionAcc->SendWindowContentChangedEvent();
}
sessionAcc->SendWindowContentChangedEvent();
break;
}
default:

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

@ -18,7 +18,6 @@
#include "TraversalRule.h"
#include "mozilla/PresShell.h"
#include "mozilla/a11y/DocAccessiblePlatformExtChild.h"
#include "mozilla/StaticPrefs_accessibility.h"
using namespace mozilla;
using namespace mozilla::a11y;

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

@ -9,7 +9,6 @@
#include "SessionAccessibility.h"
#include "mozilla/a11y/RemoteAccessible.h"
#include "mozilla/Components.h"
#include "mozilla/StaticPrefs_accessibility.h"
#include "nsIAccessibleEvent.h"
#include "nsIAccessiblePivot.h"
#include "nsIStringBundle.h"
@ -97,9 +96,7 @@ void a11y::ProxyEvent(RemoteAccessible* aTarget, uint32_t aEventType) {
sessionAcc->SendFocusEvent(aTarget);
break;
case nsIAccessibleEvent::EVENT_REORDER:
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
sessionAcc->SendWindowContentChangedEvent();
}
sessionAcc->SendWindowContentChangedEvent();
break;
default:
break;

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

@ -127,7 +127,7 @@ void SessionAccessibility::GetNodeInfo(int32_t aID,
java::GeckoBundle::GlobalRef ret = nullptr;
RefPtr<SessionAccessibility> self(this);
if (Accessible* acc = GetAccessibleByID(aID)) {
if (acc->IsLocal() || !IsCacheEnabled()) {
if (acc->IsLocal()) {
mal.Unlock();
nsAppShell::SyncRunEvent(
[this, self, aID, aNodeInfo = jni::Object::GlobalRef(aNodeInfo)] {
@ -409,9 +409,7 @@ void SessionAccessibility::SendWindowStateChangedEvent(
AccessibleWrap::GetVirtualViewID(aAccessible),
AccessibleWrap::AndroidClass(aAccessible), nullptr);
if (IsCacheEnabled()) {
SendWindowContentChangedEvent();
}
SendWindowContentChangedEvent();
}
void SessionAccessibility::SendTextSelectionChangedEvent(
@ -420,15 +418,8 @@ void SessionAccessibility::SendTextSelectionChangedEvent(
int32_t fromIndex = aCaretOffset;
int32_t startSel = -1;
int32_t endSel = -1;
bool hasSelection = false;
if (aAccessible->IsRemote() && !IsCacheEnabled()) {
nsAutoString unused;
hasSelection = aAccessible->AsRemote()->SelectionBoundsAt(
0, unused, &startSel, &endSel);
} else {
hasSelection = aAccessible->AsHyperTextBase()->SelectionBoundsAt(
0, &startSel, &endSel);
}
bool hasSelection =
aAccessible->AsHyperTextBase()->SelectionBoundsAt(0, &startSel, &endSel);
if (hasSelection) {
fromIndex = startSel == aCaretOffset ? endSel : startSel;
@ -462,13 +453,7 @@ void SessionAccessibility::SendTextChangedEvent(Accessible* aAccessible,
if (aAccessible->IsHyperText()) {
aAccessible->AsHyperTextBase()->TextSubstring(0, -1, text);
} else if (aAccessible->IsText()) {
if (aAccessible->IsRemote() && !IsCacheEnabled()) {
// XXX: AppendTextTo is not implemented in the IPDL and only
// works when cache is enabled.
aAccessible->Name(text);
} else {
aAccessible->AppendTextTo(text, 0, -1);
}
aAccessible->AppendTextTo(text, 0, -1);
}
nsAutoString beforeText(text);
if (aIsInsert) {
@ -500,13 +485,7 @@ void SessionAccessibility::SendTextTraversedEvent(Accessible* aAccessible,
if (aAccessible->IsHyperText()) {
aAccessible->AsHyperTextBase()->TextSubstring(0, -1, text);
} else if (aAccessible->IsText()) {
if (aAccessible->IsRemote() && !IsCacheEnabled()) {
// XXX: AppendTextTo is not implemented in the IPDL and only
// works when cache is enabled.
aAccessible->Name(text);
} else {
aAccessible->AppendTextTo(text, 0, -1);
}
aAccessible->AppendTextTo(text, 0, -1);
}
GECKOBUNDLE_START(eventInfo);