Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/CSSNamespaceRule.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_CSSNamespaceRule_h
8
#define mozilla_dom_CSSNamespaceRule_h
9
10
#include "mozilla/css/Rule.h"
11
#include "mozilla/dom/CSSNamespaceRuleBinding.h"
12
#include "mozilla/ServoBindingTypes.h"
13
14
class nsAtom;
15
16
namespace mozilla {
17
namespace dom {
18
19
class CSSNamespaceRule final : public css::Rule
20
{
21
public:
22
  CSSNamespaceRule(already_AddRefed<RawServoNamespaceRule> aRule,
23
                   StyleSheet* aSheet,
24
                   css::Rule* aParentRule,
25
                   uint32_t aLine,
26
                   uint32_t aColumn)
27
    : css::Rule(aSheet, aParentRule, aLine, aColumn)
28
    , mRawRule(std::move(aRule))
29
0
  {
30
0
  }
31
32
0
  bool IsCCLeaf() const final {
33
0
    return Rule::IsCCLeaf();
34
0
  }
35
36
#ifdef DEBUG
37
  void List(FILE* out = stdout, int32_t aIndent = 0) const final;
38
#endif
39
40
  nsAtom* GetPrefix() const;
41
  void GetURLSpec(nsString& aURLSpec) const;
42
43
  // WebIDL interface
44
  void GetCssText(nsAString& aCssText) const final;
45
46
  // WebIDL interfaces
47
0
  uint16_t Type() const final { return CSSRule_Binding::NAMESPACE_RULE; }
48
49
0
  void GetNamespaceURI(nsString& aNamespaceURI) {
50
0
    GetURLSpec(aNamespaceURI);
51
0
  }
52
53
0
  void GetPrefix(DOMString& aPrefix) {
54
0
    aPrefix.SetKnownLiveAtom(GetPrefix(), DOMString::eTreatNullAsEmpty);
55
0
  }
56
57
  size_t SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const final;
58
59
  JSObject* WrapObject(JSContext* aCx,
60
0
                       JS::Handle<JSObject*> aGivenProto) final {
61
0
    return CSSNamespaceRule_Binding::Wrap(aCx, this, aGivenProto);
62
0
  }
63
64
private:
65
  ~CSSNamespaceRule();
66
  RefPtr<RawServoNamespaceRule> mRawRule;
67
};
68
69
} // namespace dom
70
} // namespace mozilla
71
72
#endif // mozilla_dom_CSSNamespaceRule_h