Bug 1269990 -Refuse to interpolate when animating between clip-path shape values that have different reference boxes.
MozReview-Commit-ID: JzWestyfGoT
--- 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);