Bug 1494333 - index crons just like artifacts r=Callek
[gecko.git] / dom / html / HTMLTableRowElement.h
blobac8068fe5e2aa3309fd686ee57df21d9bf3e2aa9
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
9 #include "mozilla/Attributes.h"
10 #include "nsGenericHTMLElement.h"
12 class nsContentList;
14 namespace mozilla {
15 namespace dom {
17 class HTMLTableSectionElement;
19 class HTMLTableRowElement final : public nsGenericHTMLElement
21 public:
22 explicit HTMLTableRowElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
23 : nsGenericHTMLElement(std::move(aNodeInfo))
25 SetHasWeirdParserInsertionMode();
28 NS_IMPL_FROMNODE_HTML_WITH_TAG(HTMLTableRowElement, tr)
30 // nsISupports
31 NS_DECL_ISUPPORTS_INHERITED
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);
40 void GetAlign(DOMString& aAlign)
42 GetHTMLAttr(nsGkAtoms::align, aAlign);
44 void SetAlign(const nsAString& aAlign, ErrorResult& aError)
46 SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
48 void GetCh(DOMString& aCh)
50 GetHTMLAttr(nsGkAtoms::_char, aCh);
52 void SetCh(const nsAString& aCh, ErrorResult& aError)
54 SetHTMLAttr(nsGkAtoms::_char, aCh, aError);
56 void GetChOff(DOMString& aChOff)
58 GetHTMLAttr(nsGkAtoms::charoff, aChOff);
60 void SetChOff(const nsAString& aChOff, ErrorResult& aError)
62 SetHTMLAttr(nsGkAtoms::charoff, aChOff, aError);
64 void GetVAlign(DOMString& aVAlign)
66 GetHTMLAttr(nsGkAtoms::valign, aVAlign);
68 void SetVAlign(const nsAString& aVAlign, ErrorResult& aError)
70 SetHTMLAttr(nsGkAtoms::valign, aVAlign, aError);
72 void GetBgColor(DOMString& aBgColor)
74 GetHTMLAttr(nsGkAtoms::bgcolor, aBgColor);
76 void SetBgColor(const nsAString& aBgColor, ErrorResult& aError)
78 SetHTMLAttr(nsGkAtoms::bgcolor, aBgColor, aError);
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;
89 virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
91 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLTableRowElement,
92 nsGenericHTMLElement)
94 protected:
95 virtual ~HTMLTableRowElement();
97 virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
99 HTMLTableSectionElement* GetSection() const;
100 HTMLTableElement* GetTable() const;
101 RefPtr<nsContentList> mCells;
103 private:
104 static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
105 MappedDeclarations&);
108 } // namespace dom
109 } // namespace mozilla
111 #endif /* mozilla_dom_HTMLTableRowElement_h */