File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 7
7
package org .w3c .css .values ;
8
8
9
9
import org .w3c .css .util .ApplContext ;
10
+ import org .w3c .css .util .CssVersion ;
10
11
import org .w3c .css .util .InvalidParamException ;
11
12
import org .w3c .css .util .Util ;
12
13
@@ -25,7 +26,14 @@ public static final CssValue filterValue(ApplContext ac, CssValue val)
25
26
// might need to extend...
26
27
} else {
27
28
if (val .getType () == CssTypes .CSS_NUMBER ) {
29
+ boolean isCss3 = (ac .getCssVersion ().compareTo (CssVersion .CSS3 ) >= 0 );
28
30
CssCheckableValue v = val .getCheckableValue ();
31
+ // in CSS2, numbers can only be integers
32
+ if (!isCss3 ) {
33
+ if (!v .isInteger ()) {
34
+ throw new InvalidParamException ("rgb" , val , ac );
35
+ }
36
+ }
29
37
if (!v .warnPositiveness (ac , "RGB" )) {
30
38
CssNumber nb = new CssNumber ();
31
39
nb .setIntValue (0 );
You can’t perform that action at this time.
0 commit comments