Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/SVGDocument.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_SVGDocument_h
8
#define mozilla_dom_SVGDocument_h
9
10
#include "mozilla/Attributes.h"
11
#include "mozilla/dom/XMLDocument.h"
12
13
class nsSVGElement;
14
15
namespace mozilla {
16
17
class SVGContextPaint;
18
19
namespace dom {
20
21
class SVGForeignObjectElement;
22
23
class SVGDocument final : public XMLDocument
24
{
25
public:
26
  SVGDocument()
27
    : XMLDocument("image/svg+xml")
28
0
  {
29
0
    mType = eSVG;
30
0
  }
31
32
  virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
33
34
  void SetCurrentContextPaint(const SVGContextPaint* aContextPaint)
35
0
  {
36
0
    mCurrentContextPaint = aContextPaint;
37
0
  }
38
39
  const SVGContextPaint* GetCurrentContextPaint() const
40
0
  {
41
0
    return mCurrentContextPaint;
42
0
  }
43
44
private:
45
46
  // This is maintained by AutoSetRestoreSVGContextPaint.
47
  const SVGContextPaint* mCurrentContextPaint = nullptr;
48
};
49
50
} // namespace dom
51
} // namespace mozilla
52
53
inline mozilla::dom::SVGDocument*
54
nsIDocument::AsSVGDocument()
55
0
{
56
0
  MOZ_ASSERT(IsSVGDocument());
57
0
  return static_cast<mozilla::dom::SVGDocument*>(this);
58
0
}
59
60
#endif // mozilla_dom_SVGDocument_h