Program: 68738
Project: 68738
Buggy source:
/** 
 * Implements   {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue(CSSStylableElement elt,CSSEngine engine,int idx,Value value){
  CSSContext ctx=engine.getCSSContext();
  float fs=ctx.getMediumFontSize();
  if (value == CSSValueConstants.XX_SMALL_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs / 1.2f / 1.2f/ 1.2f);
  }
  if (value == CSSValueConstants.X_SMALL_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs / 1.2f / 1.2f);
  }
  if (value == CSSValueConstants.SMALL_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs / 1.2f);
  }
  if (value == CSSValueConstants.MEDIUM_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs);
  }
  if (value == CSSValueConstants.LARGE_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * 1.2f);
  }
  if (value == CSSValueConstants.X_LARGE_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * 1.2f * 1.2f);
  }
  if (value == CSSValueConstants.XX_LARGE_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * 1.2f * 1.2f* 1.2f);
  }
  float scale=1.0f;
  boolean doParentRelative=false;
  if (value == CSSValueConstants.SMALLER_VALUE) {
    doParentRelative=true;
    scale=1.0f / 1.2f;
  }
 else   if (value == CSSValueConstants.LARGER_VALUE) {
    doParentRelative=true;
    scale=1.2f;
  }
 else   if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
switch (value.getPrimitiveType()) {
case CSSPrimitiveValue.CSS_EMS:
      doParentRelative=true;
    scale=value.getFloatValue();
  break;
case CSSPrimitiveValue.CSS_EXS:
doParentRelative=true;
scale=value.getFloatValue() * 0.5f;
break;
case CSSPrimitiveValue.CSS_PERCENTAGE:
doParentRelative=true;
scale=value.getFloatValue() * 0.01f;
break;
}
}
if (doParentRelative) {
CSSStylableElement parent=(CSSStylableElement)elt.getParent();
if (parent != null) {
IStyle style=parent.getComputedStyle();
if (style != null) {
Value fontSize=(Value)style.getProperty(IStyle.STYLE_FONT_SIZE);
if (fontSize != null) {
fs=fontSize.getFloatValue();
return new FloatValue(fontSize.getPrimitiveType(),fs * scale);
}
}
}
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * scale);
}
if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_NUMBER) {
return super.computeValue(elt,engine,idx,new FloatValue(CSSPrimitiveValue.CSS_PT,value.getFloatValue()));
}
return super.computeValue(elt,engine,idx,value);
}

Fixed version (ground truth):
/** 
 * Implements   {@link ValueManager#computeValue(CSSStylableElement,String,CSSEngine,int,StyleMap,Value)}.
 */
public Value computeValue(CSSStylableElement elt,CSSEngine engine,int idx,Value value){
  CSSContext ctx=engine.getCSSContext();
  float fs=ctx.getMediumFontSize();
  if (value == CSSValueConstants.XX_SMALL_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs / 1.2f / 1.2f/ 1.2f);
  }
  if (value == CSSValueConstants.X_SMALL_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs / 1.2f / 1.2f);
  }
  if (value == CSSValueConstants.SMALL_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs / 1.2f);
  }
  if (value == CSSValueConstants.MEDIUM_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs);
  }
  if (value == CSSValueConstants.LARGE_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * 1.2f);
  }
  if (value == CSSValueConstants.X_LARGE_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * 1.2f * 1.2f);
  }
  if (value == CSSValueConstants.XX_LARGE_VALUE) {
    return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * 1.2f * 1.2f* 1.2f);
  }
  float scale=1.0f;
  boolean doParentRelative=false;
  if (value == CSSValueConstants.SMALLER_VALUE) {
    doParentRelative=true;
    scale=1.0f / 1.2f;
  }
 else   if (value == CSSValueConstants.LARGER_VALUE) {
    doParentRelative=true;
    scale=1.2f;
  }
 else   if (value.getCssValueType() == CSSValue.CSS_PRIMITIVE_VALUE) {
switch (value.getPrimitiveType()) {
case CSSPrimitiveValue.CSS_EMS:
      doParentRelative=true;
    scale=value.getFloatValue();
  break;
case CSSPrimitiveValue.CSS_EXS:
doParentRelative=true;
scale=value.getFloatValue() * 0.5f;
break;
case CSSPrimitiveValue.CSS_PERCENTAGE:
doParentRelative=true;
scale=value.getFloatValue() * 0.01f;
break;
}
}
if (doParentRelative) {
CSSStylableElement parent=(CSSStylableElement)elt.getParent();
if (parent != null) {
IStyle style=parent.getComputedStyle();
if (style != null) {
Value fontSize=(Value)style.getProperty(IStyle.STYLE_FONT_SIZE);
if (fontSize != null) {
fs=fontSize.getFloatValue();
return new FloatValue(fontSize.getPrimitiveType(),fs * scale);
}
}
}
return new FloatValue(CSSPrimitiveValue.CSS_NUMBER,fs * scale);
}
if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_NUMBER) {
return super.computeValue(elt,engine,idx,new FloatValue(CSSPrimitiveValue.CSS_NUMBER,value.getFloatValue()));
}
return super.computeValue(elt,engine,idx,value);
}