Bug 1877642 - Disable browser_fullscreen-tab-close-race.js on apple_silicon !debug...
[gecko.git] / accessible / ios / MUIRootAccessible.mm
blob35c87272e91d4b1fd7b767761aa71770e600d683
1 /* clang-format off */
2 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 /* clang-format on */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "RootAccessibleWrap.h"
10 #import "MUIRootAccessible.h"
11 #import <UIKit/UIScreen.h>
13 using namespace mozilla::a11y;
15 static id<MUIRootAccessibleProtocol> getNativeViewFromRootAccessible(
16     LocalAccessible* aAccessible) {
17   RootAccessibleWrap* root =
18       static_cast<RootAccessibleWrap*>(aAccessible->AsRoot());
19   id<MUIRootAccessibleProtocol> nativeView = nil;
20   root->GetNativeWidget((void**)&nativeView);
21   return nativeView;
24 #pragma mark -
26 @implementation MUIRootAccessible
28 - (id)initWithAccessible:(mozilla::a11y::Accessible*)aAcc {
29   MOZ_ASSERT(!aAcc->IsRemote(), "MUIRootAccessible is never remote");
31   mParallelView = getNativeViewFromRootAccessible(aAcc->AsLocal());
33   return [super initWithAccessible:aAcc];
36 - (BOOL)hasRepresentedView {
37   return YES;
40 // this will return our parallel UIView.
41 - (id)representedView {
42   return mParallelView;
45 @end