1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef MOZILLA_A11Y_OUTERDOCACCESSIBLE_H_
7 #define MOZILLA_A11Y_OUTERDOCACCESSIBLE_H_
9 #include "AccessibleWrap.h"
14 class BrowserBridgeChild
;
18 class DocAccessibleParent
;
21 * Used for <browser>, <frame>, <iframe>, <page> or editor> elements.
23 * In these variable names, "outer" relates to the OuterDocAccessible as
24 * opposed to the DocAccessibleWrap which is "inner". The outer node is
25 * a something like tags listed above, whereas the inner node corresponds to
26 * the inner document root.
29 class OuterDocAccessible final
: public AccessibleWrap
{
31 OuterDocAccessible(nsIContent
* aContent
, DocAccessible
* aDoc
);
33 NS_INLINE_DECL_REFCOUNTING_INHERITED(OuterDocAccessible
, AccessibleWrap
)
35 DocAccessibleParent
* RemoteChildDoc() const;
38 * For iframes in a content process which will be rendered in another content
39 * process, tell the parent process about this OuterDocAccessible
40 * so it can link the trees together when the embedded document is added.
41 * Note that an OuterDocAccessible can be created before the
42 * BrowserBridgeChild or vice versa. Therefore, this must be conditionally
43 * called when either of these is created.
45 void SendEmbedderAccessible(dom::BrowserBridgeChild
* aBridge
);
48 virtual void Shutdown() override
;
49 virtual mozilla::a11y::role
NativeRole() const override
;
50 virtual LocalAccessible
* LocalChildAtPoint(
51 int32_t aX
, int32_t aY
, EWhichChildAtPoint aWhichChild
) override
;
53 virtual bool InsertChildAt(uint32_t aIdx
, LocalAccessible
* aChild
) override
;
54 virtual bool RemoveChild(LocalAccessible
* aAccessible
) override
;
55 virtual bool IsAcceptableChild(nsIContent
* aEl
) const override
;
57 virtual uint32_t ChildCount() const override
;
60 virtual Accessible
* ChildAt(uint32_t aIndex
) const override
;
61 virtual Accessible
* ChildAtPoint(int32_t aX
, int32_t aY
,
62 EWhichChildAtPoint aWhichChild
) override
;
65 virtual ~OuterDocAccessible() override
;
68 inline OuterDocAccessible
* LocalAccessible::AsOuterDoc() {
69 return IsOuterDoc() ? static_cast<OuterDocAccessible
*>(this) : nullptr;
73 } // namespace mozilla