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"
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
24 class SVGTransformListParser
: public SVGDataParser
{
26 explicit SVGTransformListParser(const nsAString
& aValue
)
27 : SVGDataParser(aValue
) {}
31 const nsTArray
<SVGTransform
>& GetTransformList() const { return mTransforms
; }
35 bool ParseArguments(float* aResult
, uint32_t aMaxCount
,
36 uint32_t* aParsedCount
);
38 bool ParseTransforms();
40 bool ParseTransform();
42 bool ParseTranslate();
49 FallibleTArray
<SVGTransform
> mTransforms
;
52 } // namespace mozilla
54 #endif // DOM_SVG_SVGTRANSFORMLISTPARSER_H_