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 mozilla_dom_HTMLMetaElement_h
8 #define mozilla_dom_HTMLMetaElement_h
10 #include "mozilla/Attributes.h"
11 #include "nsGenericHTMLElement.h"
16 class HTMLMetaElement final
: public nsGenericHTMLElement
{
18 explicit HTMLMetaElement(
19 already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
);
22 NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLMetaElement
, nsGenericHTMLElement
)
24 virtual nsresult
BindToTree(BindContext
&, nsINode
& aParent
) override
;
25 virtual void UnbindFromTree(bool aNullParent
= true) override
;
27 virtual nsresult
AfterSetAttr(int32_t aNameSpaceID
, nsAtom
* aName
,
28 const nsAttrValue
* aValue
,
29 const nsAttrValue
* aOldValue
,
30 nsIPrincipal
* aSubjectPrincipal
,
31 bool aNotify
) override
;
33 void CreateAndDispatchEvent(Document
* aDoc
, const nsAString
& aEventName
);
35 virtual nsresult
Clone(dom::NodeInfo
*, nsINode
** aResult
) const override
;
37 void GetName(nsAString
& aValue
) { GetHTMLAttr(nsGkAtoms::name
, aValue
); }
38 void SetName(const nsAString
& aName
, ErrorResult
& aRv
) {
39 SetHTMLAttr(nsGkAtoms::name
, aName
, aRv
);
41 void GetHttpEquiv(nsAString
& aValue
) {
42 GetHTMLAttr(nsGkAtoms::httpEquiv
, aValue
);
44 void SetHttpEquiv(const nsAString
& aHttpEquiv
, ErrorResult
& aRv
) {
45 SetHTMLAttr(nsGkAtoms::httpEquiv
, aHttpEquiv
, aRv
);
47 void GetContent(nsAString
& aValue
) {
48 GetHTMLAttr(nsGkAtoms::content
, aValue
);
50 void SetContent(const nsAString
& aContent
, ErrorResult
& aRv
) {
51 SetHTMLAttr(nsGkAtoms::content
, aContent
, aRv
);
53 void GetScheme(nsAString
& aValue
) { GetHTMLAttr(nsGkAtoms::scheme
, aValue
); }
54 void SetScheme(const nsAString
& aScheme
, ErrorResult
& aRv
) {
55 SetHTMLAttr(nsGkAtoms::scheme
, aScheme
, aRv
);
58 virtual JSObject
* WrapNode(JSContext
* aCx
,
59 JS::Handle
<JSObject
*> aGivenProto
) override
;
62 virtual ~HTMLMetaElement();
65 void SetMetaReferrer(Document
* aDocument
);
69 } // namespace mozilla
71 #endif // mozilla_dom_HTMLMetaElement_h