Bug 1861403: update link to RFC doc for pref "network.http.http3.priority". r=necko...
[gecko.git] / dom / xml / CDATASection.h
blobab20a2d21e4828438fa057b0b0b5b4d0f7e584e9
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 {
16 private:
17 void Init() {
18 MOZ_ASSERT(mNodeInfo->NodeType() == CDATA_SECTION_NODE,
19 "Bad NodeType in aNodeInfo");
22 virtual ~CDATASection();
24 public:
25 explicit CDATASection(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
26 : Text(std::move(aNodeInfo)) {
27 Init();
30 explicit CDATASection(nsNodeInfoManager* aNodeInfoManager)
31 : Text(aNodeInfoManager->GetNodeInfo(nsGkAtoms::cdataTagName, nullptr,
32 kNameSpaceID_None,
33 CDATA_SECTION_NODE)) {
34 Init();
37 // nsISupports
38 NS_INLINE_DECL_REFCOUNTING_INHERITED(CDATASection, Text)
40 // nsINode
41 already_AddRefed<CharacterData> CloneDataNode(
42 mozilla::dom::NodeInfo* aNodeInfo, bool aCloneText) const override;
44 #ifdef MOZ_DOM_LIST
45 void List(FILE* out, int32_t aIndent) const override;
46 void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const override;
47 #endif
49 protected:
50 JSObject* WrapNode(JSContext* aCx,
51 JS::Handle<JSObject*> aGivenProto) override;
54 } // namespace mozilla::dom
56 #endif // mozilla_dom_CDATASection_h