Bug 1081350 - Fix leak in clip-path computed style code. r=bz
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -5178,18 +5178,16 @@ nsComputedDOMStyle::DoGetStopColor()
CSSValue*
nsComputedDOMStyle::CreatePrimitiveValueForClipPath(
const nsStyleBasicShape* aStyleBasicShape, uint8_t aSizingBox)
{
nsDOMCSSValueList* valueList = GetROCSSValueList(false);
if (aStyleBasicShape &&
aStyleBasicShape->GetShapeType() == nsStyleBasicShape::Type::ePolygon) {
- nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
-
// Shape function name and opening parenthesis.
nsAutoString shapeFunctionString;
AppendASCIItoUTF16(nsCSSKeywords::GetStringValue(eCSSKeyword_polygon),
shapeFunctionString);
shapeFunctionString.Append('(');
bool hasEvenOdd = aStyleBasicShape->GetFillRule() ==
NS_STYLE_FILL_RULE_EVENODD;
if (hasEvenOdd) {
@@ -5204,31 +5202,31 @@ nsComputedDOMStyle::CreatePrimitiveValue
aStyleBasicShape->Coordinates()[i]);
shapeFunctionString.Append(coordString);
shapeFunctionString.Append(' ');
SetCssTextToCoord(coordString,
aStyleBasicShape->Coordinates()[i + 1]);
shapeFunctionString.Append(coordString);
}
shapeFunctionString.Append(')');
+ nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
val->SetString(shapeFunctionString);
valueList->AppendCSSValue(val);
}
- nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
-
if (aSizingBox == NS_STYLE_CLIP_SHAPE_SIZING_NOBOX) {
return valueList;
}
nsAutoString boxString;
AppendASCIItoUTF16(
nsCSSProps::ValueToKeyword(aSizingBox,
nsCSSProps::kClipShapeSizingKTable),
boxString);
+ nsROCSSPrimitiveValue* val = new nsROCSSPrimitiveValue;
val->SetString(boxString);
valueList->AppendCSSValue(val);
return valueList;
}
CSSValue*
nsComputedDOMStyle::DoGetClipPath()