Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/CDATASection.h
Line
Count
Source (jump to first uncovered line)
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/. */
6
7
#ifndef mozilla_dom_CDATASection_h
8
#define mozilla_dom_CDATASection_h
9
10
#include "mozilla/Attributes.h"
11
#include "mozilla/dom/Text.h"
12
13
namespace mozilla {
14
namespace dom {
15
16
class CDATASection final : public Text
17
{
18
private:
19
  void Init()
20
0
  {
21
0
    MOZ_ASSERT(mNodeInfo->NodeType() == CDATA_SECTION_NODE,
22
0
               "Bad NodeType in aNodeInfo");
23
0
  }
24
25
  virtual ~CDATASection();
26
27
public:
28
  explicit CDATASection(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
29
    : Text(std::move(aNodeInfo))
30
0
  {
31
0
    Init();
32
0
  }
33
34
  explicit CDATASection(nsNodeInfoManager* aNodeInfoManager)
35
    : Text(aNodeInfoManager->GetNodeInfo(nsGkAtoms::cdataTagName,
36
                                         nullptr, kNameSpaceID_None,
37
                                         CDATA_SECTION_NODE))
38
0
  {
39
0
    Init();
40
0
  }
41
42
  // nsISupports
43
  NS_INLINE_DECL_REFCOUNTING_INHERITED(CDATASection, Text)
44
45
  // nsINode
46
  virtual bool IsNodeOfType(uint32_t aFlags) const override;
47
48
  virtual already_AddRefed<CharacterData>
49
    CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
50
                  bool aCloneText) const override;
51
52
#ifdef DEBUG
53
  virtual void List(FILE* out, int32_t aIndent) const override;
54
  virtual void DumpContent(FILE* out, int32_t aIndent,bool aDumpAll) const override;
55
#endif
56
57
protected:
58
  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
59
};
60
61
} // namespace dom
62
} // namespace mozilla
63
64
#endif // mozilla_dom_CDATASection_h