mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 751515 - Fix Crash with convertToSpecifiedUnits. r=dholbert
This commit is contained in:
parent
6dbb365bb0
commit
e9638bfe86
9
content/svg/content/src/crashtests/751515-1.svg
Normal file
9
content/svg/content/src/crashtests/751515-1.svg
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<script>
|
||||
|
||||
document.documentElement.createSVGAngle().convertToSpecifiedUnits(2);
|
||||
|
||||
</script>
|
||||
</svg>
|
After Width: | Height: | Size: 162 B |
@ -59,3 +59,4 @@ load 613899-1.svg
|
||||
load 613899-2.svg
|
||||
load zero-size-image.svg
|
||||
load 723441-1.html
|
||||
load 751515-1.svg
|
||||
|
@ -72,7 +72,7 @@ public:
|
||||
NS_IMETHOD SetValue(float aValue)
|
||||
{
|
||||
NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
|
||||
mVal.SetBaseValue(aValue, nsnull, true);
|
||||
mVal.SetBaseValue(aValue, nsnull, false);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@ -283,7 +283,10 @@ nsSVGAngle::ConvertToSpecifiedUnits(PRUint16 unitType,
|
||||
if (mBaseValUnit == PRUint8(unitType))
|
||||
return NS_OK;
|
||||
|
||||
nsAttrValue emptyOrOldValue = aSVGElement->WillChangeAngle(mAttrEnum);
|
||||
nsAttrValue emptyOrOldValue;
|
||||
if (aSVGElement) {
|
||||
emptyOrOldValue = aSVGElement->WillChangeAngle(mAttrEnum);
|
||||
}
|
||||
|
||||
float valueInUserUnits = mBaseVal * GetDegreesPerUnit(mBaseValUnit);
|
||||
mBaseValUnit = PRUint8(unitType);
|
||||
@ -291,7 +294,9 @@ nsSVGAngle::ConvertToSpecifiedUnits(PRUint16 unitType,
|
||||
// Will/DidChangeAngle a second time (and dispatch duplicate notifications).
|
||||
SetBaseValue(valueInUserUnits, aSVGElement, false);
|
||||
|
||||
aSVGElement->DidChangeAngle(mAttrEnum, emptyOrOldValue);
|
||||
if (aSVGElement) {
|
||||
aSVGElement->DidChangeAngle(mAttrEnum, emptyOrOldValue);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user