LCOV - code coverage report
Current view: top level - dom/svg - SVGTransformListParser.h (source / functions) Hit Total Coverage
Test: output.info Lines: 5 5 100.0 %
Date: 2017-07-14 16:53:18 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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_SVGTRANSFORMLISTPARSER_H__
       8             : #define MOZILLA_SVGTRANSFORMLISTPARSER_H__
       9             : 
      10             : #include "mozilla/Attributes.h"
      11             : #include "nsSVGDataParser.h"
      12             : #include "nsTArray.h"
      13             : 
      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
      19             : 
      20             : namespace mozilla {
      21             : 
      22             : class nsSVGTransform;
      23             : 
      24           7 : class SVGTransformListParser : public nsSVGDataParser
      25             : {
      26             : public:
      27           7 :   explicit SVGTransformListParser(const nsAString& aValue)
      28           7 :     : nsSVGDataParser(aValue) {}
      29             : 
      30             :   bool Parse();
      31             : 
      32           7 :   const nsTArray<nsSVGTransform>& GetTransformList() const {
      33           7 :     return mTransforms;
      34             :   }
      35             : 
      36             : private:
      37             :   // helpers
      38             :   bool ParseArguments(float *aResult,
      39             :                       uint32_t aMaxCount,
      40             :                       uint32_t *aParsedCount);
      41             : 
      42             :   bool ParseTransforms();
      43             : 
      44             :   bool ParseTransform();
      45             : 
      46             :   bool ParseTranslate();
      47             :   bool ParseScale();
      48             :   bool ParseRotate();
      49             :   bool ParseSkewX();
      50             :   bool ParseSkewY();
      51             :   bool ParseMatrix();
      52             : 
      53             :   FallibleTArray<nsSVGTransform> mTransforms;
      54             : };
      55             : 
      56             : } // namespace mozilla
      57             : 
      58             : #endif // MOZILLA_SVGTRANSFORMLISTPARSER_H__

Generated by: LCOV version 1.13