|
18 | 18 | import static org.w3c.css.values.CssOperator.SPACE; |
19 | 19 |
|
20 | 20 | /** |
21 | | - * @spec http://www.w3.org/TR/2012/WD-css3-transforms-20120911/#transform-origin |
| 21 | + * @spec https://www.w3.org/TR/2019/CR-css-transforms-1-20190214/#propdef-transform-origin |
22 | 22 | */ |
23 | 23 | public class CssTransformOrigin extends org.w3c.css.properties.css.CssTransformOrigin { |
24 | 24 |
|
@@ -141,30 +141,37 @@ private void check(ArrayList<CssValue> values, ApplContext ac) |
141 | 141 | // then we need to ckeck the values if we got two values and |
142 | 142 | // at least one keyword (as restrictions may occur) |
143 | 143 | if (nb_keyword > 0 && nb_values >= 2) { |
144 | | - boolean gothorizontal = false; |
145 | | - boolean gotvertical = false; |
| 144 | + boolean got_horizontal = false; |
| 145 | + boolean got_vertical = false; |
146 | 146 | CssValue v = values.get(0); |
147 | 147 | if (v.getType() == CssTypes.CSS_IDENT) { |
148 | 148 | CssIdent id = (CssIdent) v; |
149 | 149 | // strictly horizontal or vertical |
150 | | - gothorizontal = isHorizontalIdent(id); |
151 | | - if (!gothorizontal) { |
152 | | - gotvertical = isVerticalIdent(id); |
| 150 | + got_horizontal = isHorizontalIdent(id); |
| 151 | + if (!got_horizontal) { |
| 152 | + got_vertical = isVerticalIdent(id); |
153 | 153 | } |
154 | 154 | } |
155 | 155 | v = values.get(1); |
156 | 156 | if (v.getType() == CssTypes.CSS_IDENT) { |
157 | 157 | CssIdent id = (CssIdent) v; |
158 | 158 | // yeah, it can be a single ugly test. |
159 | | - if (gothorizontal && isHorizontalIdent(id)) { |
| 159 | + if (got_horizontal && isHorizontalIdent(id)) { |
160 | 160 | throw new InvalidParamException("value", id, |
161 | 161 | getPropertyName(), ac); |
162 | 162 | } |
163 | | - if (gotvertical && isVerticalIdent(id)) { |
| 163 | + if (got_vertical && isVerticalIdent(id)) { |
164 | 164 | throw new InvalidParamException("value", id, |
165 | 165 | getPropertyName(), ac); |
166 | 166 | } |
| 167 | + } else { |
| 168 | + // we must check that if we get vertical first, we don't have a <length-percentage> |
| 169 | + if (got_vertical) { |
| 170 | + throw new InvalidParamException("value", v, |
| 171 | + getPropertyName(), ac); |
| 172 | + } |
167 | 173 | } |
| 174 | + |
168 | 175 | } |
169 | 176 | // if we got 3 values, the last one must be a length |
170 | 177 | // (number 0 has been validated before, so number is admissible) |
|
0 commit comments