|
13 | 13 | import org.w3c.css.values.CssValue; |
14 | 14 |
|
15 | 15 | /** |
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 |
17 | 17 | */ |
18 | 18 | public class CssTextAlignAll extends org.w3c.css.properties.css.CssTextAlignAll { |
19 | 19 |
|
@@ -59,19 +59,33 @@ public CssTextAlignAll(ApplContext ac, CssExpression expression, boolean check) |
59 | 59 | throw new InvalidParamException("unrecognize", ac); |
60 | 60 | } |
61 | 61 |
|
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); |
72 | 69 |
|
| 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); |
73 | 88 | } |
74 | | - value = val; |
75 | 89 | expression.next(); |
76 | 90 | } |
77 | 91 |
|
|
0 commit comments