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 #include "mozilla/dom/CDATASection.h"
8 #include "mozilla/dom/CDATASectionBinding.h"
9 #include "mozilla/IntegerPrintfMacros.h"
11 namespace mozilla::dom
{
13 CDATASection::~CDATASection() = default;
15 JSObject
* CDATASection::WrapNode(JSContext
* aCx
,
16 JS::Handle
<JSObject
*> aGivenProto
) {
17 return CDATASection_Binding::Wrap(aCx
, this, aGivenProto
);
20 already_AddRefed
<CharacterData
> CDATASection::CloneDataNode(
21 mozilla::dom::NodeInfo
* aNodeInfo
, bool aCloneText
) const {
22 RefPtr
<mozilla::dom::NodeInfo
> ni
= aNodeInfo
;
23 auto* nim
= ni
->NodeInfoManager();
24 RefPtr
<CDATASection
> it
= new (nim
) CDATASection(ni
.forget());
33 void CDATASection::List(FILE* out
, int32_t aIndent
) const {
35 for (index
= aIndent
; --index
>= 0;) fputs(" ", out
);
37 fprintf(out
, "CDATASection refcount=%" PRIuPTR
"<", mRefCnt
.get());
40 ToCString(tmp
, 0, mText
.GetLength());
41 fputs(NS_LossyConvertUTF16toASCII(tmp
).get(), out
);
46 void CDATASection::DumpContent(FILE* out
, int32_t aIndent
,
47 bool aDumpAll
) const {}
50 } // namespace mozilla::dom