Bug 867089 - Validate the playbackRate before using it. r=ehsan
[gecko.git] / layout / svg / nsSVGTextPathFrame.h
blobfd116a9c1f6c137da3168c91b68e0c3a5960f982
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 NSSVGTEXTPATHFRAME_H
7 #define NSSVGTEXTPATHFRAME_H
9 #include "gfxTypes.h"
10 #include "nsCOMPtr.h"
11 #include "nsFrame.h"
12 #include "nsISVGChildFrame.h"
13 #include "nsLiteralString.h"
14 #include "nsQueryFrame.h"
15 #include "nsSVGTSpanFrame.h"
17 class gfxFlattenedPath;
18 class nsIAtom;
19 class nsIContent;
20 class nsIFrame;
21 class nsIPresShell;
22 class nsStyleContext;
24 namespace mozilla {
25 class SVGNumberList;
28 typedef nsSVGTSpanFrame nsSVGTextPathFrameBase;
30 class nsSVGTextPathFrame : public nsSVGTextPathFrameBase
32 typedef mozilla::SVGNumberList SVGNumberList;
34 friend nsIFrame*
35 NS_NewSVGTextPathFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
36 protected:
37 nsSVGTextPathFrame(nsStyleContext* aContext) : nsSVGTextPathFrameBase(aContext) {}
39 public:
40 NS_DECL_FRAMEARENA_HELPERS
42 // nsIFrame:
43 #ifdef DEBUG
44 virtual void Init(nsIContent* aContent,
45 nsIFrame* aParent,
46 nsIFrame* aPrevInFlow) MOZ_OVERRIDE;
47 #endif
49 NS_IMETHOD AttributeChanged(int32_t aNameSpaceID,
50 nsIAtom* aAttribute,
51 int32_t aModType);
52 /**
53 * Get the "type" of the frame
55 * @see nsGkAtoms::svgGFrame
57 virtual nsIAtom* GetType() const;
59 #ifdef DEBUG
60 NS_IMETHOD GetFrameName(nsAString& aResult) const
62 return MakeFrameName(NS_LITERAL_STRING("SVGTextPath"), aResult);
64 #endif
66 // nsSVGTextPathFrame methods:
67 already_AddRefed<gfxFlattenedPath> GetFlattenedPath();
68 nsIFrame *GetPathFrame();
70 /**
71 * Gets the scale by which offsets along this textPath must be scaled. This
72 * scaling is due to the user provided 'pathLength' attribute on the <path>
73 * element, which is a user provided estimate of the path length.
75 gfxFloat GetOffsetScale();
77 /**
78 * Gets the offset from the start of the path at which the first character
79 * should be positioned. The value returned already takes GetOffsetScale
80 * into account.
82 gfxFloat GetStartOffset();
84 protected:
86 virtual void GetXY(SVGUserUnitList *aX, SVGUserUnitList *aY);
87 virtual void GetDxDy(SVGUserUnitList *aDx, SVGUserUnitList *aDy);
88 virtual const SVGNumberList *GetRotate();
91 #endif