Bug 718627 - Part 3: Make helper GetObjectOrRepresentedView() public in mozAccessible.h. r=surkov

This commit is contained in:
Hub Figuière 2012-03-23 11:54:55 -07:00
Родитель 5b25a7d5f0
Коммит a1e57fd3cb
3 изменённых файлов: 13 добавлений и 16 удалений

Просмотреть файл

@ -44,6 +44,18 @@
@class mozRootAccessible;
/**
* All mozAccessibles are either abstract objects (that correspond to XUL
* widgets, HTML frames, etc) or are attached to a certain view; for example
* a document view. When we hand an object off to an AT, we always want
* to give it the represented view, in the latter case.
*/
inline id <mozAccessible>
GetObjectOrRepresentedView(id <mozAccessible> aObject)
{
return [aObject hasRepresentedView] ? [aObject representedView] : aObject;
}
@interface mozAccessible : NSObject <mozAccessible>
{
/**

Просмотреть файл

@ -71,21 +71,6 @@ ConvertCocoaToGeckoPoint(NSPoint &aInPoint, nsPoint &aOutPoint)
aOutPoint.MoveTo ((nscoord)aInPoint.x, (nscoord)(mainScreenHeight - aInPoint.y));
}
// all mozAccessibles are either abstract objects (that correspond to XUL widgets, HTML frames, etc) or are
// attached to a certain view; for example a document view. when we hand an object off to an AT, we always want
// to give it the represented view, in the latter case.
static inline id <mozAccessible>
GetObjectOrRepresentedView(id <mozAccessible> anObject)
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
if ([anObject hasRepresentedView])
return [anObject representedView];
return anObject;
NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
}
// returns the passed in object if it is not ignored. if it's ignored, will return
// the first unignored ancestor.
static inline id

Просмотреть файл

@ -245,7 +245,7 @@ using namespace mozilla::a11y;
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
NSAccessibilityPostNotification([self hasRepresentedView] ? [self representedView] : self,
NSAccessibilityPostNotification(GetObjectOrRepresentedView(self),
NSAccessibilityValueChangedNotification);
NS_OBJC_END_TRY_ABORT_BLOCK;