Bug 602759 part 15 - Rename nsSVGTransformListParser as SVGTransformListParser; r=jwatt
authorBrian Birtles <birtles@gmail.com>
Sun, 25 Sep 2011 22:04:32 +0100
changeset 78870 28537c7d79b7c57fbb27d65bd9f44262e1a27eb4
parent 78869 6e72c9d97a42e0b58e5136aeaca64d304a757a47
child 78871 b6bb849d7c9990febb1311c8e8394e030e5684bd
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs602759
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 602759 part 15 - Rename nsSVGTransformListParser as SVGTransformListParser; r=jwatt
content/svg/content/src/Makefile.in
content/svg/content/src/SVGTransformList.cpp
content/svg/content/src/SVGTransformListParser.cpp
content/svg/content/src/SVGTransformListParser.h
content/svg/content/src/nsSVGTransformListParser.cpp
content/svg/content/src/nsSVGTransformListParser.h
--- a/content/svg/content/src/Makefile.in
+++ b/content/svg/content/src/Makefile.in
@@ -115,17 +115,16 @@ CPPSRCS		= \
 		nsSVGSwitchElement.cpp \
 		nsSVGSymbolElement.cpp \
 		nsSVGTSpanElement.cpp \
 		nsSVGTextContentElement.cpp \
 		nsSVGTextElement.cpp \
 		nsSVGTextPathElement.cpp \
 		nsSVGTextPositioningElement.cpp \
 		nsSVGTitleElement.cpp \
-		nsSVGTransformListParser.cpp \
 		nsSVGUseElement.cpp \
 		nsSVGValue.cpp \
 		nsSVGViewBox.cpp \
 		SVGAnimatedLengthList.cpp \
 		SVGAnimatedNumberList.cpp \
 		SVGAnimatedPathSegList.cpp \
 		SVGAnimatedPointList.cpp \
 		SVGAnimatedPreserveAspectRatio.cpp \
@@ -133,16 +132,17 @@ CPPSRCS		= \
 		SVGLength.cpp \
 		SVGLengthList.cpp \
 		SVGNumberList.cpp \
 		SVGPathData.cpp \
 		SVGPathSegUtils.cpp \
 		SVGPointList.cpp \
 		SVGTransform.cpp \
 		SVGTransformList.cpp \
+		SVGTransformListParser.cpp \
 		$(NULL)
 
 ifdef MOZ_SMIL
 CPPSRCS += nsSVGAnimateElement.cpp \
            nsSVGAnimateTransformElement.cpp \
            nsSVGAnimateMotionElement.cpp \
            nsSVGAnimationElement.cpp \
            nsSVGMpathElement.cpp \
--- a/content/svg/content/src/SVGTransformList.cpp
+++ b/content/svg/content/src/SVGTransformList.cpp
@@ -32,17 +32,17 @@
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "SVGTransformList.h"
-#include "nsSVGTransformListParser.h"
+#include "SVGTransformListParser.h"
 
 namespace mozilla {
 
 gfxMatrix
 SVGTransformList::GetConsolidationMatrix() const
 {
   // To benefit from Return Value Optimization and avoid copy constructor calls
   // due to our use of return-by-value, we must return the exact same object
@@ -95,17 +95,17 @@ SVGTransformList::GetValueAsString(nsASt
       aValue.Append(' ');
     }
   }
 }
 
 nsresult
 SVGTransformList::SetValueFromString(const nsAString& aValue)
 {
-  nsSVGTransformListParser parser;
+  SVGTransformListParser parser;
   nsresult rv = parser.Parse(aValue);
 
   if (NS_FAILED(rv)) {
     // there was a parse error.
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
   return CopyFrom(parser.GetTransformList());
rename from content/svg/content/src/nsSVGTransformListParser.cpp
rename to content/svg/content/src/SVGTransformListParser.cpp
--- a/content/svg/content/src/nsSVGTransformListParser.cpp
+++ b/content/svg/content/src/SVGTransformListParser.cpp
@@ -1,10 +1,11 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
+ * ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
  * Software distributed under the License is distributed on an "AS IS" basis,
@@ -30,57 +31,57 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#include "nsSVGTransformListParser.h"
+#include "SVGTransformListParser.h"
 #include "SVGTransform.h"
 #include "prdtoa.h"
 #include "nsDOMError.h"
 #include "nsGkAtoms.h"
 #include "nsReadableUtils.h"
 #include "nsCRT.h"
 #include "nsContentUtils.h"
 #include "nsIDOMClassInfo.h"
 #include "nsIAtom.h"
 
 using namespace mozilla;
 
 //----------------------------------------------------------------------
 // private methods
 
 nsresult
-nsSVGTransformListParser::Match()
+SVGTransformListParser::Match()
 {
   mTransforms.Clear();
   return MatchTransformList();
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchTransformList()
+SVGTransformListParser::MatchTransformList()
 {
   MatchWsp();
 
   if (IsTokenTransformStarter()) {
     ENSURE_MATCHED(MatchTransforms());
   }
 
   MatchWsp();
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchTransforms()
+SVGTransformListParser::MatchTransforms()
 {
   ENSURE_MATCHED(MatchTransform());
 
   while (mTokenType != END) {
     const char* pos = mTokenPos;
 
     /* Curiously the SVG BNF allows multiple comma-wsp between transforms */
     while (IsTokenCommaWspStarter()) {
@@ -95,18 +96,18 @@ nsSVGTransformListParser::MatchTransform
     }
   }
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::GetTransformToken(nsIAtom** aKeyAtom,
-                                            PRBool aAdvancePos)
+SVGTransformListParser::GetTransformToken(nsIAtom** aKeyAtom,
+                                          PRBool aAdvancePos)
 {
   if (mTokenType != OTHER || *mTokenPos == '\0') {
     return NS_ERROR_FAILURE;
   }
 
   nsresult rv = NS_OK;
 
   const char* delimiters = "\x20\x9\xD\xA,(";
@@ -133,17 +134,17 @@ nsSVGTransformListParser::GetTransformTo
     rv = NS_ERROR_FAILURE;
   }
 
   return rv;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchTransform()
+SVGTransformListParser::MatchTransform()
 {
   nsCOMPtr<nsIAtom> keyatom;
 
   nsresult rv = GetTransformToken(getter_AddRefs(keyatom), PR_TRUE);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
@@ -163,17 +164,17 @@ nsSVGTransformListParser::MatchTransform
     return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 
 PRBool
-nsSVGTransformListParser::IsTokenTransformStarter()
+SVGTransformListParser::IsTokenTransformStarter()
 {
   nsCOMPtr<nsIAtom> keyatom;
 
   nsresult rv = GetTransformToken(getter_AddRefs(keyatom), PR_FALSE);
   if (NS_FAILED(rv)) {
     return PR_FALSE;
   }
 
@@ -185,19 +186,19 @@ nsSVGTransformListParser::IsTokenTransfo
       keyatom == nsGkAtoms::matrix) {
     return PR_TRUE;
   }
 
   return PR_FALSE;
 }
 
 nsresult
-nsSVGTransformListParser::MatchNumberArguments(float *aResult,
-                                               PRUint32 aMaxNum,
-                                               PRUint32 *aParsedNum)
+SVGTransformListParser::MatchNumberArguments(float *aResult,
+                                             PRUint32 aMaxNum,
+                                             PRUint32 *aParsedNum)
 {
   *aParsedNum = 0;
 
   MatchWsp();
 
   ENSURE_MATCHED(MatchLeftParen());
 
   MatchWsp();
@@ -222,17 +223,17 @@ nsSVGTransformListParser::MatchNumberArg
   MatchWsp();
 
   ENSURE_MATCHED(MatchRightParen());
 
   return NS_OK;
 }
 
 nsresult
-nsSVGTransformListParser::MatchTranslate()
+SVGTransformListParser::MatchTranslate()
 {
   GetNextToken();
 
   float t[2];
   PRUint32 count;
 
   ENSURE_MATCHED(MatchNumberArguments(t, NS_ARRAY_LENGTH(t), &count));
 
@@ -251,17 +252,17 @@ nsSVGTransformListParser::MatchTranslate
       return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchScale()
+SVGTransformListParser::MatchScale()
 {
   GetNextToken();
 
   float s[2];
   PRUint32 count;
 
   ENSURE_MATCHED(MatchNumberArguments(s, NS_ARRAY_LENGTH(s), &count));
 
@@ -280,17 +281,17 @@ nsSVGTransformListParser::MatchScale()
       return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchRotate()
+SVGTransformListParser::MatchRotate()
 {
   GetNextToken();
 
   float r[3];
   PRUint32 count;
 
   ENSURE_MATCHED(MatchNumberArguments(r, NS_ARRAY_LENGTH(r), &count));
 
@@ -309,17 +310,17 @@ nsSVGTransformListParser::MatchRotate()
       return NS_ERROR_FAILURE;
   }
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchSkewX()
+SVGTransformListParser::MatchSkewX()
 {
   GetNextToken();
 
   float skew;
   PRUint32 count;
 
   ENSURE_MATCHED(MatchNumberArguments(&skew, 1, &count));
 
@@ -331,17 +332,17 @@ nsSVGTransformListParser::MatchSkewX()
   NS_ENSURE_TRUE(transform, NS_ERROR_OUT_OF_MEMORY);
   transform->SetSkewX(skew);
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchSkewY()
+SVGTransformListParser::MatchSkewY()
 {
   GetNextToken();
 
   float skew;
   PRUint32 count;
 
   ENSURE_MATCHED(MatchNumberArguments(&skew, 1, &count));
 
@@ -353,17 +354,17 @@ nsSVGTransformListParser::MatchSkewY()
   NS_ENSURE_TRUE(transform, NS_ERROR_OUT_OF_MEMORY);
   transform->SetSkewY(skew);
 
   return NS_OK;
 }
 
 
 nsresult
-nsSVGTransformListParser::MatchMatrix()
+SVGTransformListParser::MatchMatrix()
 {
   GetNextToken();
 
   float m[6];
   PRUint32 count;
 
   ENSURE_MATCHED(MatchNumberArguments(m, NS_ARRAY_LENGTH(m), &count));
 
rename from content/svg/content/src/nsSVGTransformListParser.h
rename to content/svg/content/src/SVGTransformListParser.h
--- a/content/svg/content/src/nsSVGTransformListParser.h
+++ b/content/svg/content/src/SVGTransformListParser.h
@@ -1,10 +1,11 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* ***** BEGIN LICENSE BLOCK *****
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
+ * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
+ * ***** BEGIN LICENSE BLOCK *****
  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  *
  * The contents of this file are subject to the Mozilla Public License Version
  * 1.1 (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  * http://www.mozilla.org/MPL/
  *
  * Software distributed under the License is distributed on an "AS IS" basis,
@@ -30,41 +31,44 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
-#ifndef __NS_SVGTRANSFORMLISTPARSER_H__
-#define __NS_SVGTRANSFORMLISTPARSER_H__
+#ifndef MOZILLA_SVGTRANSFORMLISTPARSER_H__
+#define MOZILLA_SVGTRANSFORMLISTPARSER_H__
 
 #include "nsSVGDataParser.h"
 #include "nsTArray.h"
 
 ////////////////////////////////////////////////////////////////////////
-// nsSVGTransformListParser: taken from nsSVGPathDataParser, a simple
+// SVGTransformListParser: taken from nsSVGPathDataParser, a simple
 //  recursive descent parser that builds the transform lists from the
 //  transform attributes. The grammar for path data
 // can be found in SVG 1.1,  chapter 7.
 // http://www.w3.org/TR/SVG11/coords.html#TransformAttribute
 
 class nsIAtom;
-namespace mozilla { class SVGTransform; }
+
+namespace mozilla {
 
-class nsSVGTransformListParser : public nsSVGDataParser
+class SVGTransform;
+
+class SVGTransformListParser : public nsSVGDataParser
 {
 public:
-  const nsTArray<mozilla::SVGTransform>& GetTransformList() const {
+  const nsTArray<SVGTransform>& GetTransformList() const {
     return mTransforms;
   }
 
 private:
-  nsTArray<mozilla::SVGTransform> mTransforms;
+  nsTArray<SVGTransform> mTransforms;
 
   // helpers
   virtual nsresult Match();
 
   nsresult MatchNumberArguments(float *aResult,
                                 PRUint32 aMaxNum,
                                 PRUint32 *aParsedNum);
 
@@ -81,9 +85,11 @@ private:
 
   nsresult MatchScale();
   nsresult MatchRotate();
   nsresult MatchSkewX();
   nsresult MatchSkewY();
   nsresult MatchMatrix();
 };
 
-#endif // __NS_SVGTRANSFORMLISTPARSER_H__
+} // namespace mozilla
+
+#endif // MOZILLA_SVGTRANSFORMLISTPARSER_H__