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:
Marco Zehe 2015-08-26 16:28:05 +02:00
parent 66ba24f2ad
commit 98a7d0b6a6
2 changed files with 5 additions and 26 deletions

View File

@ -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;

View File

@ -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);