absVal = relVal * ctx.getPixelsPerDot();
absVal = relVal * ctx.getDotsPerPixel();
    protected static float calcFloatProportionalValue(CalculatedStyle style,                                                      CSSName cssName,                                                      String stringValue,                                                      float relVal,                                                      short primitiveType,                                                      float baseValue,                                                      CssContext ctx) {        float absVal = Float.MIN_VALUE;        // NOTE: we used to cache absolute values, but have removed that to see if it        // really makes a difference, since the calcs are so simple. In any case, for DPI-relative        // values we shouldn't be caching, unless we also check if the DPI is changed, which        // would seem to obviate the advantage of caching anyway.        switch (primitiveType) {            case CSSPrimitiveValue.CSS_PX:                absVal = relVal * ctx.getPixelsPerDot();                break;            case CSSPrimitiveValue.CSS_IN:                absVal = (((relVal * CM__PER__IN) * MM__PER__CM) / ctx.getMmPerDot());                break;            case CSSPrimitiveValue.CSS_CM:                absVal = ((relVal * MM__PER__CM) / ctx.getMmPerDot());                break;            case CSSPrimitiveValue.CSS_MM:                absVal = relVal / ctx.getMmPerDot();                break;            case CSSPrimitiveValue.CSS_PT:                absVal = (((relVal * PT__PER__IN) * CM__PER__IN) * MM__PER__CM) / ctx.getMmPerDot();                break;            case CSSPrimitiveValue.CSS_PC:                absVal = ((((relVal * PC__PER__PT) * PT__PER__IN) * CM__PER__IN) * MM__PER__CM) / ctx.getMmPerDot();                break;            case CSSPrimitiveValue.CSS_EMS:                // EM is equal to font-size of element on which it is used                // The exception is when ?em? occurs in the value of                // the ?font-size? property itself, in which case it refers                // to the calculated font size of the parent element                // http://www.w3.org/TR/CSS21/fonts.html#font-size-props                if (cssName == CSSName.FONT_SIZE) {                    FontSpecification parentFont = style.getParent().getFont(ctx);                    //font size and FontSize2D should be identical                    absVal = relVal * parentFont.size;//ctx.getFontSize2D(parentFont);                } else {                    absVal = relVal * style.getFont(ctx).size;//ctx.getFontSize2D(style.getFont(ctx));                }                break;            case CSSPrimitiveValue.CSS_EXS:                // To convert EMS to pixels, we need the height of the lowercase 'Xx' character in the current                // element...                // to the font size of the parent element (spec: 4.3.2)                if (cssName == CSSName.FONT_SIZE) {                    FontSpecification parentFont = style.getParent().getFont(ctx);                    float xHeight = ctx.getXHeight(parentFont);                    xHeight = relVal * xHeight;                    absVal = getFontSizeForXHeight(style, ctx, xHeight);                } else {                    FontSpecification font = style.getFont(ctx);                    float xHeight = ctx.getXHeight(font);                    absVal = relVal * xHeight;                }                break;            case CSSPrimitiveValue.CSS_PERCENTAGE:                // percentage depends on the property this value belongs to                if (cssName == CSSName.VERTICAL_ALIGN) {                    relVal = style.getParent().getLineHeight(ctx);                } else if (cssName == CSSName.FONT_SIZE) {                    // same as with EM                    FontSpecification parentFont = style.getParent().getFont(ctx);                    baseValue = ctx.getFontSize2D(parentFont);                } else if (cssName == CSSName.LINE_HEIGHT) {                    FontSpecification font = style.getFont(ctx);                    baseValue = ctx.getFontSize2D(font);                }                absVal = (relVal / 100F) * baseValue;                break;            default:                // nothing to do, we only convert those listed above                XRLog.cascade(Level.SEVERE,                        "Asked to convert " + cssName + " from relative to absolute, " +                        " don't recognize the datatype " +                        "'" + ValueConstants.stringForSACPrimitiveType(primitiveType) + "' "                        + primitiveType + "(" + stringValue + ")");        }        //assert (new Float(absVal).intValue() >= 0);        if (cssName == CSSName.FONT_SIZE) {            XRLog.cascade(Level.FINEST, cssName + ", relative= " +                    relVal + " (" + stringValue + "), absolute= "                    + absVal);        } else {            XRLog.cascade(Level.FINEST, cssName + ", relative= " +                    relVal + " (" + stringValue + "), absolute= "                    + absVal + " using base=" + baseValue);        }        // round down. (CHECK: Why? Is this always appropriate? - tobe)        /*        double d = Math.floor((double) absVal);        */        // Round is surely what we want? (previous was         // doing e.g. 6in = 431.9997 = 431 ??? - pmb)        double d = Math.round((double) absVal);        absVal = new Float(d).floatValue();        return absVal;    }