/work/obj-fuzz/dist/include/mozilla/dom/SVGTextPathElement.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_SVGTextPathElement_h |
8 | | #define mozilla_dom_SVGTextPathElement_h |
9 | | |
10 | | #include "nsSVGEnum.h" |
11 | | #include "nsSVGLength2.h" |
12 | | #include "nsSVGString.h" |
13 | | #include "mozilla/dom/SVGAnimatedPathSegList.h" |
14 | | #include "mozilla/dom/SVGTextContentElement.h" |
15 | | |
16 | | class nsAtom; |
17 | | class nsIContent; |
18 | | |
19 | | nsresult NS_NewSVGTextPathElement(nsIContent **aResult, |
20 | | already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
21 | | |
22 | | namespace mozilla { |
23 | | namespace dom { |
24 | | |
25 | | // textPath side types |
26 | | static const uint16_t TEXTPATH_SIDETYPE_LEFT = 1; |
27 | | static const uint16_t TEXTPATH_SIDETYPE_RIGHT = 2; |
28 | | |
29 | | typedef SVGTextContentElement SVGTextPathElementBase; |
30 | | |
31 | | class SVGTextPathElement final : public SVGTextPathElementBase |
32 | | { |
33 | | friend class ::SVGTextFrame; |
34 | | |
35 | | protected: |
36 | | friend nsresult (::NS_NewSVGTextPathElement(nsIContent **aResult, |
37 | | already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); |
38 | | explicit SVGTextPathElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
39 | | virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override; |
40 | | |
41 | | public: |
42 | | // nsIContent interface |
43 | | NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* aAttribute) const override; |
44 | | |
45 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
46 | | |
47 | 0 | SVGAnimatedPathSegList* GetAnimPathSegList() override { |
48 | 0 | return &mPath; |
49 | 0 | } |
50 | | |
51 | 0 | nsAtom* GetPathDataAttrName() const override { |
52 | 0 | return nsGkAtoms::path; |
53 | 0 | } |
54 | | |
55 | | // WebIDL |
56 | | already_AddRefed<SVGAnimatedLength> StartOffset(); |
57 | | already_AddRefed<SVGAnimatedEnumeration> Method(); |
58 | | already_AddRefed<SVGAnimatedEnumeration> Spacing(); |
59 | | already_AddRefed<SVGAnimatedEnumeration> Side(); |
60 | | already_AddRefed<SVGAnimatedString> Href(); |
61 | | |
62 | | void HrefAsString(nsAString& aHref); |
63 | | |
64 | | protected: |
65 | | |
66 | | virtual LengthAttributesInfo GetLengthInfo() override; |
67 | | virtual EnumAttributesInfo GetEnumInfo() override; |
68 | | virtual StringAttributesInfo GetStringInfo() override; |
69 | | |
70 | | enum { /* TEXTLENGTH, */ STARTOFFSET = 1 }; |
71 | | nsSVGLength2 mLengthAttributes[2]; |
72 | | virtual nsSVGLength2* LengthAttributes() override |
73 | 0 | { return mLengthAttributes; } |
74 | | static LengthInfo sLengthInfo[2]; |
75 | | |
76 | | enum { /* LENGTHADJUST, */ METHOD = 1, SPACING, SIDE }; |
77 | | nsSVGEnum mEnumAttributes[4]; |
78 | | virtual nsSVGEnum* EnumAttributes() override |
79 | 0 | { return mEnumAttributes; } |
80 | | static nsSVGEnumMapping sMethodMap[]; |
81 | | static nsSVGEnumMapping sSpacingMap[]; |
82 | | static nsSVGEnumMapping sSideMap[]; |
83 | | static EnumInfo sEnumInfo[4]; |
84 | | |
85 | | enum { HREF, XLINK_HREF }; |
86 | | nsSVGString mStringAttributes[2]; |
87 | | static StringInfo sStringInfo[2]; |
88 | | |
89 | | SVGAnimatedPathSegList mPath; |
90 | | }; |
91 | | |
92 | | } // namespace dom |
93 | | } // namespace mozilla |
94 | | |
95 | | #endif // mozilla_dom_SVGTextPathElement_h |