return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
} else if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
if (value.getCssText().equals("none")) {
return Collections.singletonList(new PropertyDeclaration(cssName, value, important, origin));
} else {
CounterData data = new CounterData(
value.getStringValue(),
getDefaultValue());
return Collections.singletonList(
new PropertyDeclaration(cssName, new PropertyValue(
Collections.singletonList(data)), important, origin));
}
}
throw new CSSParseException("The syntax of the " + cssName + " property is invalid", -1);
} else {
List result = new ArrayList();
for (int i = 0; i < values.size(); i++) {
PropertyValue value = (PropertyValue)values.get(i);
if (value.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
String name = value.getStringValue();
int cValue = getDefaultValue();
if (i < values.size() - 1) {
PropertyValue next = (PropertyValue)values.get(i+1);
if (next.getPrimitiveType() == CSSPrimitiveValue.CSS_NUMBER) {
checkNumberIsInteger(cssName, next);
cValue = (int)next.getFloatValue();
}
i++;
}
result.add(new CounterData(name, cValue));
} else {
throw new CSSParseException("The syntax of the " + cssName + " property is invalid", -1);
}
}