Skip to content

Commit ddaed11

Browse files
committed
care about multiple values in a variable expression, see #421, second comment
1 parent c8e4328 commit ddaed11

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

org/w3c/css/values/CssVariable.java

+18
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,24 @@ public final int getType() {
4949
return computed_type;
5050
}
5151

52+
public final CssExpression getVariableExpression() {
53+
if (ac != null) {
54+
StyleSheet s = ac.getStyleSheet();
55+
if (s != null) {
56+
CssCustomProperty cp = s.getCustomProperty(variable_name);
57+
if (cp != null) {
58+
CssVariableDefinition vd = (CssVariableDefinition) cp.value;
59+
if (vd != null) {
60+
if (vd.size() > 0) {
61+
return vd.expression;
62+
}
63+
}
64+
}
65+
}
66+
}
67+
return null;
68+
}
69+
5270
String variable_name = null;
5371
ApplContext ac;
5472
int computed_type = CssTypes.CSS_UNKNOWN;

0 commit comments

Comments
 (0)