Bug 1269990 -Refuse to interpolate when animating between clip-path shape values that have different reference boxes. draft
authorcku <cku@mozilla.com>
Mon, 08 Aug 2016 18:13:42 +0800
changeset 398973 304c526d4ae0b2b91804131bad8c9b31e0c68195
parent 398604 6cf0089510fad8deb866136f5b92bbced9498447
child 527802 a7317b7fe74619d6e1220915a76c6a33a2bcbecd
push id25689
push userbmo:cku@mozilla.com
push dateWed, 10 Aug 2016 05:18:34 +0000
bugs1269990
milestone51.0a1
Bug 1269990 -Refuse to interpolate when animating between clip-path shape values that have different reference boxes. MozReview-Commit-ID: JzWestyfGoT
layout/style/StyleAnimationValue.cpp
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -1939,18 +1939,21 @@ AddShapeFunction(nsCSSProperty aProperty
   MOZ_ASSERT(aArray1->Item(0).GetUnit() == eCSSUnit_Function,
              "expected function");
   MOZ_ASSERT(aArray2->Item(0).GetUnit() == eCSSUnit_Function,
              "expected function");
   MOZ_ASSERT(aArray1->Item(1).GetUnit() == eCSSUnit_Enumerated,
              "expected geometry-box");
   MOZ_ASSERT(aArray2->Item(1).GetUnit() == eCSSUnit_Enumerated,
              "expected geometry-box");
-  MOZ_ASSERT(aArray1->Item(1).GetIntValue() == aArray2->Item(1).GetIntValue(),
-             "expected matching geometry-box values");
+
+  if (aArray1->Item(1).GetIntValue() != aArray2->Item(1).GetIntValue()) {
+    return nullptr; // Both shapes must use the same reference box.
+  }
+
   const nsCSSValue::Array* func1 = aArray1->Item(0).GetArrayValue();
   const nsCSSValue::Array* func2 = aArray2->Item(0).GetArrayValue();
   nsCSSKeyword shapeFuncName = func1->Item(0).GetKeywordValue();
   if (shapeFuncName != func2->Item(0).GetKeywordValue()) {
     return nullptr; // Can't add two shapes of different types.
   }
 
   RefPtr<nsCSSValue::Array> result = nsCSSValue::Array::Create(2);