Files
tubestation/accessible/ios/Platform.mm
Nathan LaPre 96df3b0894 Bug 1794974: Part 1: Add improved client detection, automatic domain setting, r=Jamie
This revision is a step towards ensuring we get the right domains for known
accessibility instantiators. We want to anticipate the needs of known clients
and make sure we have all the cache domains ready, especially for heavy-use
clients like screen readers. The domains we'll need are a bit of a work in
progress, but can be updated easily. For now, err on the side of caution. This
revision also implements better client detection on macOS, so we can handle
multiple clients.

Differential Revision: https://phabricator.services.mozilla.com/D220035
2024-09-09 23:02:19 +00:00

62 lines
1.8 KiB
Plaintext

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "Platform.h"
#include "RemoteAccessible.h"
#include "DocAccessibleParent.h"
#import "MUIAccessible.h"
namespace mozilla {
namespace a11y {
bool ShouldA11yBeEnabled() {
// XXX: Figure out proper a11y activation strategies in iOS.
return true;
}
void PlatformInit() {}
void PlatformShutdown() {}
void ProxyCreated(RemoteAccessible* aProxy) {
MUIAccessible* mozWrapper = [[MUIAccessible alloc] initWithAccessible:aProxy];
aProxy->SetWrapper(reinterpret_cast<uintptr_t>(mozWrapper));
}
void ProxyDestroyed(RemoteAccessible* aProxy) {
MUIAccessible* wrapper = GetNativeFromGeckoAccessible(aProxy);
[wrapper expire];
[wrapper release];
aProxy->SetWrapper(0);
}
void PlatformEvent(Accessible*, uint32_t) {}
void PlatformStateChangeEvent(Accessible*, uint64_t, bool) {}
void PlatformFocusEvent(Accessible* aTarget,
const LayoutDeviceIntRect& aCaretRect) {}
void PlatformCaretMoveEvent(Accessible* aTarget, int32_t aOffset,
bool aIsSelectionCollapsed, int32_t aGranularity,
const LayoutDeviceIntRect& aCaretRect,
bool aFromUser) {}
void PlatformTextChangeEvent(Accessible*, const nsAString&, int32_t, uint32_t,
bool, bool) {}
void PlatformShowHideEvent(Accessible*, Accessible*, bool, bool) {}
void PlatformSelectionEvent(Accessible*, Accessible*, uint32_t) {}
uint64_t GetCacheDomainsForKnownClients(uint64_t aCacheDomains) {
return aCacheDomains;
}
} // namespace a11y
} // namespace mozilla