Skip to content

Commit

Permalink
fixing empty function definition for some filters, fixes #413, see e1…
Browse files Browse the repository at this point in the history
  • Loading branch information
ylafon committed Apr 9, 2024
1 parent 53b0f2c commit fef61cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions org/w3c/css/properties/css3/CssFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ protected static void parseFunctionValues(ApplContext ac, CssValue func, String
case opacity:
case saturate:
case sepia:
parseOneNonNegativeNumPercent(ac, function.getParameters(), caller);
parseAtMostOneNonNegativeNumPercent(ac, function.getParameters(), caller);
break;
case drop_shadow:
parseDropShadowFunction(ac, function.getParameters(), caller);
Expand Down Expand Up @@ -206,12 +206,16 @@ private static void parseOneX(ApplContext ac, CssExpression expression,
}

// parse one value of type (CssTypes.XXX)
private static void parseOneNonNegativeNumPercent(ApplContext ac, CssExpression expression,
private static void parseAtMostOneNonNegativeNumPercent(ApplContext ac, CssExpression expression,
String caller)
throws InvalidParamException {
if (expression.getCount() > 1) {
throw new InvalidParamException("unrecognize", ac);
}
// empty? -> OK
if (expression.getCount() == 0) {
return;
}
CssValue val = expression.getValue();
char op = expression.getOperator();

Expand Down

0 comments on commit fef61cf

Please sign in to comment.