checkInheritAllowed(first, inheritAllowed);
if (values.size() == 1 &&
first.getCssValueType() == CSSPrimitiveValue.CSS_INHERIT) {
return Collections.singletonList(
new PropertyDeclaration(cssName, first, important, origin));
}
if (second != null) {
checkInheritAllowed(second, false);
}
checkIdentLengthOrPercentType(cssName, first);
if (second == null) {
if (first.getPrimitiveType() == CSSPrimitiveValue.CSS_IDENT) {
IdentValue firstIdent = checkIdent(cssName, first);
checkValidity(cssName, ALL_ALLOWED, firstIdent);
if (firstIdent == IdentValue.CONTAIN || firstIdent == IdentValue.COVER) {
return Collections.singletonList(
new PropertyDeclaration(cssName, first, important, origin));
} else {
return createTwoValueResponse(CSSName.BACKGROUND_SIZE, first, first, origin, important);
}
} else {
return createTwoValueResponse(CSSName.BACKGROUND_SIZE, first, new PropertyValue(IdentValue.AUTO), origin, important);