mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 23:02:20 +00:00
Bug 1789750: Don't try to get a COM proxy in Windows RemoteAccessible when the cache is disabled. r=nlapre
For methods supported by the cache, we already delegate to RemoteAccessibleBase where the caching implementation lives. However, there are still some less used methods which aren't supported by the cache yet. These methods are never called by the code which Windows a11y clients interact with (MsaaAccessible and friends). However, they can be called from XPCOM; e.g. when using the Browser Console. For now, just early return in these cases so we don't crash. Eventually, we'll need to unify these methods and support them with the cache enabled. Differential Revision: https://phabricator.services.mozilla.com/D156771
This commit is contained in:
parent
fbc63fb814
commit
640af21671
@ -278,6 +278,11 @@ nsIntRect RemoteAccessible::BoundsInCSSPixels() const {
|
||||
}
|
||||
|
||||
void RemoteAccessible::Language(nsString& aLocale) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
aLocale.Truncate();
|
||||
return;
|
||||
}
|
||||
aLocale.Truncate();
|
||||
|
||||
RefPtr<IAccessible> acc;
|
||||
@ -462,6 +467,10 @@ double RemoteAccessible::CurValue() const {
|
||||
}
|
||||
|
||||
bool RemoteAccessible::SetCurValue(double aValue) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return false;
|
||||
}
|
||||
RefPtr<IAccessibleValue> acc = QueryInterface<IAccessibleValue>(this);
|
||||
if (!acc) {
|
||||
return false;
|
||||
@ -668,6 +677,10 @@ void RemoteAccessible::TextAtOffset(int32_t aOffset,
|
||||
|
||||
bool RemoteAccessible::AddToSelection(int32_t aStartOffset,
|
||||
int32_t aEndOffset) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return false;
|
||||
}
|
||||
RefPtr<IAccessibleText> acc = QueryInterface<IAccessibleText>(this);
|
||||
if (!acc) {
|
||||
return false;
|
||||
@ -678,6 +691,10 @@ bool RemoteAccessible::AddToSelection(int32_t aStartOffset,
|
||||
}
|
||||
|
||||
bool RemoteAccessible::RemoveFromSelection(int32_t aSelectionNum) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return false;
|
||||
}
|
||||
RefPtr<IAccessibleText> acc = QueryInterface<IAccessibleText>(this);
|
||||
if (!acc) {
|
||||
return false;
|
||||
@ -724,6 +741,10 @@ void RemoteAccessible::SetCaretOffset(int32_t aOffset) {
|
||||
void RemoteAccessible::ScrollSubstringTo(int32_t aStartOffset,
|
||||
int32_t aEndOffset,
|
||||
uint32_t aScrollType) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return;
|
||||
}
|
||||
RefPtr<IAccessibleText> acc = QueryInterface<IAccessibleText>(this);
|
||||
if (!acc) {
|
||||
return;
|
||||
@ -741,6 +762,10 @@ void RemoteAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
|
||||
int32_t aEndOffset,
|
||||
uint32_t aCoordinateType,
|
||||
int32_t aX, int32_t aY) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return;
|
||||
}
|
||||
RefPtr<IAccessibleText> acc = QueryInterface<IAccessibleText>(this);
|
||||
if (!acc) {
|
||||
return;
|
||||
@ -763,6 +788,10 @@ void RemoteAccessible::ScrollSubstringToPoint(int32_t aStartOffset,
|
||||
}
|
||||
|
||||
bool RemoteAccessible::IsLinkValid() {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return false;
|
||||
}
|
||||
RefPtr<IAccessibleHyperlink> acc = QueryInterface<IAccessibleHyperlink>(this);
|
||||
if (!acc) {
|
||||
return false;
|
||||
@ -778,6 +807,10 @@ bool RemoteAccessible::IsLinkValid() {
|
||||
|
||||
uint32_t RemoteAccessible::AnchorCount(bool* aOk) {
|
||||
*aOk = false;
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return 0;
|
||||
}
|
||||
RefPtr<IGeckoCustom> custom = QueryInterface<IGeckoCustom>(this);
|
||||
if (!custom) {
|
||||
return 0;
|
||||
@ -793,6 +826,10 @@ uint32_t RemoteAccessible::AnchorCount(bool* aOk) {
|
||||
}
|
||||
|
||||
RemoteAccessible* RemoteAccessible::AnchorAt(uint32_t aIdx) {
|
||||
if (StaticPrefs::accessibility_cache_enabled_AtStartup()) {
|
||||
// Not yet supported by the cache.
|
||||
return nullptr;
|
||||
}
|
||||
RefPtr<IAccessibleHyperlink> link =
|
||||
QueryInterface<IAccessibleHyperlink>(this);
|
||||
if (!link) {
|
||||
|
Loading…
Reference in New Issue
Block a user