case CSSPrimitiveValue.CSS_EMS:
sm.putParentRelative(idx, true);
v = value.getFloatValue();
CSSStylableElement p;
p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
float fs;
if (p == null) {
ctx = engine.getCSSContext();
fs = ctx.getMediumFontSize();
} else {
fs = engine.getComputedStyle(p, null, idx).getFloatValue();
}
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER, v * fs);
case CSSPrimitiveValue.CSS_EXS:
sm.putParentRelative(idx, true);
v = value.getFloatValue();
p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
if (p == null) {
ctx = engine.getCSSContext();
fs = ctx.getMediumFontSize();
} else {
fs = engine.getComputedStyle(p, null, idx).getFloatValue();
}
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
v * fs * 0.5f); // !!! x-height
case CSSPrimitiveValue.CSS_PERCENTAGE:
sm.putParentRelative(idx, true);
v = value.getFloatValue();
p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
if (p == null) {
ctx = engine.getCSSContext();
fs = ctx.getMediumFontSize();
} else {
fs = engine.getComputedStyle(p, null, idx).getFloatValue();
}
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
v * fs / 100f);
}
if (value == ValueConstants.LARGER_VALUE) {
sm.putParentRelative(idx, true);
CSSStylableElement p;
p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
float fs;
if (p == null) {
CSSContext ctx = engine.getCSSContext();
fs = ctx.getMediumFontSize();
} else {
fs = engine.getComputedStyle(p, null, idx).getFloatValue();
}
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,
fs * 1.2f);
} else if (value == ValueConstants.SMALLER_VALUE) {
sm.putParentRelative(idx, true);
CSSStylableElement p;
p = (CSSStylableElement)CSSEngine.getParentCSSStylableElement(elt);
float fs;
if (p == null) {
CSSContext ctx = engine.getCSSContext();
fs = ctx.getMediumFontSize();