Bug 789390 - Fix crash when using -moz-objectStroke paint value with transitions r=dbaron

This commit is contained in:
Edwin Flores 2012-09-24 00:10:00 +12:00
parent 3b4df9464f
commit 0c9f80a9ea
3 changed files with 15 additions and 2 deletions

View File

@ -487,7 +487,7 @@ nsStyleAnimation::ComputeDistance(nsCSSProperty aProperty,
unit[1] = GetCommonUnit(aProperty, pair1->mYValue.GetUnit(),
pair2->mYValue.GetUnit());
if (unit[0] == eCSSUnit_Null || unit[1] == eCSSUnit_Null ||
unit[0] == eCSSUnit_URL) {
unit[0] == eCSSUnit_URL || unit[0] == eCSSUnit_Enumerated) {
return false;
}
@ -1827,7 +1827,7 @@ nsStyleAnimation::AddWeighted(nsCSSProperty aProperty,
unit[1] = GetCommonUnit(aProperty, pair1->mYValue.GetUnit(),
pair2->mYValue.GetUnit());
if (unit[0] == eCSSUnit_Null || unit[1] == eCSSUnit_Null ||
unit[0] == eCSSUnit_URL) {
unit[0] == eCSSUnit_URL || unit[0] == eCSSUnit_Enumerated) {
return false;
}
@ -3125,6 +3125,17 @@ nsStyleAnimation::ExtractComputedValue(nsCSSProperty aProperty,
eUnit_CSSValuePair);
return true;
}
if (paint.mType == eStyleSVGPaintType_ObjectFill ||
paint.mType == eStyleSVGPaintType_ObjectStroke) {
nsAutoPtr<nsCSSValuePair> pair(new nsCSSValuePair);
pair->mXValue.SetIntValue(paint.mType == eStyleSVGPaintType_ObjectFill ?
NS_COLOR_OBJECTFILL : NS_COLOR_OBJECTSTROKE,
eCSSUnit_Enumerated);
pair->mYValue.SetColorValue(paint.mFallbackColor);
aComputedValue.SetAndAdoptCSSValuePairValue(pair.forget(),
eUnit_CSSValuePair);
return true;
}
NS_ABORT_IF_FALSE(paint.mType == eStyleSVGPaintType_None,
"Unexpected SVG paint type");
aComputedValue.SetNoneValue();

View File

@ -0,0 +1 @@
<html style="transition: 1s;"><body onload="document.documentElement.style.stroke = '-moz-objectStroke';"></body></html>

View File

@ -144,3 +144,4 @@ load 782141-1.svg
load 784061-1.svg
load 790072.svg
load 791826-1.svg
load 789390-1.html