Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/HTMLHRElement.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
8
#ifndef mozilla_dom_HTMLHRElement_h
9
#define mozilla_dom_HTMLHRElement_h
10
11
#include "nsGenericHTMLElement.h"
12
#include "nsMappedAttributes.h"
13
#include "nsAttrValueInlines.h"
14
15
namespace mozilla {
16
namespace dom {
17
18
class HTMLHRElement final : public nsGenericHTMLElement
19
{
20
public:
21
  explicit HTMLHRElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
22
23
  // nsISupports
24
  NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLHRElement, nsGenericHTMLElement)
25
26
  virtual bool ParseAttribute(int32_t aNamespaceID,
27
                              nsAtom* aAttribute,
28
                              const nsAString& aValue,
29
                              nsIPrincipal* aMaybeScriptedPrincipal,
30
                              nsAttrValue& aResult) override;
31
  NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
32
  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
33
  virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
34
35
  // WebIDL API
36
  void GetAlign(nsAString& aValue) const
37
0
  {
38
0
    GetHTMLAttr(nsGkAtoms::align, aValue);
39
0
  }
40
  void SetAlign(const nsAString& aAlign, ErrorResult& aError)
41
0
  {
42
0
    SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
43
0
  }
44
45
  void GetColor(nsAString& aValue) const
46
0
  {
47
0
    GetHTMLAttr(nsGkAtoms::color, aValue);
48
0
  }
49
  void SetColor(const nsAString& aColor, ErrorResult& aError)
50
0
  {
51
0
    SetHTMLAttr(nsGkAtoms::color, aColor, aError);
52
0
  }
53
54
  bool NoShade() const
55
0
  {
56
0
   return GetBoolAttr(nsGkAtoms::noshade);
57
0
  }
58
  void SetNoShade(bool aNoShade, ErrorResult& aError)
59
0
  {
60
0
    SetHTMLBoolAttr(nsGkAtoms::noshade, aNoShade, aError);
61
0
  }
62
63
  void GetSize(nsAString& aValue) const
64
0
  {
65
0
    GetHTMLAttr(nsGkAtoms::size, aValue);
66
0
  }
67
  void SetSize(const nsAString& aSize, ErrorResult& aError)
68
0
  {
69
0
    SetHTMLAttr(nsGkAtoms::size, aSize, aError);
70
0
  }
71
72
  void GetWidth(nsAString& aValue) const
73
0
  {
74
0
    GetHTMLAttr(nsGkAtoms::width, aValue);
75
0
  }
76
  void SetWidth(const nsAString& aWidth, ErrorResult& aError)
77
0
  {
78
0
    SetHTMLAttr(nsGkAtoms::width, aWidth, aError);
79
0
  }
80
81
protected:
82
  virtual ~HTMLHRElement();
83
84
  virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
85
86
private:
87
  static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
88
                                    MappedDeclarations&);
89
};
90
91
} // namespace dom
92
} // namespace mozilla
93
94
#endif // mozilla_dom_HTMLHRElement_h