Bug 1800790 [wpt PR 36982] - Add makotokato as reviewer, a=testonly
[gecko.git] / accessible / atk / nsMaiInterfaceHyperlinkImpl.cpp
blob1a4474a89dcf54686d44e5e3c58152739cd9a43a
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 "InterfaceInitFuncs.h"
9 #include "nsMaiHyperlink.h"
10 #include "mozilla/Likely.h"
12 using namespace mozilla::a11y;
14 extern "C" {
15 static AtkHyperlink* getHyperlinkCB(AtkHyperlinkImpl* aImpl) {
16 AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
17 if (!accWrap && !GetProxy(ATK_OBJECT(aImpl))) return nullptr;
19 if (accWrap) NS_ASSERTION(accWrap->IsLink(), "why isn't it a link!");
21 return MAI_ATK_OBJECT(aImpl)->GetAtkHyperlink();
25 void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface* aIface) {
26 NS_ASSERTION(aIface, "no interface!");
27 if (MOZ_UNLIKELY(!aIface)) return;
29 aIface->get_hyperlink = getHyperlinkCB;