Backed out 3 changesets (bug 1879975) for causing bustage while fetching windows...
[gecko.git] / dom / xul / XULFrameElement.h
blob20b467f66a0c02a2471569aee2eafb46e79d1e00
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 nsresult BindToTree(BindContext&, nsINode& aParent) override;
57 void UnbindFromTree(UnbindContext&) override;
58 void DestroyContent() override;
60 void AfterSetAttr(int32_t aNamespaceID, nsAtom* aName,
61 const nsAttrValue* aValue, const nsAttrValue* aOldValue,
62 nsIPrincipal* aSubjectPrincipal, bool aNotify) override;
64 NS_IMPL_FROMNODE_HELPER(XULFrameElement,
65 IsAnyOfXULElements(nsGkAtoms::iframe,
66 nsGkAtoms::browser,
67 nsGkAtoms::editor))
69 protected:
70 virtual ~XULFrameElement() = default;
72 JSObject* WrapNode(JSContext* aCx,
73 JS::Handle<JSObject*> aGivenProto) override;
75 void LoadSrc();
77 private:
78 nsCOMPtr<nsIOpenWindowInfo> mOpenWindowInfo;
81 } // namespace dom
82 } // namespace mozilla
84 #endif // XULFrameElement_h