Skip to content

Commit e6b3613

Browse files
committed
1 parent 44bae5d commit e6b3613

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import static org.w3c.css.values.CssOperator.SPACE;
1919

2020
/**
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
2222
*/
2323
public class CssTransformOrigin extends org.w3c.css.properties.css.CssTransformOrigin {
2424

@@ -141,30 +141,37 @@ private void check(ArrayList<CssValue> values, ApplContext ac)
141141
// then we need to ckeck the values if we got two values and
142142
// at least one keyword (as restrictions may occur)
143143
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;
146146
CssValue v = values.get(0);
147147
if (v.getType() == CssTypes.CSS_IDENT) {
148148
CssIdent id = (CssIdent) v;
149149
// 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);
153153
}
154154
}
155155
v = values.get(1);
156156
if (v.getType() == CssTypes.CSS_IDENT) {
157157
CssIdent id = (CssIdent) v;
158158
// yeah, it can be a single ugly test.
159-
if (gothorizontal && isHorizontalIdent(id)) {
159+
if (got_horizontal && isHorizontalIdent(id)) {
160160
throw new InvalidParamException("value", id,
161161
getPropertyName(), ac);
162162
}
163-
if (gotvertical && isVerticalIdent(id)) {
163+
if (got_vertical && isVerticalIdent(id)) {
164164
throw new InvalidParamException("value", id,
165165
getPropertyName(), ac);
166166
}
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+
}
167173
}
174+
168175
}
169176
// if we got 3 values, the last one must be a length
170177
// (number 0 has been validated before, so number is admissible)

0 commit comments

Comments
 (0)