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"
16 class Comment final
: public CharacterData
{
19 MOZ_ASSERT(mNodeInfo
->NodeType() == COMMENT_NODE
,
20 "Bad NodeType in aNodeInfo");
26 explicit Comment(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
27 : CharacterData(std::move(aNodeInfo
)) {
31 explicit Comment(nsNodeInfoManager
* aNodeInfoManager
)
32 : CharacterData(aNodeInfoManager
->GetCommentNodeInfo()) {
36 NS_IMPL_FROMNODE_HELPER(Comment
, IsComment())
39 NS_INLINE_DECL_REFCOUNTING_INHERITED(Comment
, CharacterData
)
41 virtual already_AddRefed
<CharacterData
> CloneDataNode(
42 mozilla::dom::NodeInfo
* aNodeInfo
, bool aCloneText
) const override
;
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
{
52 static already_AddRefed
<Comment
> Constructor(const GlobalObject
& aGlobal
,
53 const nsAString
& aData
,
57 virtual JSObject
* WrapNode(JSContext
* aCx
,
58 JS::Handle
<JSObject
*> aGivenProto
) override
;
62 } // namespace mozilla
64 #endif // mozilla_dom_Comment_h