}
return super.createValue(lu);
case LexicalUnit.SAC_RGBCOLOR:
LexicalUnit l = lu.getParameters();
ValueFactory ph = new ColorComponentFactory(getParser());
CSSPrimitiveValue r = new CSSOMValue(ph, createColorValue(l));
l = l.getNextLexicalUnit().getNextLexicalUnit();
CSSPrimitiveValue g = new CSSOMValue(ph, createColorValue(l));
l = l.getNextLexicalUnit().getNextLexicalUnit();
CSSPrimitiveValue b = new CSSOMValue(ph, createColorValue(l));
lu = lu.getNextLexicalUnit();
if (lu == null) {
return new ImmutableRGBColor(r, g, b);
}
if (lu.getLexicalUnitType() != LexicalUnit.SAC_FUNCTION) {
throw CSSDOMExceptionFactory.createDOMException
(DOMException.INVALID_ACCESS_ERR,
"invalid.lexical.unit",
new Object[] { new Integer(lu.getLexicalUnitType()),
getPropertyName() });
}
if (!lu.getFunctionName().toLowerCase().equals("icc-color")) {
throw CSSDOMExceptionFactory.createDOMException
(DOMException.INVALID_ACCESS_ERR,
"invalid.lexical.unit",
new Object[] { new Integer(lu.getLexicalUnitType()),
getPropertyName() });
}
lu = lu.getParameters();
if (lu.getLexicalUnitType() != LexicalUnit.SAC_IDENT) {
throw CSSDOMExceptionFactory.createDOMException
(DOMException.INVALID_ACCESS_ERR,
"invalid.lexical.unit",
new Object[] { new Integer(lu.getLexicalUnitType()),
getPropertyName() });
}
String cp = lu.getStringValue();
lu = lu.getNextLexicalUnit();
SVGCSSNumberList nl = new SVGCSSNumberList();
while (lu != null) {
lu = lu.getNextLexicalUnit();
if (lu == null) {
throw CSSDOMExceptionFactory.createDOMException
(DOMException.INVALID_ACCESS_ERR,
"invalid.lexical.unit",
new Object[] { new Integer(0), getPropertyName() });
}
nl.appendItem(new SVGCSSNumber(getColorValue(lu)));
lu = lu.getNextLexicalUnit();
}
return new ImmutableSVGPaintValue
(SVGPaint.SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR,
r, g, b, cp, nl, null);
case LexicalUnit.SAC_URI:
String uri = lu.getStringValue();
lu = lu.getNextLexicalUnit();
if (lu == null) {
return new ImmutableString(CSSPrimitiveValue.CSS_URI, uri);
}
switch (lu.getLexicalUnitType()) {
case LexicalUnit.SAC_RGBCOLOR:
l = lu.getParameters();
ph = new ColorComponentFactory(getParser());
r = new CSSOMValue(ph, createColorValue(l));
l = l.getNextLexicalUnit().getNextLexicalUnit();
g = new CSSOMValue(ph, createColorValue(l));
l = l.getNextLexicalUnit().getNextLexicalUnit();
b = new CSSOMValue(ph, createColorValue(l));
lu = lu.getNextLexicalUnit();
if (lu == null) {
return new ImmutableSVGPaintValue
(SVGPaint.SVG_PAINTTYPE_URI_RGBCOLOR,
r, g, b, null, null, uri);