Bug 1113419: Make eUnit_Filter ordering more consistent, in switch statements & enum definition in StyleAnimationValue.h,cpp r=krit
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 19 Dec 2014 10:12:29 -0800
changeset 233254 056b301fd9829cb40337cf7f85fd375b1daffec6
parent 233253 001e0c8c26b4c87276ffce5ad8845a51f269dfb4
child 233255 b6aba55876988ea7c5c3b0c17ebb4275984dc784
push id285
push usernalexander@mozilla.com
push dateSun, 21 Dec 2014 23:30:10 +0000
reviewerskrit
bugs1113419
milestone37.0a1
Bug 1113419: Make eUnit_Filter ordering more consistent, in switch statements & enum definition in StyleAnimationValue.h,cpp r=krit
layout/style/StyleAnimationValue.cpp
layout/style/StyleAnimationValue.h
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -3605,19 +3605,19 @@ StyleAnimationValue::operator=(const Sty
       NS_ABORT_IF_FALSE(aOther.mValue.mCSSValueTriplet,
                         "value triplets may not be null");
       mValue.mCSSValueTriplet = new nsCSSValueTriplet(*aOther.mValue.mCSSValueTriplet);
       break;
     case eUnit_CSSRect:
       NS_ABORT_IF_FALSE(aOther.mValue.mCSSRect, "rects may not be null");
       mValue.mCSSRect = new nsCSSRect(*aOther.mValue.mCSSRect);
       break;
-    case eUnit_Filter:
     case eUnit_Dasharray:
     case eUnit_Shadow:
+    case eUnit_Filter:
     case eUnit_BackgroundPosition:
       NS_ABORT_IF_FALSE(mUnit == eUnit_Shadow || mUnit == eUnit_Filter ||
                         aOther.mValue.mCSSValueList,
                         "value lists other than shadows and filters may not be null");
       if (aOther.mValue.mCSSValueList) {
         mValue.mCSSValueList = aOther.mValue.mCSSValueList->Clone();
       } else {
         mValue.mCSSValueList = nullptr;
@@ -3843,18 +3843,18 @@ StyleAnimationValue::operator==(const St
       return *mValue.mCSSValue == *aOther.mValue.mCSSValue;
     case eUnit_CSSValuePair:
       return *mValue.mCSSValuePair == *aOther.mValue.mCSSValuePair;
     case eUnit_CSSValueTriplet:
       return *mValue.mCSSValueTriplet == *aOther.mValue.mCSSValueTriplet;
     case eUnit_CSSRect:
       return *mValue.mCSSRect == *aOther.mValue.mCSSRect;
     case eUnit_Dasharray:
+    case eUnit_Shadow:
     case eUnit_Filter:
-    case eUnit_Shadow:
     case eUnit_BackgroundPosition:
       return nsCSSValueList::Equal(mValue.mCSSValueList,
                                    aOther.mValue.mCSSValueList);
     case eUnit_Transform:
       return *mValue.mCSSValueSharedList == *aOther.mValue.mCSSValueSharedList;
     case eUnit_CSSValuePairList:
       return nsCSSValuePairList::Equal(mValue.mCSSValuePairList,
                                        aOther.mValue.mCSSValuePairList);
--- a/layout/style/StyleAnimationValue.h
+++ b/layout/style/StyleAnimationValue.h
@@ -215,18 +215,18 @@ public:
     eUnit_Calc, // nsCSSValue* (never null), always with a single
                 // calc() expression that's either length or length+percent
     eUnit_ObjectPosition, // nsCSSValue* (never null), always with a
                           // 4-entry nsCSSValue::Array
     eUnit_CSSValuePair, // nsCSSValuePair* (never null)
     eUnit_CSSValueTriplet, // nsCSSValueTriplet* (never null)
     eUnit_CSSRect, // nsCSSRect* (never null)
     eUnit_Dasharray, // nsCSSValueList* (never null)
+    eUnit_Shadow, // nsCSSValueList* (may be null)
     eUnit_Filter, // nsCSSValueList* (may be null)
-    eUnit_Shadow, // nsCSSValueList* (may be null)
     eUnit_Transform, // nsCSSValueList* (never null)
     eUnit_BackgroundPosition, // nsCSSValueList* (never null)
     eUnit_CSSValuePairList, // nsCSSValuePairList* (never null)
     eUnit_UnparsedString // nsStringBuffer* (never null)
   };
 
 private:
   Unit mUnit;