Bug 1515936 - Part 1 preemptively fix nsSVGAngle unified compilation bustage r=dholbert
authorlongsonr <longsonr@gmail.com>
Fri, 21 Dec 2018 16:19:29 +0000
changeset 451714 abff637283c5ed716c2fe2ee61e56bb7b10983ba
parent 451713 abfce0d1a991aeaf8c1be56229c7a01f85f9f2d3
child 451715 9382786d8bae1973dbecfece8f64be9ff641b5cb
push id35252
push userccoroiu@mozilla.com
push dateFri, 21 Dec 2018 21:56:22 +0000
treeherdermozilla-central@b23630094b9c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1515936
milestone66.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 1515936 - Part 1 preemptively fix nsSVGAngle unified compilation bustage r=dholbert
dom/svg/nsSVGAngle.cpp
--- a/dom/svg/nsSVGAngle.cpp
+++ b/dom/svg/nsSVGAngle.cpp
@@ -17,84 +17,84 @@
 #include "SVGAnimatedAngle.h"
 #include "SVGOrientSMILType.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 using namespace mozilla::dom::SVGAngle_Binding;
 using namespace mozilla::dom::SVGMarkerElement_Binding;
 
-static const nsStaticAtom* const unitMap[] = {
+static const nsStaticAtom* const angleUnitMap[] = {
     nullptr, /* SVG_ANGLETYPE_UNKNOWN */
     nullptr, /* SVG_ANGLETYPE_UNSPECIFIED */
     nsGkAtoms::deg, nsGkAtoms::rad, nsGkAtoms::grad};
 
 static nsSVGAttrTearoffTable<nsSVGAngle, SVGAnimatedAngle>
     sSVGAnimatedAngleTearoffTable;
 static nsSVGAttrTearoffTable<nsSVGAngle, SVGAngle> sBaseSVGAngleTearoffTable;
 static nsSVGAttrTearoffTable<nsSVGAngle, SVGAngle> sAnimSVGAngleTearoffTable;
 
 /* Helper functions */
 
-static bool IsValidUnitType(uint16_t unit) {
+static bool IsValidAngleUnitType(uint16_t unit) {
   if (unit > SVG_ANGLETYPE_UNKNOWN && unit <= SVG_ANGLETYPE_GRAD) return true;
 
   return false;
 }
 
-static void GetUnitString(nsAString& unit, uint16_t unitType) {
-  if (IsValidUnitType(unitType)) {
-    if (unitMap[unitType]) {
-      unitMap[unitType]->ToString(unit);
+static void GetAngleUnitString(nsAString& unit, uint16_t unitType) {
+  if (IsValidAngleUnitType(unitType)) {
+    if (angleUnitMap[unitType]) {
+      angleUnitMap[unitType]->ToString(unit);
     }
     return;
   }
 
   MOZ_ASSERT_UNREACHABLE("Unknown unit type");
 }
 
-static uint16_t GetUnitTypeForString(const nsAString& unitStr) {
+static uint16_t GetAngleUnitTypeForString(const nsAString& unitStr) {
   if (unitStr.IsEmpty()) return SVG_ANGLETYPE_UNSPECIFIED;
 
   nsStaticAtom* unitAtom = NS_GetStaticAtom(unitStr);
 
   if (unitAtom) {
-    for (uint32_t i = 0; i < ArrayLength(unitMap); i++) {
-      if (unitMap[i] == unitAtom) {
+    for (uint32_t i = 0; i < ArrayLength(angleUnitMap); i++) {
+      if (angleUnitMap[i] == unitAtom) {
         return i;
       }
     }
   }
 
   return SVG_ANGLETYPE_UNKNOWN;
 }
 
-static void GetValueString(nsAString& aValueAsString, float aValue,
-                           uint16_t aUnitType) {
+static void GetAngleValueString(nsAString& aValueAsString, float aValue,
+                                uint16_t aUnitType) {
   nsTextFormatter::ssprintf(aValueAsString, u"%g", (double)aValue);
 
   nsAutoString unitString;
-  GetUnitString(unitString, aUnitType);
+  GetAngleUnitString(unitString, aUnitType);
   aValueAsString.Append(unitString);
 }
 
 /* static */ bool nsSVGAngle::GetValueFromString(const nsAString& aString,
                                                  float& aValue,
                                                  uint16_t* aUnitType) {
   RangedPtr<const char16_t> iter = SVGContentUtils::GetStartRangedPtr(aString);
   const RangedPtr<const char16_t> end =
       SVGContentUtils::GetEndRangedPtr(aString);
 
   if (!SVGContentUtils::ParseNumber(iter, end, aValue)) {
     return false;
   }
 
   const nsAString& units = Substring(iter.get(), end.get());
-  *aUnitType = GetUnitTypeForString(units);
-  return IsValidUnitType(*aUnitType);
+  *aUnitType = GetAngleUnitTypeForString(units);
+  return IsValidAngleUnitType(*aUnitType);
 }
 
 /* static */ float nsSVGAngle::GetDegreesPerUnit(uint8_t aUnit) {
   switch (aUnit) {
     case SVG_ANGLETYPE_UNSPECIFIED:
     case SVG_ANGLETYPE_DEG:
       return 1;
     case SVG_ANGLETYPE_RAD:
@@ -120,17 +120,17 @@ void nsSVGAngle::SetBaseValueInSpecified
   } else {
     aSVGElement->AnimationNeedsResample();
   }
   aSVGElement->DidChangeAngle(mAttrEnum, emptyOrOldValue);
 }
 
 nsresult nsSVGAngle::ConvertToSpecifiedUnits(uint16_t unitType,
                                              SVGElement* aSVGElement) {
-  if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
+  if (!IsValidAngleUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
 
   if (mBaseValUnit == uint8_t(unitType)) return NS_OK;
 
   nsAttrValue emptyOrOldValue;
   if (aSVGElement) {
     emptyOrOldValue = aSVGElement->WillChangeAngle(mAttrEnum);
   }
 
@@ -146,17 +146,17 @@ nsresult nsSVGAngle::ConvertToSpecifiedU
   return NS_OK;
 }
 
 nsresult nsSVGAngle::NewValueSpecifiedUnits(uint16_t unitType,
                                             float valueInSpecifiedUnits,
                                             SVGElement* aSVGElement) {
   NS_ENSURE_FINITE(valueInSpecifiedUnits, NS_ERROR_ILLEGAL_VALUE);
 
-  if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
+  if (!IsValidAngleUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
 
   if (mBaseVal == valueInSpecifiedUnits && mBaseValUnit == uint8_t(unitType))
     return NS_OK;
 
   nsAttrValue emptyOrOldValue;
   if (aSVGElement) {
     emptyOrOldValue = aSVGElement->WillChangeAngle(mAttrEnum);
   }
@@ -234,21 +234,21 @@ nsresult nsSVGAngle::SetBaseValueString(
 
   if (aDoSetAttr) {
     aSVGElement->DidChangeAngle(mAttrEnum, emptyOrOldValue);
   }
   return NS_OK;
 }
 
 void nsSVGAngle::GetBaseValueString(nsAString& aValueAsString) const {
-  GetValueString(aValueAsString, mBaseVal, mBaseValUnit);
+  GetAngleValueString(aValueAsString, mBaseVal, mBaseValUnit);
 }
 
 void nsSVGAngle::GetAnimValueString(nsAString& aValueAsString) const {
-  GetValueString(aValueAsString, mAnimVal, mAnimValUnit);
+  GetAngleValueString(aValueAsString, mAnimVal, mAnimValUnit);
 }
 
 void nsSVGAngle::SetBaseValue(float aValue, uint8_t aUnit,
                               SVGElement* aSVGElement, bool aDoSetAttr) {
   float valueInSpecifiedUnits = aValue / GetDegreesPerUnit(aUnit);
   if (aUnit == mBaseValUnit && mBaseVal == valueInSpecifiedUnits) {
     return;
   }