no bug - Bumping Firefox l10n changesets r=release a=l10n-bump DONTBUILD CLOSED TREE
[gecko.git] / dom / svg / SVGTransformListParser.h
blob38e2e3ba5c4d3929786dc021df778ade6c6d1e44
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/. */
7 #ifndef DOM_SVG_SVGTRANSFORMLISTPARSER_H_
8 #define DOM_SVG_SVGTRANSFORMLISTPARSER_H_
10 #include "mozilla/Attributes.h"
11 #include "SVGDataParser.h"
12 #include "nsTArray.h"
14 ////////////////////////////////////////////////////////////////////////
15 // SVGTransformListParser: A simple recursive descent parser that builds
16 // transform lists from transform attributes. The grammar for path data
17 // can be found in SVG 1.1, chapter 7.
18 // http://www.w3.org/TR/SVG11/coords.html#TransformAttribute
20 namespace mozilla {
22 class SVGTransform;
24 class SVGTransformListParser : public SVGDataParser {
25 public:
26 explicit SVGTransformListParser(const nsAString& aValue)
27 : SVGDataParser(aValue) {}
29 bool Parse();
31 const nsTArray<SVGTransform>& GetTransformList() const { return mTransforms; }
33 private:
34 // helpers
35 bool ParseArguments(float* aResult, uint32_t aMaxCount,
36 uint32_t* aParsedCount);
38 bool ParseTransforms();
40 bool ParseTransform();
42 bool ParseTranslate();
43 bool ParseScale();
44 bool ParseRotate();
45 bool ParseSkewX();
46 bool ParseSkewY();
47 bool ParseMatrix();
49 FallibleTArray<SVGTransform> mTransforms;
52 } // namespace mozilla
54 #endif // DOM_SVG_SVGTRANSFORMLISTPARSER_H_