case CSSPrimitiveValue.CSS_PERCENTAGE:
if (percenttype == PERCENTAGE_FONT) {
result = (int) ((result * font.getFontSize()) / 100.0);
break;
}
return new Length((int) result, true);
case CSSPrimitiveValue.CSS_PX: // no more calculation needed
case CSSPrimitiveValue.CSS_NUMBER:
break;
case CSSPrimitiveValue.CSS_EMS:
result *= font.getFontSize();
break;
case CSSPrimitiveValue.CSS_EXS:
result *= font.getXHeight();
break;
case CSSPrimitiveValue.CSS_CM:
result = cmToPixel(result);
break;
case CSSPrimitiveValue.CSS_IN:
result = inToPixel(result);
break;
case CSSPrimitiveValue.CSS_MM:
result = mmToPixel(result);
break;
case CSSPrimitiveValue.CSS_PT:
result = ptToPixel(result);
break;
case CSSPrimitiveValue.CSS_PC:
result = pcToPixel(result);
break;
case CSSPrimitiveValue.CSS_STRING:
return ICSSPropertyID.VAL_AUTO;
// FIXME:every thing is delt with?
}
// ok, when reach here, means we get the float value "result"
return new Length((int) result, false);
}