From e6869d9efd381c82b0ab89733e7dc7dfa6b8a268 Mon Sep 17 00:00:00 2001 From: Eitan Isaacson Date: Sat, 13 May 2023 00:11:51 +0000 Subject: [PATCH] Bug 1832647 - Remove cache enabled check in Android. r=Jamie Differential Revision: https://phabricator.services.mozilla.com/D177807 --- accessible/android/AccessibleWrap.cpp | 5 +--- accessible/android/DocAccessibleWrap.cpp | 1 - accessible/android/Platform.cpp | 5 +--- accessible/android/SessionAccessibility.cpp | 33 ++++----------------- 4 files changed, 8 insertions(+), 36 deletions(-) diff --git a/accessible/android/AccessibleWrap.cpp b/accessible/android/AccessibleWrap.cpp index a6202685b767..0b9fda291d8b 100644 --- a/accessible/android/AccessibleWrap.cpp +++ b/accessible/android/AccessibleWrap.cpp @@ -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: diff --git a/accessible/android/DocAccessibleWrap.cpp b/accessible/android/DocAccessibleWrap.cpp index 9019ba83d541..9f661dd226c0 100644 --- a/accessible/android/DocAccessibleWrap.cpp +++ b/accessible/android/DocAccessibleWrap.cpp @@ -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; diff --git a/accessible/android/Platform.cpp b/accessible/android/Platform.cpp index 024ab45524c5..9bde1cbc7083 100644 --- a/accessible/android/Platform.cpp +++ b/accessible/android/Platform.cpp @@ -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; diff --git a/accessible/android/SessionAccessibility.cpp b/accessible/android/SessionAccessibility.cpp index 0a190dd62fe9..ad142dc38ee3 100644 --- a/accessible/android/SessionAccessibility.cpp +++ b/accessible/android/SessionAccessibility.cpp @@ -127,7 +127,7 @@ void SessionAccessibility::GetNodeInfo(int32_t aID, java::GeckoBundle::GlobalRef ret = nullptr; RefPtr 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);