if (s.equals("page") || s.equals("pages")) {
return null;
}
String counter = value.getStringValue();
IdentValue listStyleType = IdentValue.DECIMAL;
if (params.size() == 2) {
value = (PropertyValue) params.get(1);
if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_IDENT) {
return null;
}
IdentValue identValue = IdentValue.valueOf(value.getStringValue());
if (identValue != null) {
value.setIdentValue(identValue);
listStyleType = identValue;
}
}
int counterValue = c.getCounterContext(style).getCurrentCounterValue(counter);
return new CounterFunction(counterValue, listStyleType);
} else if (function.getName().equals("counters")) {
List params = function.getParameters();
if (params.size() < 2 || params.size() > 3) {
return null;
}
PropertyValue value = (PropertyValue) params.get(0);
if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_IDENT) {
return null;
}
String counter = value.getStringValue();
value = (PropertyValue) params.get(1);
if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_STRING) {
return null;
}
String separator = value.getStringValue();
IdentValue listStyleType = IdentValue.DECIMAL;
if (params.size() == 3) {
value = (PropertyValue) params.get(2);
if (value.getPrimitiveType() != CSSPrimitiveValue.CSS_IDENT) {
return null;
}
IdentValue identValue = IdentValue.valueOf(value.getStringValue());
if (identValue != null) {
value.setIdentValue(identValue);
listStyleType = identValue;
}
}