Fix weird SetCoordToValue signature. (Bug 531344) r=dholbert
authorL. David Baron <dbaron@dbaron.org>
Fri, 02 Jul 2010 21:18:56 -0700
changeset 47192 15e9cd490443e35b24ba2a1eec2abe2b9dd2475f
parent 47191 4125a0ac5ec5f41a424f31c975d40ae252d7caf5
child 47193 aa23d71ab2305d7d1b41b0a385752034a696f8fa
push id14265
push userdbaron@mozilla.com
push dateSat, 03 Jul 2010 04:19:19 +0000
treeherdermozilla-central@f2b02ba56bdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs531344
milestone2.0b2pre
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
Fix weird SetCoordToValue signature. (Bug 531344) r=dholbert
layout/style/nsStyleTransformMatrix.cpp
--- a/layout/style/nsStyleTransformMatrix.cpp
+++ b/layout/style/nsStyleTransformMatrix.cpp
@@ -203,22 +203,22 @@ nsStyleTransformMatrix::operator *= (con
 /* op* is implemented in terms of op*=. */
 const nsStyleTransformMatrix
 nsStyleTransformMatrix::operator *(const nsStyleTransformMatrix &aOther) const
 {
   return nsStyleTransformMatrix(*this) *= aOther;
 }
 
 /* Helper function to fill in an nscoord with the specified nsCSSValue. */
-static void SetCoordToValue(const nsCSSValue &aValue,
-                            nsStyleContext* aContext,
-                            nsPresContext* aPresContext,
-                            PRBool &aCanStoreInRuleTree, nscoord &aOut)
+static nscoord CalcLength(const nsCSSValue &aValue,
+                          nsStyleContext* aContext,
+                          nsPresContext* aPresContext,
+                          PRBool &aCanStoreInRuleTree)
 {
-  aOut = nsRuleNode::CalcLength(aValue, aContext, aPresContext,
+  return nsRuleNode::CalcLength(aValue, aContext, aPresContext,
                                 aCanStoreInRuleTree);
 }
 
 /* Helper function to process a matrix entry. */
 static void ProcessMatrix(float aMain[4], nscoord aDelta[2],
                           float aX[2], float aY[2],
                           const nsCSSValue::Array* aData,
                           nsStyleContext* aContext,
@@ -234,40 +234,40 @@ static void ProcessMatrix(float aMain[4]
     aMain[index - 1] = aData->Item(index).GetFloatValue();
 
   /* For the fifth element, if it's a percentage, store it in aX[0].
    * Otherwise, it's a length that needs to go in aDelta[0]
    */
   if (aData->Item(5).GetUnit() == eCSSUnit_Percent)
     aX[0] = aData->Item(5).GetPercentValue();
   else
-    SetCoordToValue(aData->Item(5), aContext, aPresContext, aCanStoreInRuleTree,
-                    aDelta[0]);
+    aDelta[0] = CalcLength(aData->Item(5), aContext, aPresContext,
+                           aCanStoreInRuleTree);
 
   /* For the final element, if it's a percentage, store it in aY[1].
    * Otherwise, it's a length that needs to go in aDelta[1].
    */
   if (aData->Item(6).GetUnit() == eCSSUnit_Percent)
     aY[1] = aData->Item(6).GetPercentValue();
   else
-    SetCoordToValue(aData->Item(6), aContext, aPresContext, aCanStoreInRuleTree,
-                    aDelta[1]);
+    aDelta[1] = CalcLength(aData->Item(6), aContext, aPresContext,
+                           aCanStoreInRuleTree);
 }
 
 static void ProcessTranslatePart(nscoord& aOffset, float& aPercent,
                                  const nsCSSValue& aValue,
                                  nsStyleContext* aContext,
                                  nsPresContext* aPresContext,
                                  PRBool& aCanStoreInRuleTree)
 {
   if (aValue.GetUnit() == eCSSUnit_Percent) {
     aPercent = aValue.GetPercentValue();
   } else {
-    SetCoordToValue(aValue, aContext, aPresContext, aCanStoreInRuleTree,
-                    aOffset);
+    aOffset = CalcLength(aValue, aContext, aPresContext,
+                         aCanStoreInRuleTree);
   }
 }
 
 /* Helper function to process a translatex function. */
 static void ProcessTranslateX(nscoord aDelta[2], float aX[2],
                               const nsCSSValue::Array* aData,
                               nsStyleContext* aContext,
                               nsPresContext* aPresContext,