Bumping gaia.json for 8 gaia revision(s) a=gaia-bump
[gecko.git] / dom / html / HTMLPreElement.h
blob32c71403576d817627397f49e313ac2601b0e64e
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"
14 namespace mozilla {
15 namespace dom {
17 class HTMLPreElement MOZ_FINAL : public nsGenericHTMLElement,
18 public nsIDOMHTMLPreElement
20 public:
21 explicit HTMLPreElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
22 : nsGenericHTMLElement(aNodeInfo)
26 // nsISupports
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,
34 nsIAtom* aAttribute,
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;
42 // WebIDL API
43 int32_t Width() const
45 return GetIntAttr(nsGkAtoms::width, 0);
47 void SetWidth(int32_t aWidth, mozilla::ErrorResult& rv)
49 rv = SetIntAttr(nsGkAtoms::width, aWidth);
52 protected:
53 virtual ~HTMLPreElement();
55 virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
57 private:
58 static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
59 nsRuleData* aData);
62 } // namespace dom
63 } // namespace mozilla
65 #endif // mozilla_dom_HTMLPreElement_h