Bug 1769952 - Fix running raptor on a Win10-64 VM r=sparky
[gecko.git] / dom / xul / XULFrameElement.h
blob72247c7f06843e6da7d99e393d47ff6ade0e86f6
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=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 #ifndef XULFrameElement_h__
8 #define XULFrameElement_h__
10 #include "mozilla/Attributes.h"
11 #include "mozilla/dom/Nullable.h"
12 #include "mozilla/dom/WindowProxyHolder.h"
13 #include "js/TypeDecls.h"
14 #include "nsCycleCollectionParticipant.h"
15 #include "nsIOpenWindowInfo.h"
16 #include "nsWrapperCache.h"
17 #include "nsString.h"
18 #include "nsXULElement.h"
19 #include "nsFrameLoaderOwner.h"
21 class nsIWebNavigation;
22 class nsFrameLoader;
24 namespace mozilla {
25 class ErrorResult;
27 namespace dom {
29 class BrowsingContext;
31 class XULFrameElement final : public nsXULElement, public nsFrameLoaderOwner {
32 public:
33 explicit XULFrameElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
34 : nsXULElement(std::move(aNodeInfo)) {}
36 NS_DECL_ISUPPORTS_INHERITED
37 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULFrameElement, nsXULElement)
39 // XULFrameElement.webidl
40 nsDocShell* GetDocShell();
41 already_AddRefed<nsIWebNavigation> GetWebNavigation();
42 Nullable<WindowProxyHolder> GetContentWindow();
43 Document* GetContentDocument();
44 uint64_t BrowserId();
45 nsIOpenWindowInfo* GetOpenWindowInfo() const;
46 void SetOpenWindowInfo(nsIOpenWindowInfo* aInfo);
48 void SwapFrameLoaders(mozilla::dom::HTMLIFrameElement& aOtherLoaderOwner,
49 mozilla::ErrorResult& rv);
50 void SwapFrameLoaders(XULFrameElement& aOtherLoaderOwner,
51 mozilla::ErrorResult& rv);
52 void SwapFrameLoaders(nsFrameLoaderOwner* aOtherLoaderOwner,
53 mozilla::ErrorResult& rv);
55 // nsIContent
56 virtual nsresult BindToTree(BindContext&, nsINode& aParent) override;
57 virtual void UnbindFromTree(bool aNullParent) override;
58 virtual void DestroyContent() override;
60 virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
61 const nsAttrValue* aValue,
62 const nsAttrValue* aOldValue,
63 nsIPrincipal* aSubjectPrincipal,
64 bool aNotify) override;
66 NS_IMPL_FROMNODE_HELPER(XULFrameElement,
67 IsAnyOfXULElements(nsGkAtoms::iframe,
68 nsGkAtoms::browser,
69 nsGkAtoms::editor))
71 protected:
72 virtual ~XULFrameElement() = default;
74 JSObject* WrapNode(JSContext* aCx,
75 JS::Handle<JSObject*> aGivenProto) override;
77 void LoadSrc();
79 private:
80 nsCOMPtr<nsIOpenWindowInfo> mOpenWindowInfo;
83 } // namespace dom
84 } // namespace mozilla
86 #endif // XULFrameElement_h