- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 14 Sep 2005 15:15:00 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css21 In directory hutz:/tmp/cvs-serv9389/org/w3c/css/properties/css21 Modified Files: Css21Style.java CssBackgroundCSS21.java CssBackgroundColorCSS21.java CssBackgroundPositionCSS21.java CssBorderBottomCSS21.java CssBorderBottomColorCSS21.java CssBorderCSS21.java CssBorderColorCSS21.java CssBorderFaceColorCSS21.java CssBorderLeftCSS21.java CssBorderLeftColorCSS21.java CssBorderRightCSS21.java CssBorderRightColorCSS21.java CssBorderTopCSS21.java CssBorderTopColorCSS21.java CssColorCSS21.java CssContentCSS21.java CssCursorCSS21.java CssDisplayCSS21.java CssListStyleCSS21.java CssListStyleTypeCSS21.java CssTextAlignCSS21.java CssWhiteSpaceCSS21.java Log Message: >From Jean-Guilhem Rouel (again!) Reformatting of code Fix for bug 774 [1] (even more warnings) Fix for bug 768 [2] Modification of the soap output format (each warning list and error list has the URI it refers to) [1] http://www.w3.org/Bugs/Public/show_bug.cgi?id=774 [2] http://www.w3.org/Bugs/Public/show_bug.cgi?id=768 Index: CssBorderFaceColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderFaceColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderFaceColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderFaceColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -17,7 +17,7 @@ * Created: Aug 31, 2005 3:29:22 PM<br /> */ public class CssBorderFaceColorCSS21 extends CssBorderFaceColorCSS2 { - + /** * Create a new CssBorderFaceColor */ @@ -51,7 +51,7 @@ */ public CssBorderFaceColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } @@ -62,8 +62,8 @@ setFace(val); } else if (val.equals(CssProperty.inherit)) { setFace(CssProperty.inherit); - } else if(val.equals(CssProperty.transparent)) { - setFace(CssProperty.transparent); + } else if(val.equals(CssProperty.transparent)) { + setFace(CssProperty.transparent); } else if (val instanceof CssIdent) { setFace(new org.w3c.css.values.CssColorCSS21(ac, (String) val.get())); } else { @@ -73,7 +73,7 @@ expression.next(); } - public CssBorderFaceColorCSS21(ApplContext ac, CssExpression expression) + public CssBorderFaceColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } Index: CssBorderLeftCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderLeftCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderLeftCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderLeftCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -17,61 +17,61 @@ * Created: Aug 31, 2005 2:08:48 PM<br /> */ public class CssBorderLeftCSS21 extends CssBorderLeftCSS2 { - + /** * Create a new CssBorderLeftCSS21 */ public CssBorderLeftCSS21() { super(); - } - + } + /** * Create a new CssBorderLeftCSS21 * * @param expression The expression for this property * @exception InvalidParamException The expression is incorrect - */ + */ public CssBorderLeftCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = null; char op = SPACE; boolean find = true; - + if(check && expression.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + boolean manyValues = (expression.getCount() > 1); - + setByUser(); - + while (find) { find = false; - val = expression.getValue(); - op = expression.getOperator(); + val = expression.getValue(); + op = expression.getOperator(); if (val == null) break; - + // if there are many values, we can't have inherit as one of them if(manyValues && val.equals(inherit)) { throw new InvalidParamException("unrecognize", null, null, ac); } - + if (op != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), - ac); + ac); if (getWidth() == null) { try { - setWidth(new CssBorderLeftWidthCSS2(ac, expression)); + setWidth(new CssBorderLeftWidthCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ - // nothing to do, style will test this value + // nothing to do, style will test this value } } if (!find && getStyle() == null) { try { - setStyle(new CssBorderLeftStyleCSS2(ac, expression)); + setStyle(new CssBorderLeftStyleCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ // nothing to do, color will test this value @@ -80,14 +80,14 @@ if (!find && getColor() == null) { // throws an exception if the value is not valid setColor(new CssBorderLeftColorCSS21(ac, expression)); - find = true; + find = true; } } } - + public CssBorderLeftCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression,false); } - + } Index: CssTextAlignCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssTextAlignCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssTextAlignCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssTextAlignCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -20,27 +20,27 @@ */ public CssTextAlignCSS21() { // depends on user agent and writing direction - } - + } + /** * Create a new CssTextAlign * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public CssTextAlignCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + super(ac, expression, check); - + Object val = get(); - + if(val instanceof CssString) { - throw new InvalidParamException("value", val.toString(), + throw new InvalidParamException("value", val.toString(), getPropertyName(), ac); - } + } } - - public CssTextAlignCSS21(ApplContext ac, CssExpression expression) + + public CssTextAlignCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } Index: CssContentCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssContentCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssContentCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssContentCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -19,26 +19,26 @@ static final CssIdent normal = new CssIdent("normal"); static final CssIdent none = new CssIdent("none"); - + /** * Create a new CssContent */ public CssContentCSS21() { - } - + } + /** * Create a new CssContent * * @param expression The expression for this property * @exception InvalidParamException The expression is incorrect - */ + */ public CssContentCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + CssValue val = expression.getValue(); setByUser(); - + if (val.equals(inherit)) { if(expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); @@ -63,11 +63,11 @@ expression.next(); return; } - + addContent(ac, expression); - + } - + public CssContentCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); Index: Css21Style.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/Css21Style.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Css21Style.java 1 Sep 2005 11:51:21 -0000 1.1 +++ Css21Style.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -13,9 +13,9 @@ * Created: Aug 30, 2005 2:25:17 PM<br /> */ public class Css21Style extends Css2Style { - + public void print(CssPrinterStyle printer) { super.print(printer); } - + } Index: CssColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -24,20 +24,20 @@ */ public CssColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); setByUser(); if (val.equals(inherit)) { setColor(inherit); expression.next(); - } else if (val instanceof org.w3c.css.values.CssColor) { + } else if (val instanceof org.w3c.css.values.CssColor) { setColor(val); expression.next(); - } else if (val instanceof CssIdent) { + } else if (val instanceof CssIdent) { setColor(new org.w3c.css.values.CssColorCSS21(ac, (String) val.get())); expression.next(); Index: CssDisplayCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssDisplayCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssDisplayCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssDisplayCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -18,70 +18,70 @@ public class CssDisplayCSS21 extends CssDisplayCSS2 { private static String[] DISPLAY = { - "inline", "block", "inline-block", "list-item", "run-in", "table", - "inline-table", "table-row-group", "table-column-group", + "inline", "block", "inline-block", "list-item", "run-in", "table", + "inline-table", "table-row-group", "table-column-group", "table-header-group", "table-footer-group", "table-row", "table-column", "table-cell", "table-caption", "none", "inherit" }; private static int[] hash_values; - + static { hash_values = new int[DISPLAY.length]; for (int i = 0; i < DISPLAY.length; i++) hash_values[i] = DISPLAY[i].hashCode(); } - + /** * Create a new CssDisplay */ public CssDisplayCSS21() { // nothing to do - } - + } + /** * Create a new CssDisplay * * @param expression The expression for this property * @exception InvalidParamException Values are incorect - */ + */ public CssDisplayCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); - + setByUser(); if ( val instanceof CssIdent) { int hash = val.hashCode(); for (int i = 0; i < DISPLAY.length; i++) { if (hash_values[i] == hash) { - setValue(i); + setValue(i); expression.next(); return; } } } - - throw new InvalidParamException("value", expression.getValue(), + + throw new InvalidParamException("value", expression.getValue(), getPropertyName(), ac); } - + public CssDisplayCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns a string representation of the object. */ public String toString() { return DISPLAY[getValue()]; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -89,7 +89,7 @@ public boolean isSoftlyInherited() { return getValue() == DISPLAY.length - 1; } - + /** * Returns the value of this property */ Index: CssBorderLeftColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderLeftColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderLeftColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderLeftColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -15,7 +15,7 @@ * Created: Aug 31, 2005 2:10:19 PM<br /> */ public class CssBorderLeftColorCSS21 extends CssBorderLeftColorCSS2 { - + /** * Create a new CssBorderLeftColorCSS21 with an another CssBorderFaceColorCSS2 * @@ -24,7 +24,7 @@ public CssBorderLeftColorCSS21(CssBorderFaceColorCSS2 another) { super(another); } - + /** * Create a new CssBorderLeftColor * @@ -33,17 +33,17 @@ */ public CssBorderLeftColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + setByUser(); setFace(new CssBorderFaceColorCSS21(ac, expression)); } - - public CssBorderLeftColorCSS21(ApplContext ac, CssExpression expression) + + public CssBorderLeftColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); - } + } } Index: CssBorderRightColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderRightColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderRightColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderRightColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -15,7 +15,7 @@ * Created: Aug 31, 2005 2:09:31 PM<br /> */ public class CssBorderRightColorCSS21 extends CssBorderRightColorCSS2 { - + /** * Create a new CssBorderRightColorCSS21 with an another CssBorderFaceColorCSS2 * @@ -24,7 +24,7 @@ public CssBorderRightColorCSS21(CssBorderFaceColorCSS2 another) { super(another); } - + /** * Create a new CssBorderRightColor * @@ -33,17 +33,17 @@ */ public CssBorderRightColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + setByUser(); setFace(new CssBorderFaceColorCSS21(ac, expression)); } - - public CssBorderRightColorCSS21(ApplContext ac, CssExpression expression) + + public CssBorderRightColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); - } + } } Index: CssListStyleTypeCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssListStyleTypeCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssListStyleTypeCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssListStyleTypeCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -14,34 +14,34 @@ * Created: Aug 31, 2005 10:54:09 AM<br /> */ public class CssListStyleTypeCSS21 extends CssListStyleTypeCSS2 { - - - + + + /** * Create a new CssListStyleTypeCSS21 */ public CssListStyleTypeCSS21() { // nothing to do - } - + } + /** * Create a new CssListStyleTypeCSS21 * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public CssListStyleTypeCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + super(ac, expression, check); - + // fast but ugly if(getValue() == 12 || getValue() == 15 || getValue() == 16 || - getValue() == 17 || getValue() == 18 || getValue() == 19) { + getValue() == 17 || getValue() == 18 || getValue() == 19) { throw new InvalidParamException("value", get().toString(), getPropertyName(), ac); } } - + public CssListStyleTypeCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); Index: CssBackgroundCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBackgroundCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBackgroundCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBackgroundCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -23,44 +23,44 @@ */ public CssBackgroundCSS21() { super(); - } - + } + /** * Set the value of the property * * @param expression The expression for this property * @exception InvalidParamException The expression is incorrect - */ + */ public CssBackgroundCSS21(ApplContext ac, CssExpression expression, - boolean check) throws InvalidParamException { + boolean check) throws InvalidParamException { CssValue val = expression.getValue(); char op = SPACE; boolean find = true; - + // too many values if(check && expression.getCount() > 6) { throw new InvalidParamException("unrecognize", ac); } - + setByUser(); boolean manyValues = (expression.getCount() > 1); - + while (find) { find = false; val = expression.getValue(); op = expression.getOperator(); - + if (val == null) { break; } - + // if there are many values, we can't have inherit as one of them if(manyValues && val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", null, null, ac); } - + if (getColor2() == null) { try { setColor(new CssBackgroundColorCSS21(ac, expression)); @@ -78,10 +78,10 @@ } } if (!find && getRepeat() == null) { - try { - setRepeat(new CssBackgroundRepeatCSS2(ac, expression)); + try { + setRepeat(new CssBackgroundRepeatCSS2(ac, expression)); find = true; - } catch (InvalidParamException e) { + } catch (InvalidParamException e) { // nothing to do, attachment will test this value } } @@ -101,11 +101,11 @@ // nothing to do } } - if(check && val != null && !find) { + if(check && val != null && !find) { throw new InvalidParamException("unrecognize", ac); } if (op != SPACE) { - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), ac); } @@ -115,8 +115,8 @@ } } - - public CssBackgroundCSS21(ApplContext ac, CssExpression expression) + + public CssBackgroundCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } Index: CssBorderBottomCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderBottomCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderBottomCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderBottomCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -17,61 +17,61 @@ * Created: Aug 31, 2005 2:07:13 PM<br /> */ public class CssBorderBottomCSS21 extends CssBorderBottomCSS2 { - + /** * Create a new CssBorderBottomCSS21 */ public CssBorderBottomCSS21() { super(); - } - + } + /** * Create a new CssBorderBottomCSS21 * * @param expression The expression for this property * @exception InvalidParamException The expression is incorrect - */ + */ public CssBorderBottomCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = null; char op = SPACE; boolean find = true; - + if(check && expression.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + boolean manyValues = (expression.getCount() > 1); - + setByUser(); - + while (find) { find = false; - val = expression.getValue(); - op = expression.getOperator(); + val = expression.getValue(); + op = expression.getOperator(); if (val == null) break; - + // if there are many values, we can't have inherit as one of them if(manyValues && val.equals(inherit)) { throw new InvalidParamException("unrecognize", null, null, ac); } - + if (op != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), - ac); + ac); if (getWidth() == null) { try { - setWidth(new CssBorderBottomWidthCSS2(ac, expression)); + setWidth(new CssBorderBottomWidthCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ - // nothing to do, style will test this value + // nothing to do, style will test this value } } if (!find && getStyle() == null) { try { - setStyle(new CssBorderBottomStyleCSS2(ac, expression)); + setStyle(new CssBorderBottomStyleCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ // nothing to do, color will test this value @@ -80,14 +80,14 @@ if (!find && getColor() == null) { // throws an exception if the value is not valid setColor(new CssBorderBottomColorCSS21(ac, expression)); - find = true; + find = true; } } } - + public CssBorderBottomCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression,false); } - + } Index: CssCursorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssCursorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssCursorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssCursorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -17,34 +17,34 @@ * Created: Aug 30, 2005 4:47:16 PM<br /> */ public class CssCursorCSS21 extends CursorCSS2 { - + private static String CURSOR[] = { - "auto", "crosshair", "default", "pointer", "move", "e-resize", - "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", + "auto", "crosshair", "default", "pointer", "move", "e-resize", + "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress" }; - + private static int[] hash_values; - + /** * Create a new Cursor */ public CssCursorCSS21() { super(); } - + /** * Create a new Cursor * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ - public CssCursorCSS21(ApplContext ac, CssExpression expression, boolean check) + */ + public CssCursorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = expression.getValue(); char op = expression.getOperator(); - + setByUser(); - + if (val.equals(inherit)) { if(expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); @@ -53,7 +53,7 @@ expression.next(); return; } - + while ((op == COMMA) && (val instanceof CssURL)) { if(val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", ac); @@ -62,16 +62,16 @@ expression.next(); val = expression.getValue(); op = expression.getOperator(); - } + } if (val instanceof CssURL) { - throw new InvalidParamException("comma", - val.toString(), + throw new InvalidParamException("comma", + val.toString(), getPropertyName(), ac); } - + if (val instanceof CssIdent) { int hash = val.hashCode(); - + for (int i = 0; i < CURSOR.length; i++) { if (hash_values[i] == hash) { setValue(i); @@ -83,11 +83,11 @@ } } } - - throw new InvalidParamException("value", + + throw new InvalidParamException("value", val.toString(), getPropertyName(), ac); } - + public CssCursorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); @@ -104,14 +104,14 @@ int l = getUris().size(); String ret = ""; while (i != l) { - ret += getUris().elementAt(i++) + + ret += getUris().elementAt(i++) + (new Character(COMMA)).toString() + " "; } ret += " " + CURSOR[getValue()]; return ret; } } - + static { hash_values = new int[CURSOR.length]; for (int i=0; i<CURSOR.length; i++) Index: CssBorderBottomColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderBottomColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderBottomColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderBottomColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -24,7 +24,7 @@ public CssBorderBottomColorCSS21(CssBorderFaceColorCSS2 another) { super(another); } - + /** * Create a new CssBorderBottomColor * @@ -33,18 +33,18 @@ */ public CssBorderBottomColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + setByUser(); setFace(new CssBorderFaceColorCSS21(ac, expression)); } - - public CssBorderBottomColorCSS21(ApplContext ac, CssExpression expression) + + public CssBorderBottomColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); - } - + } + } Index: CssBorderTopCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderTopCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderTopCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderTopCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -17,61 +17,61 @@ * Created: Aug 31, 2005 2:08:11 PM<br /> */ public class CssBorderTopCSS21 extends CssBorderTopCSS2 { - + /** * Create a new CssBorderTopCSS21 */ public CssBorderTopCSS21() { super(); - } - + } + /** * Create a new CssBorderTopCSS21 * * @param expression The expression for this property * @exception InvalidParamException The expression is incorrect - */ + */ public CssBorderTopCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = null; char op = SPACE; boolean find = true; - + if(check && expression.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + boolean manyValues = (expression.getCount() > 1); - + setByUser(); - + while (find) { find = false; - val = expression.getValue(); - op = expression.getOperator(); + val = expression.getValue(); + op = expression.getOperator(); if (val == null) break; - + // if there are many values, we can't have inherit as one of them if(manyValues && val.equals(inherit)) { throw new InvalidParamException("unrecognize", null, null, ac); } - + if (op != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), - ac); + ac); if (getWidth() == null) { try { - setWidth(new CssBorderTopWidthCSS2(ac, expression)); + setWidth(new CssBorderTopWidthCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ - // nothing to do, style will test this value + // nothing to do, style will test this value } } if (!find && getStyle() == null) { try { - setStyle(new CssBorderTopStyleCSS2(ac, expression)); + setStyle(new CssBorderTopStyleCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ // nothing to do, color will test this value @@ -80,14 +80,14 @@ if (!find && getColor() == null) { // throws an exception if the value is not valid setColor(new CssBorderTopColorCSS21(ac, expression)); - find = true; + find = true; } } } - + public CssBorderTopCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression,false); } - + } Index: CssBorderTopColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderTopColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderTopColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderTopColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -24,7 +24,7 @@ public CssBorderTopColorCSS21(CssBorderFaceColorCSS2 another) { super(another); } - + /** * Create a new CssBorderTopColor * @@ -33,18 +33,18 @@ */ public CssBorderTopColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + setByUser(); setFace(new CssBorderFaceColorCSS21(ac, expression)); } - - public CssBorderTopColorCSS21(ApplContext ac, CssExpression expression) + + public CssBorderTopColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); - } - + } + } Index: CssBackgroundColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBackgroundColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBackgroundColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBackgroundColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -16,7 +16,7 @@ * Created: Aug 31, 2005 2:04:23 PM<br /> */ public class CssBackgroundColorCSS21 extends CssBackgroundColorCSS2 { - + /** * Create a new CssBackgroundColorCSS2 */ @@ -32,7 +32,7 @@ */ public CssBackgroundColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } @@ -60,7 +60,7 @@ } } - public CssBackgroundColorCSS21(ApplContext ac, CssExpression expression) + public CssBackgroundColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } Index: CssWhiteSpaceCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssWhiteSpaceCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssWhiteSpaceCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssWhiteSpaceCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -19,57 +19,57 @@ private static String[] WHITESPACE = { "normal", "pre", "nowrap", "pre-wrap", "pre-line", "inherit" }; private static int[] hash_values; - + /** * Create a new CssWhiteSpace */ public CssWhiteSpaceCSS21() { // nothing to do } - + /** * Create a new CssWhiteSpace * * @param expression The expression for this property * @exception InvalidParamException values are incorrect - */ + */ public CssWhiteSpaceCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); - + setByUser(); - + if ( val instanceof CssIdent) { int hash = val.hashCode(); for (int i = 0; i < WHITESPACE.length; i++) if (hash_values[i] == hash) { - setValue(i); + setValue(i); expression.next(); return; } } - - throw new InvalidParamException("value", expression.getValue(), + + throw new InvalidParamException("value", expression.getValue(), getPropertyName(), ac); } - + public CssWhiteSpaceCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + /** * Returns the value of this property */ public Object get() { return WHITESPACE[getValue()]; } - + /** * Returns true if this property is "softly" inherited * e.g. his value equals inherit @@ -77,7 +77,7 @@ public boolean isSoftlyInherited() { return getValue() == (WHITESPACE.length - 1); } - + /** * Returns a string representation of the object. */ Index: CssBorderColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderColorCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderColorCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderColorCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -27,19 +27,19 @@ CssBorderRightColorCSS2 right, CssBorderLeftColorCSS2 left) { super(top, bottom, right, left); - } - + } + /** * Create a new CssBorderColorCSS21 * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public CssBorderColorCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + setByUser(); - + switch (expression.getCount()) { case 1: setTop(new CssBorderTopColorCSS21(ac, expression)); @@ -50,9 +50,9 @@ // setLeft(new CssBorderLeftColorCSS21( // (CssBorderFaceColorCSS21) getTop().get())); break; - case 2: + case 2: if (expression.getOperator() != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(expression.getOperator())).toString()), ac); if(expression.getValue().equals(inherit)) { @@ -70,15 +70,15 @@ break; case 3: if (expression.getOperator() != SPACE) - throw new InvalidParamException("operator", - ((new Character(expression.getOperator())).toString()), + throw new InvalidParamException("operator", + ((new Character(expression.getOperator())).toString()), ac); if(expression.getValue().equals(inherit)) { throw new InvalidParamException("unrecognize", ac); } setTop(new CssBorderTopColorCSS21(ac, expression)); if (expression.getOperator() != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(expression.getOperator())).toString()), ac); if(expression.getValue().equals(inherit)) { throw new InvalidParamException("unrecognize", ac); @@ -93,7 +93,7 @@ break; case 4: if (expression.getOperator() != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(expression.getOperator())).toString()), ac); if(expression.getValue().equals(inherit)) { @@ -101,7 +101,7 @@ } setTop(new CssBorderTopColorCSS21(ac, expression)); if (expression.getOperator() != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(expression.getOperator())).toString()), ac); if(expression.getValue().equals(inherit)) { @@ -109,7 +109,7 @@ } setRight(new CssBorderRightColorCSS21(ac, expression)); if (expression.getOperator() != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(expression.getOperator())).toString()), ac); if(expression.getValue().equals(inherit)) { @@ -127,10 +127,10 @@ } } } - - public CssBorderColorCSS21(ApplContext ac, CssExpression expression) + + public CssBorderColorCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + } Index: CssBorderCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -26,75 +26,75 @@ * Created: Aug 31, 2005 2:07:02 PM<br /> */ public class CssBorderCSS21 extends CssBorderCSS2 { - + /** * Create a new CssBorderFaceCSS2 */ public CssBorderCSS21() { super(); - } - + } + /** * Create a new CssBorderFaceCSS2 * * @param value The value for this property * @exception InvalidParamException The value is incorrect - */ + */ public CssBorderCSS21(ApplContext ac, CssExpression value, boolean check) throws InvalidParamException { - + if(check && value.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = value.getValue(); - - setByUser(); - + + setByUser(); + setTop(new CssBorderTopCSS21(ac, value)); - + if (val == value.getValue()) { - throw new InvalidParamException("value", - value.getValue(), + throw new InvalidParamException("value", + value.getValue(), getPropertyName(), ac); - } + } setRight(new CssBorderRightCSS21()); setBottom(new CssBorderBottomCSS21()); setLeft(new CssBorderLeftCSS21()); - + CssBorderTopWidthCSS2 w = getTop().getWidth2(); CssBorderTopStyleCSS2 s = getTop().getStyle2(); - CssBorderTopColorCSS2 c = getTop().getColor2(); - - if(w != null) { - getRight().setWidth( - new CssBorderRightWidthCSS2((CssBorderFaceWidthCSS2) w.get())); - getLeft().setWidth( - new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) w.get())); - getBottom().setWidth( - new CssBorderBottomWidthCSS2((CssBorderFaceWidthCSS2) w.get())); - } + CssBorderTopColorCSS2 c = getTop().getColor2(); + + if(w != null) { + getRight().setWidth( + new CssBorderRightWidthCSS2((CssBorderFaceWidthCSS2) w.get())); + getLeft().setWidth( + new CssBorderLeftWidthCSS2((CssBorderFaceWidthCSS2) w.get())); + getBottom().setWidth( + new CssBorderBottomWidthCSS2((CssBorderFaceWidthCSS2) w.get())); + } if(s != null) { - getRight().setStyle( + getRight().setStyle( new CssBorderRightStyleCSS2((CssBorderFaceStyleCSS2) s.get())); - getLeft().setStyle( + getLeft().setStyle( new CssBorderLeftStyleCSS2((CssBorderFaceStyleCSS2) s.get())); - getBottom().setStyle( + getBottom().setStyle( new CssBorderBottomStyleCSS2((CssBorderFaceStyleCSS2) s.get())); - } + } if(c != null) { - getRight().setColor( + getRight().setColor( new CssBorderRightColorCSS21((CssBorderFaceColorCSS21) c.get())); - getLeft().setColor( + getLeft().setColor( new CssBorderLeftColorCSS21((CssBorderFaceColorCSS21) c.get())); - getBottom().setColor( + getBottom().setColor( new CssBorderBottomColorCSS21((CssBorderFaceColorCSS21) c.get())); - } + } } - - public CssBorderCSS21(ApplContext ac, CssExpression expression) + + public CssBorderCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + } Index: CssBorderRightCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBorderRightCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBorderRightCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBorderRightCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -17,61 +17,61 @@ * Created: Aug 31, 2005 2:08:24 PM<br /> */ public class CssBorderRightCSS21 extends CssBorderRightCSS2 { - + /** * Create a new CssBorderRightCSS21 */ public CssBorderRightCSS21() { super(); - } - + } + /** * Create a new CssBorderRightCSS21 * * @param expression The expression for this property * @exception InvalidParamException The expression is incorrect - */ + */ public CssBorderRightCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { CssValue val = null; char op = SPACE; boolean find = true; - + if(check && expression.getCount() > 3) { throw new InvalidParamException("unrecognize", ac); } - + boolean manyValues = (expression.getCount() > 1); - + setByUser(); - + while (find) { find = false; - val = expression.getValue(); - op = expression.getOperator(); + val = expression.getValue(); + op = expression.getOperator(); if (val == null) break; - + // if there are many values, we can't have inherit as one of them if(manyValues && val.equals(inherit)) { throw new InvalidParamException("unrecognize", null, null, ac); } - + if (op != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), - ac); + ac); if (getWidth() == null) { try { - setWidth(new CssBorderRightWidthCSS2(ac, expression)); + setWidth(new CssBorderRightWidthCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ - // nothing to do, style will test this value + // nothing to do, style will test this value } } if (!find && getStyle() == null) { try { - setStyle(new CssBorderRightStyleCSS2(ac, expression)); + setStyle(new CssBorderRightStyleCSS2(ac, expression)); find = true; } catch(InvalidParamException e){ // nothing to do, color will test this value @@ -80,14 +80,14 @@ if (!find && getColor() == null) { // throws an exception if the value is not valid setColor(new CssBorderRightColorCSS21(ac, expression)); - find = true; + find = true; } } } - + public CssBorderRightCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression,false); } - + } Index: CssListStyleCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssListStyleCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssListStyleCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssListStyleCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -22,27 +22,27 @@ */ public CssListStyleCSS21() { // nothing to do - } - + } + /** * Create a new CssListStyleCSS2 * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public CssListStyleCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + int exprLength = expression.getCount(); - + if(check && exprLength > 3) { throw new InvalidParamException("unrecognize", ac); } - + CssValue val = expression.getValue(); char op = SPACE; boolean find = true; - + setByUser(); if (val.equals(inherit)) { @@ -53,16 +53,16 @@ expression.next(); return; } - + while (find) { find = false; val = expression.getValue(); op = expression.getOperator(); - + if(val != null && val.equals(inherit)) { throw new InvalidParamException("unrecognize", ac); } - + if ((getListStyleType() == null) && (val != null)) { try { setListStyleType(new CssListStyleTypeCSS21(ac, expression)); @@ -75,24 +75,24 @@ setListStyleImage(new CssListStyleImageCSS2(ac, expression)); find = true; } catch (InvalidParamException e) { - } + } } if (!find && (val != null) && (getListStylePosition() == null)) { setListStylePosition(new CssListStylePositionCSS2(ac, expression)); find = true; } - if(val != null && !find) { + if(val != null && !find) { throw new InvalidParamException("unrecognize", ac); } if (op != SPACE) { - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), ac); } } } - + public CssListStyleCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); Index: CssBackgroundPositionCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBackgroundPositionCSS21.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- CssBackgroundPositionCSS21.java 1 Sep 2005 11:51:21 -0000 1.1 +++ CssBackgroundPositionCSS21.java 14 Sep 2005 15:14:58 -0000 1.2 @@ -25,30 +25,30 @@ */ public CssBackgroundPositionCSS21() { super(); - } - + } + /** * Creates a new CssBackgroundPositionCSS2 * * @param expression The expression for this property * @exception InvalidParamException Values are incorrect - */ + */ public CssBackgroundPositionCSS21(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { - + if(check && expression.getCount() > 2) { throw new InvalidParamException("unrecognize", ac); } - + setByUser(); CssValue val = expression.getValue(); char op = expression.getOperator(); - + if (op != SPACE) - throw new InvalidParamException("operator", + throw new InvalidParamException("operator", ((new Character(op)).toString()), ac); - + if (val.equals(inherit)) { if(expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); @@ -58,16 +58,16 @@ expression.next(); return; } - - CssValue next = expression.getNextValue(); - if(val instanceof CssIdent) { + CssValue next = expression.getNextValue(); + + if(val instanceof CssIdent) { int index1 = IndexOfIdent((String) val.get()); if(index1 == -1) { throw new InvalidParamException("value", val, "background-position", ac); } // two keywords - if(next instanceof CssIdent) { + if(next instanceof CssIdent) { int index2 = IndexOfIdent((String) next.get()); if(index2 == -1 && check) { throw new InvalidParamException("value", next, "background-position", ac); @@ -77,10 +77,10 @@ if((isHorizontal(index1) && isVertical(index2)) || (isHorizontal(index2) && isVertical(index1))) { setFirst(val); - setSecond(next); + setSecond(next); } // both are horizontal or vertical but not 'center' - else if(check){ + else if(check){ throw new InvalidParamException("incompatible", val, next, ac); } @@ -98,8 +98,8 @@ setFirst(val); setSecond(next); } - // if the keyword is the first value, it can only be an - // horizontal one + // if the keyword is the first value, it can only be an + // horizontal one else { throw new InvalidParamException("incompatible", val, next, ac); @@ -110,8 +110,8 @@ setFirst(val); } // the second value is invalid - else if(check) { - throw new InvalidParamException("value", next, + else if(check) { + throw new InvalidParamException("value", next, getPropertyName(), ac); } else { @@ -158,22 +158,22 @@ } } else if(check){ - throw new InvalidParamException("value", expression.getValue(), + throw new InvalidParamException("value", expression.getValue(), getPropertyName(), ac); } - + // we only move the cursor if we found valid values - if(getFirst() != null) { - expression.next(); + if(getFirst() != null) { + expression.next(); + } + if(getSecond() != null) { + expression.next(); } - if(getSecond() != null) { - expression.next(); - } } - - public CssBackgroundPositionCSS21(ApplContext ac, CssExpression expression) + + public CssBackgroundPositionCSS21(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } - + }
Received on Wednesday, 14 September 2005 15:16:54 UTC