Skip to content

Commit 8ed3b8a

Browse files
committed
1 parent 1433c43 commit 8ed3b8a

1 file changed

Lines changed: 26 additions & 12 deletions

File tree

org/w3c/css/properties/css3/CssTextAlignAll.java

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.w3c.css.values.CssValue;
1414

1515
/**
16-
* @spec https://www.w3.org/TR/2021/CRD-css-text-3-20210422/#propdef-text-align-all
16+
* @spec https://www.w3.org/TR/2024/WD-css-text-4-20240219/#propdef-text-align-all
1717
*/
1818
public class CssTextAlignAll extends org.w3c.css.properties.css.CssTextAlignAll {
1919

@@ -59,19 +59,33 @@ public CssTextAlignAll(ApplContext ac, CssExpression expression, boolean check)
5959
throw new InvalidParamException("unrecognize", ac);
6060
}
6161

62-
if (val.getType() != CssTypes.CSS_IDENT) {
63-
throw new InvalidParamException("value",
64-
expression.getValue(),
65-
getPropertyName(), ac);
66-
}
67-
CssIdent id = val.getIdent();
68-
if (!CssIdent.isCssWide(id) && getAllowedIdent(id) == null) {
69-
throw new InvalidParamException("value",
70-
expression.getValue(),
71-
getPropertyName(), ac);
62+
switch (val.getType()) {
63+
case CssTypes.CSS_IDENT:
64+
CssIdent id = val.getIdent();
65+
if (!CssIdent.isCssWide(id) && getAllowedIdent(id) == null) {
66+
throw new InvalidParamException("value",
67+
expression.getValue(),
68+
getPropertyName(), ac);
7269

70+
}
71+
value = val;
72+
break;
73+
case CssTypes.CSS_STRING:
74+
if (val.getRawType() == CssTypes.CSS_STRING) {
75+
// string length must be 1, so 3 including delimiters
76+
if (val.toString().length() > 3) {
77+
throw new InvalidParamException("value",
78+
expression.getValue(),
79+
getPropertyName(), ac);
80+
}
81+
}
82+
value = val;
83+
break;
84+
default:
85+
throw new InvalidParamException("value",
86+
expression.getValue(),
87+
getPropertyName(), ac);
7388
}
74-
value = val;
7589
expression.next();
7690
}
7791

0 commit comments

Comments
 (0)