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 HTMLDivElement_h___
7 : #define HTMLDivElement_h___
8 :
9 : #include "mozilla/Attributes.h"
10 : #include "nsGenericHTMLElement.h"
11 :
12 : namespace mozilla {
13 : namespace dom {
14 :
15 : class HTMLDivElement final : public nsGenericHTMLElement
16 : {
17 : public:
18 39 : explicit HTMLDivElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
19 39 : : nsGenericHTMLElement(aNodeInfo)
20 : {
21 39 : }
22 :
23 0 : void GetAlign(DOMString& aAlign)
24 : {
25 0 : GetHTMLAttr(nsGkAtoms::align, aAlign);
26 0 : }
27 0 : void SetAlign(const nsAString& aAlign, mozilla::ErrorResult& aError)
28 : {
29 0 : SetHTMLAttr(nsGkAtoms::align, aAlign, aError);
30 0 : }
31 :
32 : virtual bool ParseAttribute(int32_t aNamespaceID,
33 : nsIAtom* aAttribute,
34 : const nsAString& aValue,
35 : nsAttrValue& aResult) override;
36 : NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom* aAttribute) const override;
37 : virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override;
38 : virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult,
39 : bool aPreallocateChildren) const override;
40 :
41 : protected:
42 : virtual ~HTMLDivElement();
43 :
44 : virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override;
45 :
46 : private:
47 : static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
48 : GenericSpecifiedValues* aGenericData);
49 : };
50 :
51 : } // namespace dom
52 : } // namespace mozilla
53 :
54 : #endif /* HTMLDivElement_h___ */
|