@@ -81,8 +81,7 @@ public CssTextEmphasisStyle() {
8181 * Creates a new CssTextEmphasisStyle
8282 *
8383 * @param expression The expression for this property
84- * @throws org.w3c.css.util.InvalidParamException
85- * Expressions are incorrect
84+ * @throws org.w3c.css.util.InvalidParamException Expressions are incorrect
8685 */
8786 public CssTextEmphasisStyle (ApplContext ac , CssExpression expression , boolean check )
8887 throws InvalidParamException {
@@ -102,31 +101,33 @@ public CssTextEmphasisStyle(ApplContext ac, CssExpression expression, boolean ch
102101
103102 switch (val .getType ()) {
104103 case CssTypes .CSS_STRING :
105- CssString s = (CssString ) val ;
106- // limit of 1 character + two surrounding quotes
107- // TODO might be a warning only
108- if (s .toString ().length () != 3 ) {
109- throw new InvalidParamException ("value" ,
110- s , getPropertyName (), ac );
104+ if (val .getRawType () == CssTypes .CSS_STRING ) {
105+ CssString s = (CssString ) val ;
106+ // limit of 1 character + two surrounding quotes
107+ // TODO might be a warning only
108+ if (s .toString ().length () != 3 ) {
109+ throw new InvalidParamException ("value" ,
110+ s , getPropertyName (), ac );
111+ }
111112 }
112113 if (check && expression .getCount () != 1 ) {
113114 throw new InvalidParamException ("value" ,
114115 val .toString (),
115116 getPropertyName (), ac );
116117 }
117- value = s ;
118+ value = val ;
118119 break ;
119120 case CssTypes .CSS_IDENT :
120- CssIdent ident = ( CssIdent ) val ;
121+ CssIdent ident = val . getIdent () ;
121122 if (inherit .equals (ident )) {
122- value = inherit ;
123+ value = val ;
123124 if (check && expression .getCount () != 1 ) {
124125 throw new InvalidParamException ("value" ,
125126 val .toString (),
126127 getPropertyName (), ac );
127128 }
128129 } else if (none .equals (ident )) {
129- value = none ;
130+ value = val ;
130131 if (check && expression .getCount () != 1 ) {
131132 throw new InvalidParamException ("value" ,
132133 val .toString (),
@@ -168,7 +169,7 @@ public CssTextEmphasisStyle(ApplContext ac, CssExpression expression, boolean ch
168169 val .toString (),
169170 getPropertyName (), ac );
170171 }
171- ident = ( CssIdent ) val ;
172+ ident = val . getIdent () ;
172173 } while (!expression .end ());
173174 // now construct the value
174175 if (formValue != null && styleValue != null ) {
0 commit comments