Skip to content

Commit c6b6f58

Browse files
committed
remove improper casts and toString for variable handling, See w3c#336, need to fix other SVG properties
1 parent 868a590 commit c6b6f58

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

org/w3c/css/properties/svg/CssFill.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -79,31 +79,32 @@ static CssValue parsePaint(ApplContext ac, CssExpression expression,
7979

8080
switch (val.getType()) {
8181
case CssTypes.CSS_IDENT:
82-
if (inherit.equals(val)) {
83-
value = inherit;
82+
CssIdent id = val.getIdent();
83+
if (CssIdent.isCssWide(id)) {
84+
value = val;
8485
if (expression.getCount() > 1) {
8586
throw new InvalidParamException("value",
8687
val.toString(),
8788
property.getPropertyName(), ac);
8889
}
8990
break;
9091
}
91-
if (none.equals(val)) {
92+
if (none.equals(id)) {
9293
if ((expression.getCount() > 1 && !gotFuncIRI) || (expression.getCount() > 2 && gotFuncIRI)) {
9394
throw new InvalidParamException("value",
9495
val.toString(),
9596
property.getPropertyName(), ac);
9697
}
97-
values.add(none);
98+
values.add(val);
9899
break;
99100
}
100-
if (currentColor.equals(val)) {
101+
if (currentColor.equals(id)) {
101102
if ((expression.getCount() > 1 && !gotFuncIRI) || (expression.getCount() > 2 && gotFuncIRI)) {
102103
throw new InvalidParamException("value",
103104
val.toString(),
104105
property.getPropertyName(), ac);
105106
}
106-
values.add(currentColor);
107+
values.add(val);
107108
gotColor = true;
108109
break;
109110
}
@@ -144,9 +145,9 @@ static CssValue parsePaint(ApplContext ac, CssExpression expression,
144145
property.getPropertyName(), ac);
145146
}
146147
CssColor c = new CssColor();
147-
c.setShortRGBColor(ac, val.toString());
148+
c.setShortRGBColor(ac, val.getHashIdent().toString());
148149
gotColor = true;
149-
values.add(c);
150+
values.add(val);
150151
break;
151152
case CssTypes.CSS_COLOR:
152153
if (gotColor) {

0 commit comments

Comments
 (0)