Fixed a bug with percent values being converted to strings

git-svn-id: svn://10.0.0.236/trunk@9786 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
kipp%netscape.com
1998-09-10 23:42:18 +00:00
parent 40c9ee9aaa
commit ce50d36a6c
5 changed files with 15 additions and 10 deletions

View File

@@ -2196,7 +2196,8 @@ static const char* RGBToCSSString(nscolor aColor)
}
void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer)
static void
ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer)
{
nsCSSUnit unit = aValue.GetUnit();
@@ -2236,7 +2237,7 @@ void ValueToString(const nsCSSValue& aValue, PRInt32 aPropID, nsString& aBuffer)
}
}
else if (eCSSUnit_Percent == unit) {
aBuffer.Append(aValue.GetFloatValue() * 100.0f);
aBuffer.Append(aValue.GetPercentValue() * 100.0f);
}
else if (eCSSUnit_Percent < unit) { // length unit
aBuffer.Append(aValue.GetFloatValue());