Skip to content

Commit aafade2

Browse files
committed
'from' color can be a variable, use the value instead of the potentially not resolved color
1 parent cb5c114 commit aafade2

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

org/w3c/css/values/color/HSL.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public static boolean isColorRelativeValue(CssIdent ident) {
5050
String output = null;
5151
CssValue vh, vs, vl, va;
5252
boolean isRelative = false;
53-
CssColor fromValue;
53+
CssValue fromValue;
5454

5555
String functionname = "hsl";
5656

@@ -127,11 +127,12 @@ public static final HSL parseHSL(ApplContext ac, CssExpression exp, CssColor cal
127127
op = exp.getOperator();
128128
CssExpression nex = new CssExpression();
129129
nex.addValue(val);
130-
hsl.fromValue = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
130+
CssColor c = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
131131
if ((val == null || op != SPACE) && !exp.hasCssVariable()) {
132132
exp.starts();
133133
throw new InvalidParamException("invalid-color", ac);
134134
}
135+
hsl.fromValue = val;
135136
exp.next();
136137
val = exp.getValue();
137138
op = exp.getOperator();

org/w3c/css/values/color/LAB.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static boolean isColorRelativeValue(CssIdent ident) {
4444
CssValue vl, va, vb, alpha;
4545
boolean faSet = false;
4646
boolean isRelative = false;
47-
CssColor fromValue;
47+
CssValue fromValue;
4848

4949
/**
5050
* Create a new LAB
@@ -126,11 +126,12 @@ public static final LAB parseLABColor(ApplContext ac, CssExpression exp, CssColo
126126
op = exp.getOperator();
127127
CssExpression nex = new CssExpression();
128128
nex.addValue(val);
129-
lab.fromValue = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
129+
CssColor c = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
130130
if ((val == null || op != SPACE) && !exp.hasCssVariable()) {
131131
exp.starts();
132132
throw new InvalidParamException("invalid-color", ac);
133133
}
134+
lab.fromValue = val;
134135
exp.next();
135136
val = exp.getValue();
136137
op = exp.getOperator();

org/w3c/css/values/color/LCH.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static boolean isColorRelativeValue(CssIdent ident) {
4747
CssValue vl, vc, vh, alpha;
4848
boolean faSet = false;
4949
boolean isRelative = false;
50-
CssColor fromValue;
50+
CssValue fromValue;
5151

5252
/**
5353
* Create a new LCH
@@ -94,11 +94,12 @@ public static final LCH parseLCHColor(ApplContext ac, CssExpression exp, CssColo
9494
op = exp.getOperator();
9595
CssExpression nex = new CssExpression();
9696
nex.addValue(val);
97-
lch.fromValue = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
97+
CssColor c = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
9898
if ((val == null || op != SPACE) && !exp.hasCssVariable()) {
9999
exp.starts();
100100
throw new InvalidParamException("invalid-color", ac);
101101
}
102+
lch.fromValue = val;
102103
exp.next();
103104
val = exp.getValue();
104105
op = exp.getOperator();

org/w3c/css/values/color/RGBA.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public class RGBA extends RGB {
4747

4848
CssValue va;
4949
boolean isRelative = false;
50-
CssColor fromValue;
50+
CssValue fromValue;
5151

5252
public static final CssValue filterAlpha(ApplContext ac, CssValue val)
5353
throws InvalidParamException {
@@ -225,11 +225,12 @@ public static RGBA parseModernRGBA(ApplContext ac, CssExpression exp, CssColor c
225225
op = exp.getOperator();
226226
CssExpression nex = new CssExpression();
227227
nex.addValue(val);
228-
rgba.fromValue = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
228+
CssColor c = new org.w3c.css.properties.css3.CssColor(ac, nex).getColor();
229229
if ((val == null || op != SPACE) && !exp.hasCssVariable()) {
230230
exp.starts();
231231
throw new InvalidParamException("invalid-color", ac);
232232
}
233+
rgba.fromValue = val;
233234
exp.next();
234235
val = exp.getValue();
235236
op = exp.getOperator();

0 commit comments

Comments
 (0)