@@ -89,8 +89,7 @@ public CssClipPath() {
8989 * Creates a new CssClipPath
9090 *
9191 * @param expression The expression for this property
92- * @throws org.w3c.css.util.InvalidParamException
93- * Expressions are incorrect
92+ * @throws org.w3c.css.util.InvalidParamException Expressions are incorrect
9493 */
9594 public CssClipPath (ApplContext ac , CssExpression expression , boolean check )
9695 throws InvalidParamException {
@@ -110,7 +109,7 @@ public CssClipPath(ApplContext ac, CssExpression expression, boolean check)
110109 switch (val .getType ()) {
111110 case CssTypes .CSS_FUNCTION :
112111 if (!gotBasicShape ) {
113- CssFunction func = ( CssFunction ) val ;
112+ CssFunction func = val . getFunction () ;
114113 String funcname = func .getName ().toLowerCase ();
115114 switch (funcname ) {
116115 case "inset" :
@@ -139,19 +138,19 @@ public CssClipPath(ApplContext ac, CssExpression expression, boolean check)
139138 value = val ;
140139 break ;
141140 case CssTypes .CSS_IDENT :
142- if (inherit .equals (val )) {
143- value = inherit ;
141+ CssIdent id = val .getIdent ();
142+ if (CssIdent .isCssWide (id )) {
143+ value = val ;
144144 break ;
145145 }
146- if (none .equals (val )) {
147- value = none ;
146+ if (none .equals (id )) {
147+ value = val ;
148148 break ;
149149 }
150150 if (!gotGeometryBox ) {
151- CssIdent ident = getGeometryBoxAllowedValue ((CssIdent ) val );
152- if (ident != null ) {
151+ if (getGeometryBoxAllowedValue (id ) != null ) {
153152 gotGeometryBox = true ;
154- values .add (ident );
153+ values .add (val );
155154 break ;
156155 }
157156 }
@@ -198,7 +197,7 @@ protected static void checkInsetFunction(ApplContext ac, CssExpression expressio
198197 }
199198 break ;
200199 case CssTypes .CSS_IDENT :
201- if (inset_round .equals (( CssIdent ) val )) {
200+ if (inset_round .equals (val . getIdent () )) {
202201 // the remainder must be a border-radius
203202 CssExpression nex = new CssExpression ();
204203 expression .next ();
@@ -253,9 +252,8 @@ protected static void checkCircleFunction(ApplContext ac, CssExpression expressi
253252 gotRadius = true ;
254253 break ;
255254 case CssTypes .CSS_IDENT :
256- CssIdent ident = (CssIdent ) val ;
257- CssIdent id = getShapeRadiusAllowedValue (ident );
258- if (id != null ) {
255+ CssIdent ident = val .getIdent ();
256+ if (getShapeRadiusAllowedValue (ident ) != null ) {
259257 if (gotRadius ) {
260258 throw new InvalidParamException ("unrecognize" , ac );
261259 }
@@ -318,9 +316,8 @@ protected static void checkEllipseFunction(ApplContext ac, CssExpression express
318316 nbRadius ++;
319317 break ;
320318 case CssTypes .CSS_IDENT :
321- CssIdent ident = (CssIdent ) val ;
322- CssIdent id = getShapeRadiusAllowedValue (ident );
323- if (id != null ) {
319+ CssIdent ident = val .getIdent ();
320+ if (getShapeRadiusAllowedValue (ident ) != null ) {
324321 if (nbRadius >= 2 ) {
325322 throw new InvalidParamException ("unrecognize" , ac );
326323 }
@@ -385,9 +382,7 @@ protected static void checkPolygonFunction(ApplContext ac, CssExpression express
385382 case CssTypes .CSS_IDENT :
386383 // can only happen at the beginning.
387384 if (!gotFillRule && nbPoints == 0 && nbShapeArgs == 0 ) {
388- CssIdent ident = (CssIdent ) val ;
389- CssIdent id = CssFillRule .getAllowedIdent (ident );
390- if (id != null ) {
385+ if (CssFillRule .getAllowedIdent (val .getIdent ()) != null ) {
391386 gotFillRule = true ;
392387 break ;
393388 }
0 commit comments