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_CDATASection_h
8 #define mozilla_dom_CDATASection_h
10 #include "mozilla/Attributes.h"
11 #include "mozilla/dom/Text.h"
13 namespace mozilla::dom
{
15 class CDATASection final
: public Text
{
18 MOZ_ASSERT(mNodeInfo
->NodeType() == CDATA_SECTION_NODE
,
19 "Bad NodeType in aNodeInfo");
22 virtual ~CDATASection();
25 explicit CDATASection(already_AddRefed
<mozilla::dom::NodeInfo
>&& aNodeInfo
)
26 : Text(std::move(aNodeInfo
)) {
30 explicit CDATASection(nsNodeInfoManager
* aNodeInfoManager
)
31 : Text(aNodeInfoManager
->GetNodeInfo(nsGkAtoms::cdataTagName
, nullptr,
33 CDATA_SECTION_NODE
)) {
38 NS_INLINE_DECL_REFCOUNTING_INHERITED(CDATASection
, Text
)
41 already_AddRefed
<CharacterData
> CloneDataNode(
42 mozilla::dom::NodeInfo
* aNodeInfo
, bool aCloneText
) const override
;
45 void List(FILE* out
, int32_t aIndent
) const override
;
46 void DumpContent(FILE* out
, int32_t aIndent
, bool aDumpAll
) const override
;
50 JSObject
* WrapNode(JSContext
* aCx
,
51 JS::Handle
<JSObject
*> aGivenProto
) override
;
54 } // namespace mozilla::dom
56 #endif // mozilla_dom_CDATASection_h