From 98a7d0b6a6b2dd91b902e877a4228792b6670bcf Mon Sep 17 00:00:00 2001 From: Marco Zehe Date: Wed, 26 Aug 2015 16:28:05 +0200 Subject: [PATCH] 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. --- accessible/mac/mozAccessible.h | 5 +---- accessible/mac/mozAccessible.mm | 26 ++++---------------------- 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/accessible/mac/mozAccessible.h b/accessible/mac/mozAccessible.h index d908cf41b4d..e575e4d1701 100644 --- a/accessible/mac/mozAccessible.h +++ b/accessible/mac/mozAccessible.h @@ -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; diff --git a/accessible/mac/mozAccessible.mm b/accessible/mac/mozAccessible.mm index d25d0a2d69d..7c0a4194acd 100644 --- a/accessible/mac/mozAccessible.mm +++ b/accessible/mac/mozAccessible.mm @@ -302,7 +302,6 @@ ConvertToNSArray(nsTArray& aArray) NSAccessibilityHelpAttribute, NSAccessibilityTitleUIElementAttribute, NSAccessibilityTopLevelUIElementAttribute, - NSAccessibilityDescriptionAttribute, #if DEBUG @"AXMozDescription", #endif @@ -403,8 +402,6 @@ ConvertToNSArray(nsTArray& 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);