*/
public void resolve(final LayoutProcess process,
final LayoutElement currentNode,
final StyleKey key)
{
final LayoutContext layoutContext = currentNode.getLayoutContext();
final CSSValue value = layoutContext.getValue(key);
if (value instanceof CSSConstant == false)
{
// fine, we're done here ...
return ;
}
final CSSConstant constant = (CSSConstant) value;
final double parentFontSize =
currentNode.getLayoutContext().getFontSpecification().getFontSize();
if (RelativeFontSize.LARGER.equals(value))
{
final double scaleFactor = getScaleLargerFactor(parentFontSize);
layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PERCENTAGE, scaleFactor));
}
else if (RelativeFontSize.SMALLER.equals(value))
{
final double scaleFactor = getScaleSmallerFactor(parentFontSize);
layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PERCENTAGE, scaleFactor));
}
final CSSValue resolvedValue = lookupValue(constant);
if (resolvedValue != null)
{
layoutContext.setValue(key, resolvedValue);
return;
}
if (key.equals(FontStyleKeys.MAX_FONT_SIZE))
{
// there is no upper limit if the value is invalid
layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PT, Short.MAX_VALUE));
}
else
{
// there is no lower limit if the value is invalid
layoutContext.setValue(key, CSSNumericValue.createValue(CSSNumericType.PT, 0));
}
}