Bug 1665252 - remove allowpaymentrequest attribute from HTMLIFrameElement r=dom-worke...
[gecko.git] / dom / base / Comment.h
blobb334d3732be0c8940f91670cbebf1d96dfaf92c7
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_Comment_h
8 #define mozilla_dom_Comment_h
10 #include "mozilla/Attributes.h"
11 #include "mozilla/dom/CharacterData.h"
13 namespace mozilla {
14 namespace dom {
16 class Comment final : public CharacterData {
17 private:
18 void Init() {
19 MOZ_ASSERT(mNodeInfo->NodeType() == COMMENT_NODE,
20 "Bad NodeType in aNodeInfo");
23 virtual ~Comment();
25 public:
26 explicit Comment(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
27 : CharacterData(std::move(aNodeInfo)) {
28 Init();
31 explicit Comment(nsNodeInfoManager* aNodeInfoManager)
32 : CharacterData(aNodeInfoManager->GetCommentNodeInfo()) {
33 Init();
36 NS_IMPL_FROMNODE_HELPER(Comment, IsComment())
38 // nsISupports
39 NS_INLINE_DECL_REFCOUNTING_INHERITED(Comment, CharacterData)
41 virtual already_AddRefed<CharacterData> CloneDataNode(
42 mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const override;
44 #ifdef DEBUG
45 virtual void List(FILE* out, int32_t aIndent) const override;
46 virtual void DumpContent(FILE* out = stdout, int32_t aIndent = 0,
47 bool aDumpAll = true) const override {
48 return;
50 #endif
52 static already_AddRefed<Comment> Constructor(const GlobalObject& aGlobal,
53 const nsAString& aData,
54 ErrorResult& aRv);
56 protected:
57 virtual JSObject* WrapNode(JSContext* aCx,
58 JS::Handle<JSObject*> aGivenProto) override;
61 } // namespace dom
62 } // namespace mozilla
64 #endif // mozilla_dom_Comment_h