Line data Source code
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_HTMLTableSectionElement_h
7 : #define mozilla_dom_HTMLTableSectionElement_h
8 :
9 : #include "mozilla/Attributes.h"
10 : #include "nsGenericHTMLElement.h"
11 : #include "nsContentList.h" // For ctor.
12 :
13 : namespace mozilla {
14 : namespace dom {
15 :
16 : class HTMLTableSectionElement final : public nsGenericHTMLElement
17 : {
18 : public:
19 0 : explicit HTMLTableSectionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
20 0 : : nsGenericHTMLElement(aNodeInfo)
21 : {
22 0 : SetHasWeirdParserInsertionMode();
23 0 : }
24 :
25 : // nsISupports
26 : NS_DECL_ISUPPORTS_INHERITED
27 :
28 : nsIHTMLCollection* Rows();
29 : already_AddRefed<nsGenericHTMLElement>
30 : InsertRow(int32_t aIndex, ErrorResult& aError);
31 : void DeleteRow(int32_t aValue, ErrorResult& aError);
32 :
33 0 : void GetAlign(DOMString& aAlign)
34 : {
35 0 : GetHTMLAttr(nsGkAtoms::align, aAlign);
36 0 : }
37 0 : void SetAlign(const nsAString& aAlign, ErrorResult& aError)
38 : {
39 0 : SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
40 0 : }
41 0 : void GetCh(DOMString& aCh)
42 : {
43 0 : GetHTMLAttr(nsGkAtoms::_char, aCh);
44 0 : }
45 0 : void SetCh(const nsAString& aCh, ErrorResult& aError)
46 : {
47 0 : SetHTMLAttr(nsGkAtoms::_char, aCh, aError);
48 0 : }
49 0 : void GetChOff(DOMString& aChOff)
50 : {
51 0 : GetHTMLAttr(nsGkAtoms::charoff, aChOff);
52 0 : }
53 0 : void SetChOff(const nsAString& aChOff, ErrorResult& aError)
54 : {
55 0 : SetHTMLAttr(nsGkAtoms::charoff, aChOff, aError);
56 0 : }
57 0 : void GetVAlign(DOMString& aVAlign)
58 : {
59 0 : GetHTMLAttr(nsGkAtoms::valign, aVAlign);
60 0 : }
61 0 : void SetVAlign(const nsAString& aVAlign, ErrorResult& aError)
62 : {
63 0 : SetHTMLAttr(nsGkAtoms::valign, aVAlign, aError);
64 0 : }
65 :
66 : virtual bool ParseAttribute(int32_t aNamespaceID,
67 : nsIAtom* aAttribute,
68 : const nsAString& aValue,
69 : nsAttrValue& aResult) override;
70 : virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
71 : NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
72 :
73 : virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
74 : bool aPreallocateChildren) const override;
75 :
76 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED_NO_UNLINK(HTMLTableSectionElement,
77 : nsGenericHTMLElement)
78 : protected:
79 : virtual ~HTMLTableSectionElement();
80 :
81 : virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
82 :
83 : RefPtr<nsContentList> mRows;
84 :
85 : private:
86 : static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
87 : GenericSpecifiedValues* aGenericData);
88 : };
89 :
90 : } // namespace dom
91 : } // namespace mozilla
92 :
93 : #endif /* mozilla_dom_HTMLTableSectionElement_h */
|