diff options
Diffstat (limited to 'accessible/mac')
-rw-r--r-- | accessible/mac/AccessibleWrap.mm | 3 | ||||
-rw-r--r-- | accessible/mac/MOXWebAreaAccessible.mm | 2 | ||||
-rw-r--r-- | accessible/mac/mozActionElements.h | 29 | ||||
-rw-r--r-- | accessible/mac/mozActionElements.mm | 41 |
4 files changed, 46 insertions, 29 deletions
diff --git a/accessible/mac/AccessibleWrap.mm b/accessible/mac/AccessibleWrap.mm index ef2f4ba779..e8107b1690 100644 --- a/accessible/mac/AccessibleWrap.mm +++ b/accessible/mac/AccessibleWrap.mm @@ -192,6 +192,9 @@ Class a11y::GetTypeFromRole(roles::Role aRole) { case roles::RADIO_MENU_ITEM: return [mozRadioButtonAccessible class]; + case roles::PROGRESSBAR: + return [mozRangeAccessible class]; + case roles::SPINBUTTON: case roles::SLIDER: return [mozIncrementableAccessible class]; diff --git a/accessible/mac/MOXWebAreaAccessible.mm b/accessible/mac/MOXWebAreaAccessible.mm index c1ae585fa1..37168b1be2 100644 --- a/accessible/mac/MOXWebAreaAccessible.mm +++ b/accessible/mac/MOXWebAreaAccessible.mm @@ -211,7 +211,7 @@ using namespace mozilla::a11y; - (NSArray*)moxUnignoredChildren { if (id rootGroup = [self rootGroup]) { - return @[ [self rootGroup] ]; + return @[ rootGroup ]; } // There is no root group, expose the children here directly. diff --git a/accessible/mac/mozActionElements.h b/accessible/mac/mozActionElements.h index f9940c793a..d5b286ff97 100644 --- a/accessible/mac/mozActionElements.h +++ b/accessible/mac/mozActionElements.h @@ -65,15 +65,14 @@ @end /** - * Base accessible for an incrementable + * Base accessible for a range, an acc with a min, max that cannot + * be modified by the user directly. */ -@interface mozIncrementableAccessible : mozAccessible -// override -- (id)moxValue; +@interface mozRangeAccessible : mozAccessible // override -- (NSString*)moxValueDescription; +- (id)moxValue; // override - (id)moxMinValue; @@ -82,19 +81,29 @@ - (id)moxMaxValue; // override -- (void)moxSetValue:(id)value; +- (NSString*)moxOrientation; // override -- (void)moxPerformIncrement; +- (void)handleAccessibleEvent:(uint32_t)eventType; + +@end + +/** + * Base accessible for an incrementable, a settable range + */ +@interface mozIncrementableAccessible : mozRangeAccessible // override -- (void)moxPerformDecrement; +- (NSString*)moxValueDescription; // override -- (NSString*)moxOrientation; +- (void)moxSetValue:(id)value; // override -- (void)handleAccessibleEvent:(uint32_t)eventType; +- (void)moxPerformIncrement; + +// override +- (void)moxPerformDecrement; - (void)changeValueBySteps:(int)factor; diff --git a/accessible/mac/mozActionElements.mm b/accessible/mac/mozActionElements.mm index f39f2c8ad5..e3a2ff9598 100644 --- a/accessible/mac/mozActionElements.mm +++ b/accessible/mac/mozActionElements.mm @@ -134,17 +134,12 @@ using namespace mozilla::a11y; @end -@implementation mozIncrementableAccessible +@implementation mozRangeAccessible - (id)moxValue { return [NSNumber numberWithDouble:mGeckoAccessible->CurValue()]; } -- (NSString*)moxValueDescription { - nsAutoString valueDesc; - mGeckoAccessible->Value(valueDesc); - return nsCocoaUtils::ToNSString(valueDesc); -} - (id)moxMinValue { return [NSNumber numberWithDouble:mGeckoAccessible->MinValue()]; } @@ -153,18 +148,6 @@ using namespace mozilla::a11y; return [NSNumber numberWithDouble:mGeckoAccessible->MaxValue()]; } -- (void)moxSetValue:(id)value { - [self setValue:([value doubleValue])]; -} - -- (void)moxPerformIncrement { - [self changeValueBySteps:1]; -} - -- (void)moxPerformDecrement { - [self changeValueBySteps:-1]; -} - - (NSString*)moxOrientation { RefPtr<AccAttributes> attributes = mGeckoAccessible->Attributes(); if (attributes) { @@ -192,6 +175,28 @@ using namespace mozilla::a11y; } } +@end + +@implementation mozIncrementableAccessible + +- (NSString*)moxValueDescription { + nsAutoString valueDesc; + mGeckoAccessible->Value(valueDesc); + return nsCocoaUtils::ToNSString(valueDesc); +} + +- (void)moxSetValue:(id)value { + [self setValue:([value doubleValue])]; +} + +- (void)moxPerformIncrement { + [self changeValueBySteps:1]; +} + +- (void)moxPerformDecrement { + [self changeValueBySteps:-1]; +} + /* * Updates the accessible's current value by factor and step. * |