- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Thu, 03 May 2012 13:21:06 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css1 In directory hutz:/tmp/cvs-serv30865/w3c/css/properties/css1 Modified Files: CssBorderBottom.java CssBorderColor.java CssBorderLeft.java CssBorderRight.java CssBorderStyle.java CssBorderTop.java Log Message: some more css1 funkyness Index: CssBorderColor.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderColor.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- CssBorderColor.java 3 May 2012 09:04:22 -0000 1.11 +++ CssBorderColor.java 3 May 2012 13:21:02 -0000 1.12 @@ -5,11 +5,11 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css1; -import org.w3c.css.properties.css.CssProperty; -import org.w3c.css.properties.css2.CssBorderBottomColor; -import org.w3c.css.properties.css2.CssBorderLeftColor; -import org.w3c.css.properties.css2.CssBorderRightColor; -import org.w3c.css.properties.css2.CssBorderTopColor; +import org.w3c.css.parser.CssStyle; +import org.w3c.css.properties.css.CssBorderBottomColor; +import org.w3c.css.properties.css.CssBorderLeftColor; +import org.w3c.css.properties.css.CssBorderRightColor; +import org.w3c.css.properties.css.CssBorderTopColor; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; @@ -95,6 +95,7 @@ value = (res.size() == 1) ? res.get(0) : new CssValueList(res); // now assign the computed values... + // as the property des not exist, we use the defined superclass top = new CssBorderTopColor(); right = new CssBorderRightColor(); bottom = new CssBorderBottomColor(); @@ -125,37 +126,22 @@ } } - /** - * Check the border-*-color and returns a value. - * It makes sense to do it only once for all the sides, so by having the code here. - */ - protected static CssValue checkBorderSideColor(ApplContext ac, CssProperty caller, CssExpression expression, - boolean check) throws InvalidParamException { - - if (check && expression.getCount() > 1) { - throw new InvalidParamException("unrecognize", ac); - } - - CssValue retval = null; - CssValue val = expression.getValue(); - - switch (val.getType()) { - case CssTypes.CSS_COLOR: - retval = val; - break; - case CssTypes.CSS_IDENT: - if (inherit.equals(val)) { - retval = inherit; - break; - } - retval = new org.w3c.css.values.CssColor(ac, - (String) val.get()); - break; - default: - throw new InvalidParamException("value", val.toString(), - caller.getPropertyName(), ac); - } - expression.next(); - return retval; - } + /** + * Add this property to the CssStyle + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { + org.w3c.css.properties.css.CssBorder cssBorder = ((Css1Style) style).cssBorder; + cssBorder.borderColor.byUser = byUser; + if (cssBorder.borderColor.shorthand) { + style.addRedefinitionWarning(ac, this); + } + cssBorder.borderColor.value = value; + cssBorder.borderColor.top = top; + cssBorder.borderColor.left = left; + cssBorder.borderColor.right = right; + cssBorder.borderColor.bottom = bottom; + cssBorder.borderColor.shorthand = shorthand; + } } Index: CssBorderBottom.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderBottom.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- CssBorderBottom.java 26 Apr 2012 09:45:49 -0000 1.8 +++ CssBorderBottom.java 3 May 2012 13:21:02 -0000 1.9 @@ -6,8 +6,9 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css1; -import org.w3c.css.properties.css2.CssBorderBottomColor; -import org.w3c.css.properties.css2.CssBorderBottomStyle; +import org.w3c.css.parser.CssStyle; +import org.w3c.css.properties.css.CssBorderBottomColor; +import org.w3c.css.properties.css.CssBorderBottomStyle; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; @@ -65,6 +66,30 @@ } } + /** + * Add this property to the CssStyle + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { + Css1Style css1Style = (Css1Style) style; + css1Style.cssBorder.byUser = byUser; + if (css1Style.cssBorder.borderBottom != null) { + style.addRedefinitionWarning(ac, this); + } + css1Style.cssBorder.borderBottom = this; + if (_width != null) { + _width.addToStyle(ac, style); + } + if (css1Style.cssBorder.borderColor.bottom != null) { + style.addRedefinitionWarning(ac, _color); + } + css1Style.cssBorder.borderColor.bottom = _color; + if (css1Style.cssBorder.borderStyle.bottom != null) { + style.addRedefinitionWarning(ac, _style); + } + css1Style.cssBorder.borderStyle.bottom = _style; + } /** * Returns a string representation of the object. */ Index: CssBorderStyle.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderStyle.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- CssBorderStyle.java 26 Apr 2012 09:45:49 -0000 1.10 +++ CssBorderStyle.java 3 May 2012 13:21:03 -0000 1.11 @@ -5,11 +5,11 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css1; -import org.w3c.css.properties.css.CssProperty; -import org.w3c.css.properties.css2.CssBorderBottomStyle; -import org.w3c.css.properties.css2.CssBorderLeftStyle; -import org.w3c.css.properties.css2.CssBorderRightStyle; -import org.w3c.css.properties.css2.CssBorderTopStyle; +import org.w3c.css.parser.CssStyle; +import org.w3c.css.properties.css.CssBorderBottomStyle; +import org.w3c.css.properties.css.CssBorderLeftStyle; +import org.w3c.css.properties.css.CssBorderRightStyle; +import org.w3c.css.properties.css.CssBorderTopStyle; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; @@ -150,34 +150,23 @@ } } - /** - * Check the border-*-style and returns a value. - * It makes sense to do it only once for all the sides, so by having the code here. - */ - protected static CssValue checkBorderSideStyle(ApplContext ac, CssProperty caller, CssExpression expression, - boolean check) throws InvalidParamException { - if (check && expression.getCount() > 1) { - throw new InvalidParamException("unrecognize", ac); - } - CssValue retval = null; - CssValue val = expression.getValue(); - switch (val.getType()) { - case CssTypes.CSS_IDENT: - if (inherit.equals(val)) { - retval = inherit; - } else { - retval = getMatchingIdent((CssIdent) val); - } - if (retval == null) { - throw new InvalidParamException("value", expression.getValue(), - caller.getPropertyName(), ac); - } - break; - default: - throw new InvalidParamException("unrecognize", ac); - } - expression.next(); - return retval; - } + /** + * Add this property to the CssStyle + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { + org.w3c.css.properties.css.CssBorder cssBorder = ((Css1Style) style).cssBorder; + cssBorder.borderStyle.byUser = byUser; + if (cssBorder.borderStyle.shorthand) { + style.addRedefinitionWarning(ac, this); + } + cssBorder.borderStyle.value = value; + cssBorder.borderStyle.top = top; + cssBorder.borderStyle.left = left; + cssBorder.borderStyle.right = right; + cssBorder.borderStyle.bottom = bottom; + cssBorder.borderStyle.shorthand = shorthand; + } } Index: CssBorderRight.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderRight.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CssBorderRight.java 26 Apr 2012 09:45:49 -0000 1.7 +++ CssBorderRight.java 3 May 2012 13:21:03 -0000 1.8 @@ -6,8 +6,9 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css1; -import org.w3c.css.properties.css2.CssBorderRightColor; -import org.w3c.css.properties.css2.CssBorderRightStyle; +import org.w3c.css.parser.CssStyle; +import org.w3c.css.properties.css.CssBorderRightColor; +import org.w3c.css.properties.css.CssBorderRightStyle; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; @@ -63,7 +64,32 @@ } } - /** + /** + * Add this property to the CssStyle + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { + Css1Style css1Style = (Css1Style) style; + css1Style.cssBorder.byUser = byUser; + if (css1Style.cssBorder.borderRight != null) { + style.addRedefinitionWarning(ac, this); + } + css1Style.cssBorder.borderRight = this; + if (_width != null) { + _width.addToStyle(ac, style); + } + if (css1Style.cssBorder.borderColor.right != null) { + style.addRedefinitionWarning(ac, _color); + } + css1Style.cssBorder.borderColor.right = _color; + if (css1Style.cssBorder.borderStyle.right != null) { + style.addRedefinitionWarning(ac, _style); + } + css1Style.cssBorder.borderStyle.right = _style; + } + + /** * Returns a string representation of the object. */ public String toString() { Index: CssBorderLeft.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderLeft.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CssBorderLeft.java 26 Apr 2012 09:45:49 -0000 1.7 +++ CssBorderLeft.java 3 May 2012 13:21:03 -0000 1.8 @@ -5,8 +5,9 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css1; -import org.w3c.css.properties.css2.CssBorderLeftColor; -import org.w3c.css.properties.css2.CssBorderLeftStyle; +import org.w3c.css.parser.CssStyle; +import org.w3c.css.properties.css.CssBorderLeftColor; +import org.w3c.css.properties.css.CssBorderLeftStyle; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; @@ -63,6 +64,31 @@ } } + /** + * Add this property to the CssStyle + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { + Css1Style css1Style = (Css1Style) style; + css1Style.cssBorder.byUser = byUser; + if (css1Style.cssBorder.borderLeft != null) { + style.addRedefinitionWarning(ac, this); + } + css1Style.cssBorder.borderLeft = this; + if (_width != null) { + _width.addToStyle(ac, style); + } + if (css1Style.cssBorder.borderColor.left != null) { + style.addRedefinitionWarning(ac, _color); + } + css1Style.cssBorder.borderColor.left = _color; + if (css1Style.cssBorder.borderStyle.left != null) { + style.addRedefinitionWarning(ac, _style); + } + css1Style.cssBorder.borderStyle.left = _style; + } + /** * Returns a string representation of the object. */ Index: CssBorderTop.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBorderTop.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- CssBorderTop.java 26 Apr 2012 09:45:50 -0000 1.7 +++ CssBorderTop.java 3 May 2012 13:21:04 -0000 1.8 @@ -6,8 +6,9 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css1; -import org.w3c.css.properties.css2.CssBorderTopColor; -import org.w3c.css.properties.css2.CssBorderTopStyle; +import org.w3c.css.parser.CssStyle; +import org.w3c.css.properties.css.CssBorderTopColor; +import org.w3c.css.properties.css.CssBorderTopStyle; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; @@ -63,7 +64,32 @@ } } - /** + /** + * Add this property to the CssStyle + * + * @param style The CssStyle + */ + public void addToStyle(ApplContext ac, CssStyle style) { + Css1Style css1Style = (Css1Style) style; + css1Style.cssBorder.byUser = byUser; + if (css1Style.cssBorder.borderTop != null) { + style.addRedefinitionWarning(ac, this); + } + css1Style.cssBorder.borderTop = this; + if (_width != null) { + _width.addToStyle(ac, style); + } + if (css1Style.cssBorder.borderColor.top != null) { + style.addRedefinitionWarning(ac, _color); + } + css1Style.cssBorder.borderColor.top = _color; + if (css1Style.cssBorder.borderStyle.top != null) { + style.addRedefinitionWarning(ac, _style); + } + css1Style.cssBorder.borderStyle.top = _style; + } + + /** * Returns a string representation of the object. */ public String toString() {
Received on Thursday, 3 May 2012 13:21:12 UTC