Bug 1678712 - Support AXLangauge. r=morgan

The important part here is to have the text leafs inherit their parents' language.

Differential Revision: https://phabricator.services.mozilla.com/D212604
This commit is contained in:
Eitan Isaacson
2024-06-11 19:41:20 +00:00
parent d2ad11815f
commit 872a6b8ba9
4 changed files with 33 additions and 0 deletions

View File

@@ -338,6 +338,9 @@
// AXPlaceholderValue
- (NSString* _Nullable)moxPlaceholderValue;
// AXLanguage
- (NSString* _Nullable)moxLanguage;
// AXMozDebugDescription
- (NSString* _Nullable)moxMozDebugDescription;

View File

@@ -245,6 +245,9 @@ enum CheckedState {
// override
- (id)moxFocusableAncestor;
// override
- (NSString*)moxLanguage;
#ifndef RELEASE_OR_BETA
// override
- (NSString*)moxMozDebugDescription;

View File

@@ -757,6 +757,15 @@ struct RoleDescrComparator {
return [self moxEditableAncestor];
}
- (NSString*)moxLanguage {
MOZ_ASSERT(mGeckoAccessible);
nsAutoString lang;
mGeckoAccessible->Language(lang);
return nsCocoaUtils::ToNSString(lang);
}
#ifndef RELEASE_OR_BETA
- (NSString*)moxMozDebugDescription {
NS_OBJC_BEGIN_TRY_BLOCK_RETURN;