/work/obj-fuzz/dist/include/mozilla/dom/SVGPatternElement.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_SVGPatternElement_h |
8 | | #define mozilla_dom_SVGPatternElement_h |
9 | | |
10 | | #include "nsAutoPtr.h" |
11 | | #include "nsSVGEnum.h" |
12 | | #include "nsSVGLength2.h" |
13 | | #include "nsSVGString.h" |
14 | | #include "nsSVGElement.h" |
15 | | #include "nsSVGViewBox.h" |
16 | | #include "SVGAnimatedPreserveAspectRatio.h" |
17 | | #include "nsSVGAnimatedTransformList.h" |
18 | | |
19 | | class nsSVGPatternFrame; |
20 | | |
21 | | nsresult NS_NewSVGPatternElement(nsIContent **aResult, |
22 | | already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
23 | | |
24 | | namespace mozilla { |
25 | | namespace dom { |
26 | | class SVGAnimatedTransformList; |
27 | | |
28 | | typedef nsSVGElement SVGPatternElementBase; |
29 | | |
30 | | class SVGPatternElement final : public SVGPatternElementBase |
31 | | { |
32 | | friend class ::nsSVGPatternFrame; |
33 | | |
34 | | protected: |
35 | | friend nsresult (::NS_NewSVGPatternElement(nsIContent **aResult, |
36 | | already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); |
37 | | explicit SVGPatternElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
38 | | virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override; |
39 | | |
40 | | public: |
41 | | typedef mozilla::SVGAnimatedPreserveAspectRatio SVGAnimatedPreserveAspectRatio; |
42 | | |
43 | | // nsIContent interface |
44 | | NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override; |
45 | | |
46 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
47 | | |
48 | | // nsSVGSVGElement methods: |
49 | | virtual bool HasValidDimensions() const override; |
50 | | |
51 | | virtual mozilla::nsSVGAnimatedTransformList* |
52 | | GetAnimatedTransformList(uint32_t aFlags = 0) override; |
53 | 0 | virtual nsAtom* GetTransformListAttrName() const override { |
54 | 0 | return nsGkAtoms::patternTransform; |
55 | 0 | } |
56 | | |
57 | | // WebIDL |
58 | | already_AddRefed<SVGAnimatedRect> ViewBox(); |
59 | | already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio(); |
60 | | already_AddRefed<SVGAnimatedEnumeration> PatternUnits(); |
61 | | already_AddRefed<SVGAnimatedEnumeration> PatternContentUnits(); |
62 | | already_AddRefed<SVGAnimatedTransformList> PatternTransform(); |
63 | | already_AddRefed<SVGAnimatedLength> X(); |
64 | | already_AddRefed<SVGAnimatedLength> Y(); |
65 | | already_AddRefed<SVGAnimatedLength> Width(); |
66 | | already_AddRefed<SVGAnimatedLength> Height(); |
67 | | already_AddRefed<SVGAnimatedString> Href(); |
68 | | |
69 | | protected: |
70 | | |
71 | | virtual LengthAttributesInfo GetLengthInfo() override; |
72 | | virtual EnumAttributesInfo GetEnumInfo() override; |
73 | | virtual nsSVGViewBox *GetViewBox() override; |
74 | | virtual SVGAnimatedPreserveAspectRatio *GetPreserveAspectRatio() override; |
75 | | virtual StringAttributesInfo GetStringInfo() override; |
76 | | |
77 | | enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT }; |
78 | | nsSVGLength2 mLengthAttributes[4]; |
79 | | static LengthInfo sLengthInfo[4]; |
80 | | |
81 | | enum { PATTERNUNITS, PATTERNCONTENTUNITS }; |
82 | | nsSVGEnum mEnumAttributes[2]; |
83 | | static EnumInfo sEnumInfo[2]; |
84 | | |
85 | | nsAutoPtr<mozilla::nsSVGAnimatedTransformList> mPatternTransform; |
86 | | |
87 | | enum { HREF, XLINK_HREF }; |
88 | | nsSVGString mStringAttributes[2]; |
89 | | static StringInfo sStringInfo[2]; |
90 | | |
91 | | // SVGFitToViewbox properties |
92 | | nsSVGViewBox mViewBox; |
93 | | SVGAnimatedPreserveAspectRatio mPreserveAspectRatio; |
94 | | }; |
95 | | |
96 | | } // namespace dom |
97 | | } // namespace mozilla |
98 | | |
99 | | #endif // mozilla_dom_SVGPatternElement_h |