1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_HTMLPreElement_h
7 #define mozilla_dom_HTMLPreElement_h
9 #include "mozilla/Attributes.h"
11 #include "nsIDOMHTMLPreElement.h"
12 #include "nsGenericHTMLElement.h"
17 class HTMLPreElement MOZ_FINAL
: public nsGenericHTMLElement
,
18 public nsIDOMHTMLPreElement
21 explicit HTMLPreElement(already_AddRefed
<mozilla::dom::NodeInfo
>& aNodeInfo
)
22 : nsGenericHTMLElement(aNodeInfo
)
27 NS_DECL_ISUPPORTS_INHERITED
29 // nsIDOMHTMLPreElement
30 NS_IMETHOD
GetWidth(int32_t* aWidth
) MOZ_OVERRIDE
;
31 NS_IMETHOD
SetWidth(int32_t aWidth
) MOZ_OVERRIDE
;
33 virtual bool ParseAttribute(int32_t aNamespaceID
,
35 const nsAString
& aValue
,
36 nsAttrValue
& aResult
) MOZ_OVERRIDE
;
37 NS_IMETHOD_(bool) IsAttributeMapped(const nsIAtom
* aAttribute
) const MOZ_OVERRIDE
;
38 virtual nsMapRuleToAttributesFunc
GetAttributeMappingFunction() const MOZ_OVERRIDE
;
40 virtual nsresult
Clone(mozilla::dom::NodeInfo
*aNodeInfo
, nsINode
**aResult
) const MOZ_OVERRIDE
;
45 return GetIntAttr(nsGkAtoms::width
, 0);
47 void SetWidth(int32_t aWidth
, mozilla::ErrorResult
& rv
)
49 rv
= SetIntAttr(nsGkAtoms::width
, aWidth
);
53 virtual ~HTMLPreElement();
55 virtual JSObject
* WrapNode(JSContext
*aCx
) MOZ_OVERRIDE
;
58 static void MapAttributesIntoRule(const nsMappedAttributes
* aAttributes
,
63 } // namespace mozilla
65 #endif // mozilla_dom_HTMLPreElement_h