/work/obj-fuzz/dist/include/mozilla/dom/HTMLPreElement.h
Line | Count | Source (jump to first uncovered line) |
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_HTMLPreElement_h |
8 | | #define mozilla_dom_HTMLPreElement_h |
9 | | |
10 | | #include "mozilla/Attributes.h" |
11 | | |
12 | | #include "nsGenericHTMLElement.h" |
13 | | |
14 | | namespace mozilla { |
15 | | namespace dom { |
16 | | |
17 | | class HTMLPreElement final : public nsGenericHTMLElement |
18 | | { |
19 | | public: |
20 | | explicit HTMLPreElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
21 | | : nsGenericHTMLElement(std::move(aNodeInfo)) |
22 | 0 | { |
23 | 0 | } |
24 | | |
25 | | // nsISupports |
26 | | NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLPreElement, nsGenericHTMLElement) |
27 | | |
28 | | virtual bool ParseAttribute(int32_t aNamespaceID, |
29 | | nsAtom* aAttribute, |
30 | | const nsAString& aValue, |
31 | | nsIPrincipal* aMaybeScriptedPrincipal, |
32 | | nsAttrValue& aResult) override; |
33 | | NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; |
34 | | virtual nsMapRuleToAttributesFunc GetAttributeMappingFunction() const override; |
35 | | |
36 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
37 | | |
38 | | // WebIDL API |
39 | | int32_t Width() const |
40 | 0 | { |
41 | 0 | return GetIntAttr(nsGkAtoms::width, 0); |
42 | 0 | } |
43 | | void SetWidth(int32_t aWidth, mozilla::ErrorResult& rv) |
44 | 0 | { |
45 | 0 | rv = SetIntAttr(nsGkAtoms::width, aWidth); |
46 | 0 | } |
47 | | |
48 | | protected: |
49 | | virtual ~HTMLPreElement(); |
50 | | |
51 | | virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) override; |
52 | | |
53 | | private: |
54 | | static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes, |
55 | | MappedDeclarations&); |
56 | | }; |
57 | | |
58 | | } // namespace dom |
59 | | } // namespace mozilla |
60 | | |
61 | | #endif // mozilla_dom_HTMLPreElement_h |