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"
18 #include "nsXULElement.h"
19 #include "nsFrameLoaderOwner.h"
21 class nsIWebNavigation
;
29 class BrowsingContext
;
31 class XULFrameElement final
: public nsXULElement
, public nsFrameLoaderOwner
{
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();
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
);
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
,
70 virtual ~XULFrameElement() = default;
72 JSObject
* WrapNode(JSContext
* aCx
,
73 JS::Handle
<JSObject
*> aGivenProto
) override
;
78 nsCOMPtr
<nsIOpenWindowInfo
> mOpenWindowInfo
;
82 } // namespace mozilla
84 #endif // XULFrameElement_h