Skip to content

Commit d684f4c

Browse files
committed
added missing play state parsing in the animation shorthand
This fix #292
1 parent 2283624 commit d684f4c

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public class CssAnimation extends org.w3c.css.properties.css.CssAnimation {
3434
CssAnimationDirection cssAnimationDirection = null;
3535
CssAnimationFillMode cssAnimationFillMode = null;
3636
CssAnimationIterationCount cssAnimationIterationCount = null;
37+
CssAnimationPlayState cssAnimationPlayState = null;
3738

3839
/**
3940
* Create a new CssAnimation
@@ -47,6 +48,7 @@ public CssAnimation() {
4748
cssAnimationIterationCount = new CssAnimationIterationCount();
4849
cssAnimationFillMode = new CssAnimationFillMode();
4950
cssAnimationDirection = new CssAnimationDirection();
51+
cssAnimationPlayState = new CssAnimationPlayState();
5052
}
5153

5254
/**
@@ -133,6 +135,10 @@ public CssAnimation(ApplContext ac, CssExpression expression, boolean check)
133135
cssAnimationFillMode = new CssAnimationFillMode();
134136
cssAnimationFillMode.value = v.fillmode;
135137
}
138+
if (v.playState != null) {
139+
cssAnimationPlayState = new CssAnimationPlayState();
140+
cssAnimationPlayState.value = v.playState;
141+
}
136142
} else {
137143
// TODO explode the layers for addToStyle...
138144
value = new CssLayerList(values);
@@ -174,6 +180,9 @@ public void addToStyle(ApplContext ac, CssStyle style) {
174180
if (cssAnimationFillMode != null) {
175181
cssAnimationFillMode.addToStyle(ac, style);
176182
}
183+
if (cssAnimationPlayState != null) {
184+
cssAnimationPlayState.addToStyle(ac, style);
185+
}
177186
}
178187

179188
private CssAnimationValue checkLayer(ApplContext ac,
@@ -183,7 +192,7 @@ private CssAnimationValue checkLayer(ApplContext ac,
183192
CssAnimationValue v = new CssAnimationValue();
184193
// here we know we have the right operator, we just need to check
185194
// everything else.
186-
if (expression.getCount() > 7) {
195+
if (expression.getCount() > 8) {
187196
throw new InvalidParamException("unrecognize", ac);
188197
}
189198
CssValue val;
@@ -261,6 +270,12 @@ private CssAnimationValue checkLayer(ApplContext ac,
261270
break;
262271
}
263272
}
273+
if (v.playState == null) {
274+
if (CssAnimationPlayState.getAllowedIdent(id) != null) {
275+
v.playState = val;
276+
break;
277+
}
278+
}
264279
if (v.name == null) {
265280
if (CssAnimationName.getAllowedIdent(ac, id) != null) {
266281
v.name = val;
@@ -287,6 +302,7 @@ private class CssAnimationValue extends CssValueList {
287302
CssValue itercount = null;
288303
CssValue direction = null;
289304
CssValue fillmode = null;
305+
CssValue playState = null;
290306

291307

292308
public String toString() {

0 commit comments

Comments
 (0)