Bug 1568157 - Part 4: Replace `toolbox.walker` with the contextual WalkerFront. r...
[gecko.git] / accessible / base / AccessibleOrProxy.cpp
blob5322af60402480c1fb5e2930039e5b0c3e412d8a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "AccessibleOrProxy.h"
9 namespace mozilla {
10 namespace a11y {
12 AccessibleOrProxy AccessibleOrProxy::Parent() const {
13 if (IsAccessible()) {
14 return AsAccessible()->Parent();
17 ProxyAccessible* proxy = AsProxy();
18 if (!proxy) {
19 return nullptr;
22 if (ProxyAccessible* parent = proxy->Parent()) {
23 return parent;
26 // Otherwise this should be the proxy for the tab's top level document.
27 return proxy->OuterDocOfRemoteBrowser();
30 } // namespace a11y
31 } // namespace mozilla