Bug 1289049 Part 1 - Use shape source instead of clip path in naming.
This function can be used to implement animation for <basic-shape> for
shape-outside, so I remove the clip path in naming to make it more general.
MozReview-Commit-ID: LwVe0Dk5Web
--- a/layout/style/StyleAnimationValue.cpp
+++ b/layout/style/StyleAnimationValue.cpp
@@ -4147,23 +4147,23 @@ ExtractImageLayerSizePairList(const nsSt
break;
}
}
aComputedValue.SetAndAdoptCSSValuePairListValue(result.forget());
}
static bool
-StyleClipBasicShapeToCSSArray(const StyleShapeSource& aClipPath,
- nsCSSValue::Array* aResult)
+StyleShapeSourceToCSSArray(const StyleShapeSource& aShapeSource,
+ nsCSSValue::Array* aResult)
{
MOZ_ASSERT(aResult->Count() == 2,
"Expected array to be presized for a function and the sizing-box");
- const StyleBasicShape* shape = aClipPath.GetBasicShape();
+ const StyleBasicShape* shape = aShapeSource.GetBasicShape();
nsCSSKeyword functionName = shape->GetShapeTypeName();
RefPtr<nsCSSValue::Array> functionArray;
switch (shape->GetShapeType()) {
case StyleBasicShapeType::Circle:
case StyleBasicShapeType::Ellipse: {
const nsTArray<nsStyleCoord>& coords = shape->Coordinates();
MOZ_ASSERT(coords.Length() == ShapeArgumentCount(functionName) - 1,
"Unexpected radii count");
@@ -4231,17 +4231,17 @@ StyleClipBasicShapeToCSSArray(const Styl
functionArray->Item(functionArray->Count() - 1).
SetArrayValue(radiusArray, eCSSUnit_Array);
break;
}
default:
MOZ_ASSERT_UNREACHABLE("Unknown shape type");
return false;
}
- aResult->Item(1).SetEnumValue(aClipPath.GetReferenceBox());
+ aResult->Item(1).SetEnumValue(aShapeSource.GetReferenceBox());
return true;
}
static void
SetFallbackValue(nsCSSValuePair* aPair, const nsStyleSVGPaint& aPaint)
{
if (aPaint.GetFallbackType() == eStyleSVGFallbackType_Color) {
aPair->mYValue.SetColorValue(aPaint.GetFallbackColor());
@@ -4555,17 +4555,17 @@ StyleAnimationValue::ExtractComputedValu
if (type == StyleShapeSourceType::URL) {
auto result = MakeUnique<nsCSSValue>();
result->SetURLValue(clipPath.GetURL());
aComputedValue.SetAndAdoptCSSValueValue(result.release(), eUnit_URL);
} else if (type == StyleShapeSourceType::Box) {
aComputedValue.SetEnumValue(clipPath.GetReferenceBox());
} else if (type == StyleShapeSourceType::Shape) {
RefPtr<nsCSSValue::Array> result = nsCSSValue::Array::Create(2);
- if (!StyleClipBasicShapeToCSSArray(clipPath, result)) {
+ if (!StyleShapeSourceToCSSArray(clipPath, result)) {
return false;
}
aComputedValue.SetCSSValueArrayValue(result, eUnit_Shape);
} else {
MOZ_ASSERT(type == StyleShapeSourceType::None, "unknown type");
aComputedValue.SetNoneValue();
}