mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 06:38:36 +00:00
Bug 373485 - crash with percentage stroke-width. r=jwatt+longsonr
This commit is contained in:
parent
334a738e0c
commit
1885d7397e
@ -433,18 +433,16 @@ nsSVGUtils::CoordToFloat(nsPresContext *aPresContext,
|
||||
break;
|
||||
|
||||
case eStyleUnit_Percent: {
|
||||
nsSVGSVGElement *ctx = aContent->GetCtx();
|
||||
|
||||
nsCOMPtr<nsISVGLength> length;
|
||||
NS_NewSVGLength(getter_AddRefs(length),
|
||||
aCoord.GetPercentValue() * 100.0f,
|
||||
nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE);
|
||||
|
||||
if (!ctx || !length)
|
||||
if (!length)
|
||||
break;
|
||||
|
||||
nsWeakPtr weakCtx =
|
||||
do_GetWeakReference(NS_STATIC_CAST(nsGenericElement*, ctx));
|
||||
do_GetWeakReference(NS_STATIC_CAST(nsGenericElement*, aContent));
|
||||
length->SetContext(weakCtx, nsSVGUtils::XY);
|
||||
length->GetValue(&val);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user