Coverage Report

Created: 2018-09-25 14:53

/work/obj-fuzz/dist/include/mozilla/dom/HTMLTableRowElement.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
#ifndef mozilla_dom_HTMLTableRowElement_h
7
#define mozilla_dom_HTMLTableRowElement_h
8
9
#include "mozilla/Attributes.h"
10
#include "nsGenericHTMLElement.h"
11
12
class nsContentList;
13
14
namespace mozilla {
15
namespace dom {
16
17
class HTMLTableSectionElement;
18
19
class HTMLTableRowElement final : public nsGenericHTMLElement
20
{
21
public:
22
  explicit HTMLTableRowElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
23
    : nsGenericHTMLElement(std::move(aNodeInfo))
24
0
  {
25
0
    SetHasWeirdParserInsertionMode();
26
0
  }
27
28
  NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLTableRowElement, tr)
29
30
  // nsISupports
31
  NS_DECL_ISUPPORTS_INHERITED
32
33
  int32_t RowIndex() const;
34
  int32_t SectionRowIndex() const;
35
  nsIHTMLCollection* Cells();
36
  already_AddRefed<nsGenericHTMLElement>
37
    InsertCell(int32_t aIndex, ErrorResult& aError);
38
  void DeleteCell(int32_t aValue, ErrorResult& aError);
39
40
  void GetAlign(DOMString& aAlign)
41
0
  {
42
0
    GetHTMLAttr(nsGkAtoms::align, aAlign);
43
0
  }
44
  void SetAlign(const nsAString& aAlign, ErrorResult& aError)
45
0
  {
46
0
    SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
47
0
  }
48
  void GetCh(DOMString& aCh)
49
0
  {
50
0
    GetHTMLAttr(nsGkAtoms::_char, aCh);
51
0
  }
52
  void SetCh(const nsAString& aCh, ErrorResult& aError)
53
0
  {
54
0
    SetHTMLAttr(nsGkAtoms::_char, aCh, aError);
55
0
  }
56
  void GetChOff(DOMString& aChOff)
57
0
  {
58
0
    GetHTMLAttr(nsGkAtoms::charoff, aChOff);
59
0
  }
60
  void SetChOff(const nsAString& aChOff, ErrorResult& aError)
61
0
  {
62
0
    SetHTMLAttr(nsGkAtoms::charoff, aChOff, aError);
63
0
  }
64
  void GetVAlign(DOMString& aVAlign)
65
0
  {
66
0
    GetHTMLAttr(nsGkAtoms::valign, aVAlign);
67
0
  }
68
  void SetVAlign(const nsAString& aVAlign, ErrorResult& aError)
69
0
  {
70
0
    SetHTMLAttr(nsGkAtoms::valign, aVAlign, aError);
71
0
  }
72
  void GetBgColor(DOMString& aBgColor)
73
0
  {
74
0
    GetHTMLAttr(nsGkAtoms::bgcolor, aBgColor);
75
0
  }
76
  void SetBgColor(const nsAString& aBgColor, ErrorResult& aError)
77
0
  {
78
0
    SetHTMLAttr(nsGkAtoms::bgcolor, aBgColor, aError);
79
0
  }
80
81
  virtual bool ParseAttribute(int32_t aNamespaceID,
82
                                nsAtom* aAttribute,
83
                                const nsAString& aValue,
84
                                nsIPrincipal* aMaybeScriptedPrincipal,
85
                                nsAttrValue& aResult) override;
86
  virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
87
  NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override;
88
89
  virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
90
91
  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLTableRowElement,
92
                                                     nsGenericHTMLElement)
93
94
protected:
95
  virtual ~HTMLTableRowElement();
96
97
  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
98
99
  HTMLTableSectionElement* GetSection() const;
100
  HTMLTableElement* GetTable() const;
101
  RefPtr<nsContentList> mCells;
102
103
private:
104
  static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
105
                                    MappedDeclarations&);
106
};
107
108
} // namespace dom
109
} // namespace mozilla
110
111
#endif /* mozilla_dom_HTMLTableRowElement_h */