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