Skip to content

Commit fef61cf

Browse files
committed
fixing empty function definition for some filters, fixes #413, see e1261e3
1 parent 53b0f2c commit fef61cf

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

org/w3c/css/properties/css3/CssFilter.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ protected static void parseFunctionValues(ApplContext ac, CssValue func, String
163163
case opacity:
164164
case saturate:
165165
case sepia:
166-
parseOneNonNegativeNumPercent(ac, function.getParameters(), caller);
166+
parseAtMostOneNonNegativeNumPercent(ac, function.getParameters(), caller);
167167
break;
168168
case drop_shadow:
169169
parseDropShadowFunction(ac, function.getParameters(), caller);
@@ -206,12 +206,16 @@ private static void parseOneX(ApplContext ac, CssExpression expression,
206206
}
207207

208208
// parse one value of type (CssTypes.XXX)
209-
private static void parseOneNonNegativeNumPercent(ApplContext ac, CssExpression expression,
209+
private static void parseAtMostOneNonNegativeNumPercent(ApplContext ac, CssExpression expression,
210210
String caller)
211211
throws InvalidParamException {
212212
if (expression.getCount() > 1) {
213213
throw new InvalidParamException("unrecognize", ac);
214214
}
215+
// empty? -> OK
216+
if (expression.getCount() == 0) {
217+
return;
218+
}
215219
CssValue val = expression.getValue();
216220
char op = expression.getOperator();
217221

0 commit comments

Comments
 (0)