public void resolve(final LayoutProcess process,
final LayoutElement currentNode,
final StyleKey key)
{
final LayoutContext style = currentNode.getLayoutContext();
CSSValue value = style.getValue(key);
if (value instanceof CSSColorValue)
{
return;
}
// it might as well be a RGB- or HSL- function.
if (value instanceof CSSFunctionValue)
{
final CSSFunctionValue functionValue = (CSSFunctionValue) value;
final StyleValueFunction function =
FunctionFactory.getInstance().getStyleFunction
(functionValue.getFunctionName());
if (function == null)
{
value = HtmlColors.BLACK;
}
else
{
try
{
value = function.evaluate(process, currentNode, functionValue);
}
catch (FunctionEvaluationException e)
{
value = HtmlColors.BLACK;
}
}
if (value instanceof CSSColorValue)
{
style.setValue(key, value);
return;
}
}
if (value instanceof CSSConstant == false)
{
style.setValue(key, HtmlColors.BLACK);
return;
}
if (CSSSystemColors.CURRENT_COLOR.equals(value))
{
style.setValue(key, getCurrentColor(currentNode));
return;
}
final CSSValue c = ColorUtil.parseIdentColor(value.getCSSText());
if (c != null)
{
style.setValue(key, c);
}
else