mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1198291 - Remove exposure of the NSAccessibilityDescription attribute to guarantee we always expose AccName and AccDescription correctly, r=davidb, r=surkov
The NSAccessibilityHelpAttribute is being repurposed here, too, to expose the information other platforms call the Accessible Description rather than the Accessible Help tag, which traditionally referred to a connection to a Windows help file in old MSAA.
This commit is contained in:
parent
66ba24f2ad
commit
98a7d0b6a6
@ -112,16 +112,13 @@ static const uintptr_t IS_PROXY = 1;
|
||||
// returns the native window we're inside.
|
||||
- (NSWindow*)window;
|
||||
|
||||
// the accessible description of this particular instance.
|
||||
- (NSString*)customDescription;
|
||||
|
||||
// the value of this element.
|
||||
- (id)value;
|
||||
|
||||
// name that is associated with this accessible (for buttons, etc)
|
||||
- (NSString*)title;
|
||||
|
||||
// help text associated with this element.
|
||||
// the accessible description (help text) of this particular instance.
|
||||
- (NSString*)help;
|
||||
|
||||
- (BOOL)isEnabled;
|
||||
|
@ -302,7 +302,6 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
NSAccessibilityHelpAttribute,
|
||||
NSAccessibilityTitleUIElementAttribute,
|
||||
NSAccessibilityTopLevelUIElementAttribute,
|
||||
NSAccessibilityDescriptionAttribute,
|
||||
#if DEBUG
|
||||
@"AXMozDescription",
|
||||
#endif
|
||||
@ -403,8 +402,6 @@ ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
|
||||
return [self value];
|
||||
if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
|
||||
return [self roleDescription];
|
||||
if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
|
||||
return [self customDescription];
|
||||
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
|
||||
return [NSNumber numberWithBool:[self isFocused]];
|
||||
if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
|
||||
@ -1199,32 +1196,17 @@ struct RoleDescrComparator
|
||||
// Do nothing. mozTextAccessible will.
|
||||
}
|
||||
|
||||
- (NSString*)customDescription
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
||||
nsAutoString desc;
|
||||
if (AccessibleWrap* accWrap = [self getGeckoAccessible])
|
||||
accWrap->Description(desc);
|
||||
else if (ProxyAccessible* proxy = [self getProxyAccessible])
|
||||
proxy->Description(desc);
|
||||
else
|
||||
return nil;
|
||||
|
||||
return nsCocoaUtils::ToNSString(desc);
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
||||
}
|
||||
|
||||
- (NSString*)help
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||
|
||||
// What needs to go here is actually the accDescription of an item.
|
||||
// The MSAA acc_help method has nothing to do with this one.
|
||||
nsAutoString helpText;
|
||||
if (AccessibleWrap* accWrap = [self getGeckoAccessible])
|
||||
accWrap->Help(helpText);
|
||||
accWrap->Description(helpText);
|
||||
else if (ProxyAccessible* proxy = [self getProxyAccessible])
|
||||
proxy->Help(helpText);
|
||||
proxy->Description(helpText);
|
||||
|
||||
return nsCocoaUtils::ToNSString(helpText);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user