summaryrefslogtreecommitdiffstats
path: root/accessible/mac/mozTableAccessible.mm
diff options
context:
space:
mode:
authoradeshkp <adeshkp@users.noreply.github.com>2019-05-04 09:51:45 -0400
committeradeshkp <adeshkp@users.noreply.github.com>2019-05-04 09:52:08 -0400
commit758663e882c49294e58a5c527f3164b6cc72c369 (patch)
tree7cf39a54f04370c883722bf4ca2aa88e0865a938 /accessible/mac/mozTableAccessible.mm
parentd9d9d1ed8d5fd676d9f2d0226cb087df9575cd4b (diff)
downloadUXP-758663e882c49294e58a5c527f3164b6cc72c369.tar
UXP-758663e882c49294e58a5c527f3164b6cc72c369.tar.gz
UXP-758663e882c49294e58a5c527f3164b6cc72c369.tar.lz
UXP-758663e882c49294e58a5c527f3164b6cc72c369.tar.xz
UXP-758663e882c49294e58a5c527f3164b6cc72c369.zip
De-unify accessibility build on Mac.
Also fixes Linux build bustage with accessibility enabled.
Diffstat (limited to 'accessible/mac/mozTableAccessible.mm')
-rw-r--r--accessible/mac/mozTableAccessible.mm41
1 files changed, 41 insertions, 0 deletions
diff --git a/accessible/mac/mozTableAccessible.mm b/accessible/mac/mozTableAccessible.mm
index a3612e5bc..6ad157b9f 100644
--- a/accessible/mac/mozTableAccessible.mm
+++ b/accessible/mac/mozTableAccessible.mm
@@ -5,9 +5,50 @@
* 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/. */
+#import "Accessible-inl.h"
#import "mozTableAccessible.h"
+#import "TableAccessible.h"
+#import "TableCellAccessible.h"
#import "nsCocoaUtils.h"
+using namespace mozilla::a11y;
+
+// convert an array of Gecko accessibles to an NSArray of native accessibles
+static inline NSMutableArray*
+ConvertToNSArray(nsTArray<Accessible*>& aArray)
+{
+ NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
+
+ // iterate through the list, and get each native accessible.
+ size_t totalCount = aArray.Length();
+ for (size_t i = 0; i < totalCount; i++) {
+ Accessible* curAccessible = aArray.ElementAt(i);
+ mozAccessible* curNative = GetNativeFromGeckoAccessible(curAccessible);
+ if (curNative)
+ [nativeArray addObject:GetObjectOrRepresentedView(curNative)];
+ }
+
+ return nativeArray;
+}
+
+// convert an array of Gecko proxy accessibles to an NSArray of native accessibles
+static inline NSMutableArray*
+ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray)
+{
+ NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
+
+ // iterate through the list, and get each native accessible.
+ size_t totalCount = aArray.Length();
+ for (size_t i = 0; i < totalCount; i++) {
+ ProxyAccessible* curAccessible = aArray.ElementAt(i);
+ mozAccessible* curNative = GetNativeFromProxy(curAccessible);
+ if (curNative)
+ [nativeArray addObject:GetObjectOrRepresentedView(curNative)];
+ }
+
+ return nativeArray;
+}
+
@implementation mozTablePartAccessible
- (BOOL)isLayoutTablePart;
{