mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
bug 1109891 - part 2 - Allow mGeckoAccessible to store pointers to proxies and do some trivial cleanup r=tbsaunde
This commit is contained in:
parent
4a201434bb
commit
706b320072
@ -31,12 +31,15 @@ GetNativeFromGeckoAccessible(mozilla::a11y::Accessible* aAccessible)
|
|||||||
return native;
|
return native;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is OR'd with the Accessible owner to indicate the wrap-ee is a proxy.
|
||||||
|
static const uintptr_t IS_PROXY = 1;
|
||||||
|
|
||||||
@interface mozAccessible : NSObject <mozAccessible>
|
@interface mozAccessible : NSObject <mozAccessible>
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Weak reference; it owns us.
|
* Weak reference; it owns us.
|
||||||
*/
|
*/
|
||||||
mozilla::a11y::AccessibleWrap* mGeckoAccessible;
|
uintptr_t mGeckoAccessible;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strong ref to array of children
|
* Strong ref to array of children
|
||||||
|
@ -65,7 +65,7 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
if ((self = [super init])) {
|
if ((self = [super init])) {
|
||||||
mGeckoAccessible = geckoAccessible;
|
mGeckoAccessible = reinterpret_cast<uintptr_t>(geckoAccessible);
|
||||||
mRole = geckoAccessible->Role();
|
mRole = geckoAccessible->Role();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,11 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
|
|
||||||
- (mozilla::a11y::AccessibleWrap*)getGeckoAccessible
|
- (mozilla::a11y::AccessibleWrap*)getGeckoAccessible
|
||||||
{
|
{
|
||||||
return mGeckoAccessible;
|
// Check if mGeckoAccessible points at a proxy
|
||||||
|
if (mGeckoAccessible & IS_PROXY)
|
||||||
|
return nil;
|
||||||
|
|
||||||
|
return reinterpret_cast<AccessibleWrap*>(mGeckoAccessible);
|
||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark -
|
#pragma mark -
|
||||||
@ -236,7 +240,6 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
- (id)accessibilityHitTest:(NSPoint)point
|
- (id)accessibilityHitTest:(NSPoint)point
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
if (!accWrap)
|
if (!accWrap)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
@ -282,7 +285,6 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
- (id)accessibilityFocusedUIElement
|
- (id)accessibilityFocusedUIElement
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
if (!accWrap)
|
if (!accWrap)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
@ -304,7 +306,6 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
Accessible* accessibleParent = accWrap->GetUnignoredParent();
|
Accessible* accessibleParent = accWrap->GetUnignoredParent();
|
||||||
if (accessibleParent) {
|
if (accessibleParent) {
|
||||||
id nativeParent = GetNativeFromGeckoAccessible(accessibleParent);
|
id nativeParent = GetNativeFromGeckoAccessible(accessibleParent);
|
||||||
@ -348,7 +349,6 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
if (mChildren || !accWrap->AreChildrenCached())
|
if (mChildren || !accWrap->AreChildrenCached())
|
||||||
return mChildren;
|
return mChildren;
|
||||||
|
|
||||||
@ -408,7 +408,6 @@ GetClosestInterestingAccessible(id anObject)
|
|||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
if (!accWrap)
|
if (!accWrap)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
@ -669,7 +668,7 @@ struct RoleDescrComparator
|
|||||||
{
|
{
|
||||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
|
||||||
|
|
||||||
AccessibleWrap* accWrap = static_cast<AccessibleWrap*>([self getGeckoAccessible]);
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
// Get a pointer to the native window (NSWindow) we reside in.
|
// Get a pointer to the native window (NSWindow) we reside in.
|
||||||
NSWindow *nativeWindow = nil;
|
NSWindow *nativeWindow = nil;
|
||||||
@ -711,7 +710,7 @@ struct RoleDescrComparator
|
|||||||
|
|
||||||
[self invalidateChildren];
|
[self invalidateChildren];
|
||||||
|
|
||||||
mGeckoAccessible = nullptr;
|
mGeckoAccessible = 0;
|
||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||||
}
|
}
|
||||||
|
@ -499,7 +499,6 @@ ToNSString(id aValue)
|
|||||||
- (NSString*)text
|
- (NSString*)text
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
if (!accWrap)
|
if (!accWrap)
|
||||||
return nil;
|
return nil;
|
||||||
|
|
||||||
@ -509,7 +508,6 @@ ToNSString(id aValue)
|
|||||||
- (long)textLength
|
- (long)textLength
|
||||||
{
|
{
|
||||||
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
AccessibleWrap* accWrap = [self getGeckoAccessible];
|
||||||
|
|
||||||
if (!accWrap)
|
if (!accWrap)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user