2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#import "mozAccessible.h"
|
|
|
|
|
2012-01-26 22:14:09 -08:00
|
|
|
#import "MacUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#import "mozView.h"
|
|
|
|
|
2012-04-13 07:17:03 -07:00
|
|
|
#include "Accessible-inl.h"
|
2012-06-29 14:12:18 -07:00
|
|
|
#include "nsAccUtils.h"
|
2011-12-08 13:19:29 -08:00
|
|
|
#include "nsIAccessibleRelation.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsIAccessibleText.h"
|
|
|
|
#include "nsIAccessibleEditableText.h"
|
2013-09-10 15:18:59 -07:00
|
|
|
#include "nsIPersistentProperties2.h"
|
2011-12-08 13:19:29 -08:00
|
|
|
#include "Relation.h"
|
2012-01-11 19:07:35 -08:00
|
|
|
#include "Role.h"
|
2012-05-03 23:09:22 -07:00
|
|
|
#include "RootAccessible.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2012-01-06 15:21:17 -08:00
|
|
|
#include "mozilla/Services.h"
|
2012-04-13 07:17:03 -07:00
|
|
|
#include "nsRect.h"
|
|
|
|
#include "nsCocoaUtils.h"
|
|
|
|
#include "nsCoord.h"
|
|
|
|
#include "nsObjCExceptions.h"
|
2012-06-29 14:12:18 -07:00
|
|
|
#include "nsWhitespaceTokenizer.h"
|
2012-01-06 15:21:17 -08:00
|
|
|
|
|
|
|
using namespace mozilla;
|
2011-07-27 05:43:01 -07:00
|
|
|
using namespace mozilla::a11y;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// returns the passed in object if it is not ignored. if it's ignored, will return
|
|
|
|
// the first unignored ancestor.
|
|
|
|
static inline id
|
|
|
|
GetClosestInterestingAccessible(id anObject)
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// this object is not ignored, so let's return it.
|
|
|
|
if (![anObject accessibilityIsIgnored])
|
|
|
|
return GetObjectOrRepresentedView(anObject);
|
|
|
|
|
|
|
|
// find the closest ancestor that is not ignored.
|
|
|
|
id unignoredObject = anObject;
|
|
|
|
while ((unignoredObject = [unignoredObject accessibilityAttributeValue:NSAccessibilityParentAttribute])) {
|
|
|
|
if (![unignoredObject accessibilityIsIgnored])
|
|
|
|
// object is not ignored, so let's stop the search.
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// if it's a mozAccessible, we need to take care to maybe return the view we
|
|
|
|
// represent, to the AT.
|
|
|
|
if ([unignoredObject respondsToSelector:@selector(hasRepresentedView)])
|
|
|
|
return GetObjectOrRepresentedView(unignoredObject);
|
|
|
|
|
|
|
|
return unignoredObject;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark -
|
2012-01-06 15:21:17 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
@implementation mozAccessible
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
- (id)initWithAccessible:(AccessibleWrap*)geckoAccessible
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
if ((self = [super init])) {
|
|
|
|
mGeckoAccessible = geckoAccessible;
|
2010-09-05 20:33:29 -07:00
|
|
|
mRole = geckoAccessible->Role();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return self;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)dealloc
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
[mChildren release];
|
|
|
|
[super dealloc];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
- (BOOL)accessibilityIsIgnored
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// unknown (either unimplemented, or irrelevant) elements are marked as ignored
|
|
|
|
// as well as expired elements.
|
2012-08-22 08:08:43 -07:00
|
|
|
return !mGeckoAccessible || ([[self role] isEqualToString:NSAccessibilityUnknownRole] &&
|
2012-08-24 20:48:41 -07:00
|
|
|
!(mGeckoAccessible->InteractiveState() & states::FOCUSABLE));
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray*)accessibilityAttributeNames
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// if we're expired, we don't support any attributes.
|
2012-06-29 14:12:02 -07:00
|
|
|
if (!mGeckoAccessible)
|
2007-03-22 10:30:00 -07:00
|
|
|
return [NSArray array];
|
|
|
|
|
|
|
|
static NSArray *generalAttributes = nil;
|
|
|
|
|
|
|
|
if (!generalAttributes) {
|
|
|
|
// standard attributes that are shared and supported by all generic elements.
|
|
|
|
generalAttributes = [[NSArray alloc] initWithObjects: NSAccessibilityChildrenAttribute,
|
|
|
|
NSAccessibilityParentAttribute,
|
|
|
|
NSAccessibilityRoleAttribute,
|
|
|
|
NSAccessibilityTitleAttribute,
|
|
|
|
NSAccessibilityValueAttribute,
|
|
|
|
NSAccessibilitySubroleAttribute,
|
|
|
|
NSAccessibilityRoleDescriptionAttribute,
|
|
|
|
NSAccessibilityPositionAttribute,
|
|
|
|
NSAccessibilityEnabledAttribute,
|
|
|
|
NSAccessibilitySizeAttribute,
|
|
|
|
NSAccessibilityWindowAttribute,
|
|
|
|
NSAccessibilityFocusedAttribute,
|
|
|
|
NSAccessibilityHelpAttribute,
|
|
|
|
NSAccessibilityTitleUIElementAttribute,
|
2011-12-08 23:25:25 -08:00
|
|
|
NSAccessibilityTopLevelUIElementAttribute,
|
|
|
|
NSAccessibilityDescriptionAttribute,
|
2012-01-26 22:14:09 -08:00
|
|
|
#if DEBUG
|
|
|
|
@"AXMozDescription",
|
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
return generalAttributes;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)accessibilityAttributeValue:(NSString*)attribute
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2012-06-29 14:12:02 -07:00
|
|
|
if (!mGeckoAccessible)
|
2007-03-22 10:30:00 -07:00
|
|
|
return nil;
|
2012-01-26 22:14:09 -08:00
|
|
|
|
|
|
|
#if DEBUG
|
|
|
|
if ([attribute isEqualToString:@"AXMozDescription"])
|
2012-01-27 07:50:04 -08:00
|
|
|
return [NSString stringWithFormat:@"role = %u native = %@", mRole, [self class]];
|
2012-01-26 22:14:09 -08:00
|
|
|
#endif
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityChildrenAttribute])
|
|
|
|
return [self children];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityParentAttribute])
|
|
|
|
return [self parent];
|
|
|
|
|
|
|
|
#ifdef DEBUG_hakan
|
|
|
|
NSLog (@"(%@ responding to attr %@)", self, attribute);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityRoleAttribute])
|
|
|
|
return [self role];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityPositionAttribute])
|
|
|
|
return [self position];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilitySubroleAttribute])
|
|
|
|
return [self subrole];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityEnabledAttribute])
|
|
|
|
return [NSNumber numberWithBool:[self isEnabled]];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityValueAttribute])
|
|
|
|
return [self value];
|
2012-04-17 17:31:03 -07:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute])
|
|
|
|
return [self roleDescription];
|
2011-12-08 23:25:25 -08:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute])
|
2007-03-22 10:30:00 -07:00
|
|
|
return [self customDescription];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
|
|
|
|
return [NSNumber numberWithBool:[self isFocused]];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilitySizeAttribute])
|
|
|
|
return [self size];
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityWindowAttribute])
|
|
|
|
return [self window];
|
2011-12-08 23:25:25 -08:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute])
|
2007-03-22 10:30:00 -07:00
|
|
|
return [self window];
|
2011-12-08 13:19:29 -08:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityTitleAttribute])
|
2007-03-22 10:30:00 -07:00
|
|
|
return [self title];
|
2011-12-08 13:19:29 -08:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityTitleUIElementAttribute]) {
|
2013-10-19 11:19:50 -07:00
|
|
|
Relation rel = mGeckoAccessible->RelationByType(RelationType::LABELLED_BY);
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible* tempAcc = rel.Next();
|
2011-12-08 13:19:29 -08:00
|
|
|
return tempAcc ? GetNativeFromGeckoAccessible(tempAcc) : nil;
|
|
|
|
}
|
2007-03-22 10:30:00 -07:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityHelpAttribute])
|
|
|
|
return [self help];
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NSLog (@"!!! %@ can't respond to attribute %@", self, attribute);
|
|
|
|
#endif
|
2011-12-08 13:19:29 -08:00
|
|
|
return nil;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)accessibilityIsAttributeSettable:(NSString*)attribute
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute])
|
|
|
|
return [self canBeFocused];
|
|
|
|
|
|
|
|
return NO;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NO);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef DEBUG_hakan
|
|
|
|
NSLog (@"[%@] %@='%@'", self, attribute, value);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// we only support focusing elements so far.
|
|
|
|
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute] && [value boolValue])
|
|
|
|
[self focus];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)accessibilityHitTest:(NSPoint)point
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
if (!mGeckoAccessible)
|
2007-03-22 10:30:00 -07:00
|
|
|
return nil;
|
2008-09-17 06:11:39 -07:00
|
|
|
|
2014-03-07 17:05:20 -08:00
|
|
|
// Convert the given screen-global point in the cocoa coordinate system (with
|
|
|
|
// origin in the bottom-left corner of the screen) into point in the Gecko
|
|
|
|
// coordinate system (with origin in a top-left screen point).
|
|
|
|
NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
|
|
|
|
NSPoint tmpPoint = NSMakePoint(point.x,
|
|
|
|
[mainView frame].size.height - point.y);
|
|
|
|
nsIntPoint geckoPoint = nsCocoaUtils::
|
|
|
|
CocoaPointsToDevPixels(tmpPoint, nsCocoaUtils::GetBackingScaleFactor(mainView));
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-03-07 17:05:20 -08:00
|
|
|
Accessible* child = mGeckoAccessible->ChildAtPoint(geckoPoint.x, geckoPoint.y,
|
|
|
|
Accessible::eDeepestChild);
|
|
|
|
|
|
|
|
if (child) {
|
|
|
|
mozAccessible* nativeChild = GetNativeFromGeckoAccessible(child);
|
2007-03-22 10:30:00 -07:00
|
|
|
if (nativeChild)
|
|
|
|
return GetClosestInterestingAccessible(nativeChild);
|
|
|
|
}
|
2014-03-07 17:05:20 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// if we didn't find anything, return ourself (or the first unignored ancestor).
|
|
|
|
return GetClosestInterestingAccessible(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSArray*)accessibilityActionNames
|
|
|
|
{
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*)accessibilityActionDescription:(NSString*)action
|
|
|
|
{
|
2012-01-27 07:50:04 -08:00
|
|
|
// by default we return whatever the MacOS API know about.
|
|
|
|
// if you have custom actions, override.
|
|
|
|
return NSAccessibilityActionDescription(action);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)accessibilityPerformAction:(NSString*)action
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)accessibilityFocusedUIElement
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
if (!mGeckoAccessible)
|
2007-03-22 10:30:00 -07:00
|
|
|
return nil;
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible* focusedGeckoChild = mGeckoAccessible->FocusedChild();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (focusedGeckoChild) {
|
|
|
|
mozAccessible *focusedChild = GetNativeFromGeckoAccessible(focusedGeckoChild);
|
|
|
|
if (focusedChild)
|
|
|
|
return GetClosestInterestingAccessible(focusedChild);
|
|
|
|
}
|
|
|
|
|
|
|
|
// return ourself if we can't get a native focused child.
|
|
|
|
return GetClosestInterestingAccessible(self);
|
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
- (id <mozAccessible>)parent
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible* accessibleParent = mGeckoAccessible->GetUnignoredParent();
|
2007-03-22 10:30:00 -07:00
|
|
|
if (accessibleParent) {
|
|
|
|
id nativeParent = GetNativeFromGeckoAccessible(accessibleParent);
|
2011-12-08 23:53:05 -08:00
|
|
|
if (nativeParent)
|
2012-04-05 14:36:27 -07:00
|
|
|
return GetClosestInterestingAccessible(nativeParent);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// GetUnignoredParent() returns null when there is no unignored accessible all the way up to
|
|
|
|
// the root accessible. so we'll have to return whatever native accessible is above our root accessible
|
|
|
|
// (which might be the owning NSWindow in the application, for example).
|
|
|
|
//
|
|
|
|
// get the native root accessible, and tell it to return its first parent unignored accessible.
|
2012-05-03 23:09:22 -07:00
|
|
|
RootAccessible* root = mGeckoAccessible->RootAccessible();
|
2007-07-08 00:08:04 -07:00
|
|
|
id nativeParent = GetNativeFromGeckoAccessible(static_cast<nsIAccessible*>(root));
|
2007-03-22 10:30:00 -07:00
|
|
|
NSAssert1 (nativeParent, @"!!! we can't find a parent for %@", self);
|
|
|
|
|
2012-04-05 14:36:27 -07:00
|
|
|
return GetClosestInterestingAccessible(nativeParent);
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)hasRepresentedView
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (id)representedView
|
|
|
|
{
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)isRoot
|
|
|
|
{
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
// gets our native children lazily.
|
|
|
|
// returns nil when there are no children.
|
|
|
|
- (NSArray*)children
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2011-12-05 12:33:30 -08:00
|
|
|
if (mChildren || !mGeckoAccessible->AreChildrenCached())
|
2007-03-22 10:30:00 -07:00
|
|
|
return mChildren;
|
2011-12-05 12:33:30 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
mChildren = [[NSMutableArray alloc] init];
|
2012-04-03 02:54:07 -07:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// get the array of children.
|
2012-05-28 18:18:45 -07:00
|
|
|
nsAutoTArray<Accessible*, 10> childrenArray;
|
2012-04-03 02:54:07 -07:00
|
|
|
mGeckoAccessible->GetUnignoredChildren(&childrenArray);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// now iterate through the children array, and get each native accessible.
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t totalCount = childrenArray.Length();
|
|
|
|
for (uint32_t idx = 0; idx < totalCount; idx++) {
|
2012-05-28 18:18:45 -07:00
|
|
|
Accessible* curAccessible = childrenArray.ElementAt(idx);
|
2007-03-22 10:30:00 -07:00
|
|
|
if (curAccessible) {
|
|
|
|
mozAccessible *curNative = GetNativeFromGeckoAccessible(curAccessible);
|
|
|
|
if (curNative)
|
|
|
|
[mChildren addObject:GetObjectOrRepresentedView(curNative)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef DEBUG_hakan
|
|
|
|
// make sure we're not returning any ignored accessibles.
|
|
|
|
NSEnumerator *e = [mChildren objectEnumerator];
|
|
|
|
mozAccessible *m = nil;
|
|
|
|
while ((m = [e nextObject])) {
|
|
|
|
NSAssert1(![m accessibilityIsIgnored], @"we should never return an ignored accessible! (%@)", m);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
return mChildren;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSValue*)position
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2014-03-07 17:05:20 -08:00
|
|
|
if (!mGeckoAccessible)
|
|
|
|
return nil;
|
|
|
|
|
|
|
|
int32_t x = 0, y = 0, width = 0, height = 0;
|
|
|
|
mGeckoAccessible->GetBounds(&x, &y, &width, &height);
|
|
|
|
|
|
|
|
NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
|
|
|
|
CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mainView);
|
|
|
|
NSPoint p = NSMakePoint(static_cast<CGFloat>(x) / scaleFactor,
|
|
|
|
[mainView frame].size.height - static_cast<CGFloat>(y + height) / scaleFactor);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return [NSValue valueWithPoint:p];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSValue*)size
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2014-03-07 17:05:20 -08:00
|
|
|
if (!mGeckoAccessible)
|
|
|
|
return nil;
|
|
|
|
|
|
|
|
int32_t x = 0, y = 0, width = 0, height = 0;
|
|
|
|
mGeckoAccessible->GetBounds (&x, &y, &width, &height);
|
|
|
|
CGFloat scaleFactor =
|
|
|
|
nsCocoaUtils::GetBackingScaleFactor([[NSScreen screens] objectAtIndex:0]);
|
|
|
|
return [NSValue valueWithSize:NSMakeSize(static_cast<CGFloat>(width) / scaleFactor,
|
|
|
|
static_cast<CGFloat>(height) / scaleFactor)];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*)role
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
if (!mGeckoAccessible)
|
2012-05-24 17:24:09 -07:00
|
|
|
return nil;
|
|
|
|
|
2012-07-11 17:23:46 -07:00
|
|
|
#ifdef DEBUG_A11Y
|
2008-10-17 03:10:43 -07:00
|
|
|
NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(mGeckoAccessible),
|
|
|
|
"Does not support nsIAccessibleText when it should");
|
2007-03-22 10:30:00 -07:00
|
|
|
#endif
|
2012-04-26 11:25:33 -07:00
|
|
|
|
2012-07-21 11:32:25 -07:00
|
|
|
#define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule) \
|
2012-04-26 11:25:33 -07:00
|
|
|
case roles::geckoRole: \
|
|
|
|
return macRole;
|
|
|
|
|
|
|
|
switch (mRole) {
|
|
|
|
#include "RoleMap.h"
|
|
|
|
default:
|
|
|
|
NS_NOTREACHED("Unknown role.");
|
|
|
|
return NSAccessibilityUnknownRole;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef ROLE
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*)subrole
|
|
|
|
{
|
2012-06-29 14:12:18 -07:00
|
|
|
if (!mGeckoAccessible)
|
|
|
|
return nil;
|
|
|
|
|
|
|
|
// XXX maybe we should cache the subrole.
|
|
|
|
nsAutoString xmlRoles;
|
|
|
|
|
|
|
|
// XXX we don't need all the attributes (see bug 771113)
|
2012-10-19 00:15:23 -07:00
|
|
|
nsCOMPtr<nsIPersistentProperties> attributes = mGeckoAccessible->Attributes();
|
|
|
|
if (attributes)
|
2012-06-29 14:12:18 -07:00
|
|
|
nsAccUtils::GetAccAttr(attributes, nsGkAtoms::xmlroles, xmlRoles);
|
|
|
|
|
|
|
|
nsWhitespaceTokenizer tokenizer(xmlRoles);
|
|
|
|
|
|
|
|
while (tokenizer.hasMoreTokens()) {
|
|
|
|
const nsDependentSubstring token(tokenizer.nextToken());
|
|
|
|
|
|
|
|
if (token.EqualsLiteral("banner"))
|
|
|
|
return @"AXLandmarkBanner";
|
|
|
|
|
|
|
|
if (token.EqualsLiteral("complementary"))
|
|
|
|
return @"AXLandmarkComplementary";
|
|
|
|
|
|
|
|
if (token.EqualsLiteral("contentinfo"))
|
|
|
|
return @"AXLandmarkContentInfo";
|
|
|
|
|
|
|
|
if (token.EqualsLiteral("main"))
|
|
|
|
return @"AXLandmarkMain";
|
|
|
|
|
|
|
|
if (token.EqualsLiteral("navigation"))
|
|
|
|
return @"AXLandmarkNavigation";
|
|
|
|
|
|
|
|
if (token.EqualsLiteral("search"))
|
|
|
|
return @"AXLandmarkSearch";
|
|
|
|
}
|
|
|
|
|
2012-04-13 11:22:36 -07:00
|
|
|
switch (mRole) {
|
|
|
|
case roles::LIST:
|
2012-05-09 17:47:28 -07:00
|
|
|
return @"AXContentList"; // 10.6+ NSAccessibilityContentListSubrole;
|
2012-04-13 11:22:36 -07:00
|
|
|
|
2012-04-24 11:35:23 -07:00
|
|
|
case roles::DEFINITION_LIST:
|
2012-05-09 17:47:28 -07:00
|
|
|
return @"AXDefinitionList"; // 10.6+ NSAccessibilityDefinitionListSubrole;
|
2012-04-13 11:22:36 -07:00
|
|
|
|
2012-04-24 11:35:23 -07:00
|
|
|
case roles::TERM:
|
|
|
|
return @"AXTerm";
|
2012-04-13 11:22:36 -07:00
|
|
|
|
2012-04-24 11:35:23 -07:00
|
|
|
case roles::DEFINITION:
|
|
|
|
return @"AXDefinition";
|
2012-04-13 11:22:36 -07:00
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
|
2012-04-17 17:31:03 -07:00
|
|
|
- (NSString*)roleDescription
|
|
|
|
{
|
|
|
|
if (mRole == roles::DOCUMENT)
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("htmlContent"));
|
2012-06-29 14:12:18 -07:00
|
|
|
|
2012-04-17 17:31:03 -07:00
|
|
|
NSString* subrole = [self subrole];
|
2012-06-29 14:12:18 -07:00
|
|
|
|
2012-04-17 17:31:03 -07:00
|
|
|
if ((mRole == roles::LISTITEM) && [subrole isEqualToString:@"AXTerm"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("term"));
|
|
|
|
if ((mRole == roles::PARAGRAPH) && [subrole isEqualToString:@"AXDefinition"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("definition"));
|
2012-06-29 14:12:18 -07:00
|
|
|
|
|
|
|
NSString* role = [self role];
|
|
|
|
|
|
|
|
// the WAI-ARIA Landmarks
|
|
|
|
if ([role isEqualToString:NSAccessibilityGroupRole]) {
|
|
|
|
if ([subrole isEqualToString:@"AXLandmarkBanner"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("banner"));
|
|
|
|
if ([subrole isEqualToString:@"AXLandmarkComplementary"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("complementary"));
|
|
|
|
if ([subrole isEqualToString:@"AXLandmarkContentInfo"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("content"));
|
|
|
|
if ([subrole isEqualToString:@"AXLandmarkMain"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("main"));
|
|
|
|
if ([subrole isEqualToString:@"AXLandmarkNavigation"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("navigation"));
|
|
|
|
if ([subrole isEqualToString:@"AXLandmarkSearch"])
|
|
|
|
return utils::LocalizedString(NS_LITERAL_STRING("search"));
|
|
|
|
}
|
|
|
|
|
|
|
|
return NSAccessibilityRoleDescription(role, subrole);
|
2012-04-17 17:31:03 -07:00
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
- (NSString*)title
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAutoString title;
|
2012-04-30 20:08:31 -07:00
|
|
|
mGeckoAccessible->Name(title);
|
2012-06-29 14:12:16 -07:00
|
|
|
return nsCocoaUtils::ToNSString(title);
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (id)value
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAutoString value;
|
|
|
|
mGeckoAccessible->GetValue (value);
|
2013-10-10 09:59:40 -07:00
|
|
|
return value.IsEmpty() ? nil : [NSString stringWithCharacters:reinterpret_cast<const unichar*>(value.BeginReading())
|
|
|
|
length:value.Length()];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)valueDidChange
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef DEBUG_hakan
|
|
|
|
NSLog(@"%@'s value changed!", self);
|
|
|
|
#endif
|
|
|
|
// sending out a notification is expensive, so we don't do it other than for really important objects,
|
|
|
|
// like mozTextAccessible.
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2012-04-02 10:15:00 -07:00
|
|
|
- (void)selectedTextDidChange
|
|
|
|
{
|
|
|
|
// Do nothing. mozTextAccessible will.
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
- (NSString*)customDescription
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2011-04-23 06:14:05 -07:00
|
|
|
if (mGeckoAccessible->IsDefunct())
|
|
|
|
return nil;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAutoString desc;
|
2011-04-23 06:14:05 -07:00
|
|
|
mGeckoAccessible->Description(desc);
|
2012-06-29 14:12:16 -07:00
|
|
|
|
|
|
|
return nsCocoaUtils::ToNSString(desc);
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSString*)help
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsAutoString helpText;
|
|
|
|
mGeckoAccessible->GetHelp (helpText);
|
2013-10-10 09:59:40 -07:00
|
|
|
return helpText.IsEmpty() ? nil : [NSString stringWithCharacters:reinterpret_cast<const unichar*>(helpText.BeginReading())
|
|
|
|
length:helpText.Length()];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// objc-style description (from NSObject); not to be confused with the accessible description above.
|
|
|
|
- (NSString*)description
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return [NSString stringWithFormat:@"(%p) %@", self, [self role]];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)isFocused
|
|
|
|
{
|
2012-06-03 22:41:06 -07:00
|
|
|
return FocusMgr()->IsFocused(mGeckoAccessible);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)canBeFocused
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
return mGeckoAccessible && (mGeckoAccessible->InteractiveState() & states::FOCUSABLE);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)focus
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
if (!mGeckoAccessible)
|
|
|
|
return NO;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsresult rv = mGeckoAccessible->TakeFocus();
|
|
|
|
return NS_SUCCEEDED(rv);
|
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)isEnabled
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
return mGeckoAccessible && ((mGeckoAccessible->InteractiveState() & states::UNAVAILABLE) == 0);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// The root accessible calls this when the focused node was
|
|
|
|
// changed to us.
|
|
|
|
- (void)didReceiveFocus
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
#ifdef DEBUG_hakan
|
|
|
|
NSLog (@"%@ received focus!", self);
|
|
|
|
#endif
|
|
|
|
NSAssert1(![self accessibilityIsIgnored], @"trying to set focus to ignored element! (%@)", self);
|
|
|
|
NSAccessibilityPostNotification(GetObjectOrRepresentedView(self),
|
|
|
|
NSAccessibilityFocusedUIElementChangedNotification);
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSWindow*)window
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
AccessibleWrap* accWrap = static_cast<AccessibleWrap*>(mGeckoAccessible);
|
2010-09-16 20:23:17 -07:00
|
|
|
|
|
|
|
// Get a pointer to the native window (NSWindow) we reside in.
|
2007-03-22 10:30:00 -07:00
|
|
|
NSWindow *nativeWindow = nil;
|
2012-05-27 02:01:40 -07:00
|
|
|
DocAccessible* docAcc = accWrap->Document();
|
2010-09-16 20:23:17 -07:00
|
|
|
if (docAcc)
|
|
|
|
nativeWindow = static_cast<NSWindow*>(docAcc->GetNativeWindow());
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NSAssert1(nativeWindow, @"Could not get native window for %@", self);
|
|
|
|
return nativeWindow;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)invalidateChildren
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
// make room for new children
|
|
|
|
[mChildren release];
|
|
|
|
mChildren = nil;
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2012-05-28 18:18:45 -07:00
|
|
|
- (void)appendChild:(Accessible*)aAccessible
|
2011-12-22 14:31:06 -08:00
|
|
|
{
|
|
|
|
// if mChildren is nil, then we don't even need to bother
|
|
|
|
if (!mChildren)
|
|
|
|
return;
|
|
|
|
|
|
|
|
mozAccessible *curNative = GetNativeFromGeckoAccessible(aAccessible);
|
|
|
|
if (curNative)
|
|
|
|
[mChildren addObject:GetObjectOrRepresentedView(curNative)];
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
- (void)expire
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
[self invalidateChildren];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
2012-07-30 07:20:58 -07:00
|
|
|
mGeckoAccessible = nullptr;
|
2012-05-24 17:24:09 -07:00
|
|
|
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (BOOL)isExpired
|
|
|
|
{
|
2012-06-29 14:12:02 -07:00
|
|
|
return !mGeckoAccessible;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark -
|
|
|
|
#pragma mark Debug methods
|
|
|
|
#pragma mark -
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
|
|
|
|
// will check that our children actually reference us as their
|
|
|
|
// parent.
|
|
|
|
- (void)sanityCheckChildren:(NSArray *)children
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NSAssert(![self accessibilityIsIgnored], @"can't sanity check children of an ignored accessible!");
|
|
|
|
NSEnumerator *iter = [children objectEnumerator];
|
|
|
|
mozAccessible *curObj = nil;
|
|
|
|
|
|
|
|
NSLog(@"sanity checking %@", self);
|
|
|
|
|
|
|
|
while ((curObj = [iter nextObject])) {
|
|
|
|
id realSelf = GetObjectOrRepresentedView(self);
|
|
|
|
NSLog(@"checking %@", realSelf);
|
|
|
|
NSAssert2([curObj parent] == realSelf,
|
|
|
|
@"!!! %@ not returning %@ as AXParent, even though it is a AXChild of it!", curObj, realSelf);
|
|
|
|
}
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)sanityCheckChildren
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
[self sanityCheckChildren:[self children]];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)printHierarchy
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
[self printHierarchyWithLevel:0];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)printHierarchyWithLevel:(unsigned)level
|
|
|
|
{
|
2008-02-22 12:13:17 -08:00
|
|
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NSAssert(![self isExpired], @"!!! trying to print hierarchy of expired object!");
|
|
|
|
|
|
|
|
// print this node
|
|
|
|
NSMutableString *indent = [NSMutableString stringWithCapacity:level];
|
|
|
|
unsigned i=0;
|
|
|
|
for (;i<level;i++)
|
|
|
|
[indent appendString:@" "];
|
|
|
|
|
|
|
|
NSLog (@"%@(#%i) %@", indent, level, self);
|
|
|
|
|
|
|
|
// use |children| method to make sure our children are lazily fetched first.
|
|
|
|
NSArray *children = [self children];
|
|
|
|
if (!children)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (![self accessibilityIsIgnored])
|
|
|
|
[self sanityCheckChildren];
|
|
|
|
|
|
|
|
NSEnumerator *iter = [children objectEnumerator];
|
|
|
|
mozAccessible *object = nil;
|
|
|
|
|
|
|
|
while (iter && (object = [iter nextObject]))
|
|
|
|
// print every child node's subtree, increasing the indenting
|
|
|
|
// by two for every level.
|
|
|
|
[object printHierarchyWithLevel:(level+1)];
|
2008-02-22 12:13:17 -08:00
|
|
|
|
|
|
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* DEBUG */
|
|
|
|
|
|
|
|
@end
|