if (values.size() == 1) {
PropertyValue value = (PropertyValue)values.get(0);
checkLengthType(cssName, value);
if (value.getFloatValue() < 0.0f) {
throw new CSSParseException("border-spacing may not be negative", -1);
}
horizontalSpacing = new PropertyDeclaration(
CSSName.FS_BORDER_SPACING_HORIZONTAL, value, important, origin);
verticalSpacing = new PropertyDeclaration(
CSSName.FS_BORDER_SPACING_VERTICAL, value, important, origin);
} else { /* values.size() == 2 */
PropertyValue horizontal = (PropertyValue)values.get(0);
checkLengthType(cssName, horizontal);
if (horizontal.getFloatValue() < 0.0f) {
throw new CSSParseException("border-spacing may not be negative", -1);
}
horizontalSpacing = new PropertyDeclaration(
CSSName.FS_BORDER_SPACING_HORIZONTAL, horizontal, important, origin);
PropertyValue vertical = (PropertyValue)values.get(0);
checkLengthType(cssName, vertical);
if (vertical.getFloatValue() < 0.0f) {
throw new CSSParseException("border-spacing may not be negative", -1);
}
verticalSpacing = new PropertyDeclaration(
CSSName.FS_BORDER_SPACING_VERTICAL, vertical, important, origin);
}