Bug 1760738 [wpt PR 33295] - Remove subresource loading with WebBundles's WPT of...
[gecko.git] / accessible / generic / OuterDocAccessible.h
blobb6ab022cf188063d785887ca6b996533af159a0a
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"
11 namespace mozilla {
13 namespace dom {
14 class BrowserBridgeChild;
17 namespace a11y {
18 class DocAccessibleParent;
20 /**
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 {
30 public:
31 OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc);
33 NS_INLINE_DECL_REFCOUNTING_INHERITED(OuterDocAccessible, AccessibleWrap)
35 DocAccessibleParent* RemoteChildDoc() const;
37 /**
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);
47 // LocalAccessible
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;
59 // Accessible
60 virtual Accessible* ChildAt(uint32_t aIndex) const override;
61 virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY,
62 EWhichChildAtPoint aWhichChild) override;
64 protected:
65 virtual ~OuterDocAccessible() override;
68 inline OuterDocAccessible* LocalAccessible::AsOuterDoc() {
69 return IsOuterDoc() ? static_cast<OuterDocAccessible*>(this) : nullptr;
72 } // namespace a11y
73 } // namespace mozilla
75 #endif