- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 02 Nov 2012 14:34:28 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css2 In directory hutz:/tmp/cvs-serv4088/css2 Modified Files: Css2Style.java Added Files: CssMarkerOffset.java Log Message: marker-offset is only defined in css2 (and atsc profile) --- NEW FILE: CssMarkerOffset.java --- // $Id: CssMarkerOffset.java,v 1.1 2012/11/02 14:34:26 ylafon Exp $ // Author: Yves Lafon <ylafon@w3.org> // // (c) COPYRIGHT MIT, ERCIM and Keio University, 2012. // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css2; import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.values.CssExpression; import org.w3c.css.values.CssIdent; import org.w3c.css.values.CssTypes; import org.w3c.css.values.CssValue; /** * @spec http://www.w3.org/TR/2008/REC-CSS2-20080411/generate.html#propdef-marker-offset */ public class CssMarkerOffset extends org.w3c.css.properties.css.CssMarkerOffset { public static final CssIdent auto = CssIdent.getIdent("auto"); /** * Create a new CssMarkerOffset */ public CssMarkerOffset() { } /** * Creates a new CssMarkerOffset * * @param expression The expression for this property * @throws org.w3c.css.util.InvalidParamException * Expressions are incorrect */ public CssMarkerOffset(ApplContext ac, CssExpression expression, boolean check) throws InvalidParamException { if (check && expression.getCount() > 1) { throw new InvalidParamException("unrecognize", ac); } CssValue val = expression.getValue(); setByUser(); switch (val.getType()) { case CssTypes.CSS_NUMBER: val = val.getLength(); case CssTypes.CSS_LENGTH: value = val; break; case CssTypes.CSS_IDENT: if (inherit.equals(val)) { value = inherit; break; } if (auto.equals(val)) { value = auto; break; } default: throw new InvalidParamException("value", expression.getValue(), getPropertyName(), ac); } expression.next(); } public CssMarkerOffset(ApplContext ac, CssExpression expression) throws InvalidParamException { this(ac, expression, false); } } Index: Css2Style.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css2/Css2Style.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Css2Style.java 19 Oct 2012 10:05:52 -0000 1.16 +++ Css2Style.java 2 Nov 2012 14:34:26 -0000 1.17 @@ -6,10 +6,12 @@ // Please first read the full copyright statement in file COPYRIGHT.html package org.w3c.css.properties.css2; +import org.w3c.css.parser.CssSelectors; import org.w3c.css.properties.aural.ACssStyle; import org.w3c.css.properties.css.CssBottom; import org.w3c.css.properties.css.CssCursor; import org.w3c.css.properties.css.CssLeft; +import org.w3c.css.properties.css.CssMarkerOffset; import org.w3c.css.properties.css.CssMaxHeight; import org.w3c.css.properties.css.CssMaxWidth; import org.w3c.css.properties.css.CssMinHeight; @@ -22,21 +24,26 @@ import org.w3c.css.properties.css.CssRight; import org.w3c.css.properties.css.CssTextShadow; import org.w3c.css.properties.css.CssTop; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.Warning; +import org.w3c.css.util.Warnings; +import org.w3c.css.values.CssIdent; /** * @version $Revision$ */ public class Css2Style extends ACssStyle { - /** - * aural properties - */ - public org.w3c.css.properties.css.CssAzimuth cssAzimuth; - public org.w3c.css.properties.css.CssElevation cssElevation; + static final CssIdent marker = CssIdent.getIdent("marker"); + /** + * aural properties + */ + public org.w3c.css.properties.css.CssAzimuth cssAzimuth; + public org.w3c.css.properties.css.CssElevation cssElevation; - /** - * font properties - */ + /** + * font properties + */ public org.w3c.css.properties.css.CssFontStretch cssFontStretch; public org.w3c.css.properties.css.CssFontSizeAdjust cssFontSizeAdjust; @@ -56,85 +63,88 @@ public CssMaxWidth cssMaxWidth; public CssMinHeight cssMinHeight; public CssMaxHeight cssMaxHeight; - + public CssOutlineWidth cssOutlineWidth; public CssOutlineStyle cssOutlineStyle; public CssOutlineColor cssOutlineColor; public CssOutline cssOutline; public CssCursor cssCursor; - + + public CssMarkerOffset cssMarkerOffset; + /** - * Get the azimuth - */ - public org.w3c.css.properties.css.CssAzimuth getAzimuth() { - if (cssAzimuth == null) { - cssAzimuth = (org.w3c.css.properties.css.CssAzimuth) style.CascadingOrder(new org.w3c.css.properties.css.CssAzimuth(), - style, selector); - } - return cssAzimuth; - } + * Get the azimuth + */ + public org.w3c.css.properties.css.CssAzimuth getAzimuth() { + if (cssAzimuth == null) { + cssAzimuth = (org.w3c.css.properties.css.CssAzimuth) style.CascadingOrder(new org.w3c.css.properties.css.CssAzimuth(), + style, selector); + } + return cssAzimuth; + } - /** - * Get the elevation - */ - public org.w3c.css.properties.css.CssElevation getElevation() { - if (cssElevation == null) { - cssElevation = (org.w3c.css.properties.css.CssElevation) style.CascadingOrder(new org.w3c.css.properties.css.CssElevation(), - style, selector); - } - return cssElevation; - } + /** + * Get the elevation + */ + public org.w3c.css.properties.css.CssElevation getElevation() { + if (cssElevation == null) { + cssElevation = (org.w3c.css.properties.css.CssElevation) style.CascadingOrder(new org.w3c.css.properties.css.CssElevation(), + style, selector); + } + return cssElevation; + } - /** - * Get the border-top-style property - */ - public final org.w3c.css.properties.css.CssBorderTopStyle getBorderTopStyle() { - if (cssBorder.borderStyle.top == null) { - cssBorder.borderStyle.top = - (org.w3c.css.properties.css.CssBorderTopStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderTopStyle(), - style, selector); - } - return cssBorder.borderStyle.top; - } + /** + * Get the border-top-style property + */ + public final org.w3c.css.properties.css.CssBorderTopStyle getBorderTopStyle() { + if (cssBorder.borderStyle.top == null) { + cssBorder.borderStyle.top = + (org.w3c.css.properties.css.CssBorderTopStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderTopStyle(), + style, selector); + } + return cssBorder.borderStyle.top; + } - /** - * Get the border-right-style property - */ - public final org.w3c.css.properties.css.CssBorderRightStyle getBorderRightStyle() { - if (cssBorder.borderStyle.right == null) { - cssBorder.borderStyle.right = - (org.w3c.css.properties.css.CssBorderRightStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderRightStyle(), - style, selector); - } - return cssBorder.borderStyle.right; - } + /** + * Get the border-right-style property + */ + public final org.w3c.css.properties.css.CssBorderRightStyle getBorderRightStyle() { + if (cssBorder.borderStyle.right == null) { + cssBorder.borderStyle.right = + (org.w3c.css.properties.css.CssBorderRightStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderRightStyle(), + style, selector); + } + return cssBorder.borderStyle.right; + } - /** - * Get the border-bottom-style property - */ - public final org.w3c.css.properties.css.CssBorderBottomStyle getBorderBottomStyle() { - if (cssBorder.borderStyle.bottom == null) { - cssBorder.borderStyle.bottom = - (org.w3c.css.properties.css.CssBorderBottomStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderBottomStyle(), - style, selector); - } - return cssBorder.borderStyle.bottom; - } + /** + * Get the border-bottom-style property + */ + public final org.w3c.css.properties.css.CssBorderBottomStyle getBorderBottomStyle() { + if (cssBorder.borderStyle.bottom == null) { + cssBorder.borderStyle.bottom = + (org.w3c.css.properties.css.CssBorderBottomStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderBottomStyle(), + style, selector); + } + return cssBorder.borderStyle.bottom; + } - /** - * Get the border-left-style property - */ - public final org.w3c.css.properties.css.CssBorderLeftStyle getBorderLeftStyle() { - if (cssBorder.borderStyle.left == null) { - cssBorder.borderStyle.left = - (org.w3c.css.properties.css.CssBorderLeftStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderLeftStyle(), - style, selector); - } - return cssBorder.borderStyle.left; - } + /** + * Get the border-left-style property + */ + public final org.w3c.css.properties.css.CssBorderLeftStyle getBorderLeftStyle() { + if (cssBorder.borderStyle.left == null) { + cssBorder.borderStyle.left = + (org.w3c.css.properties.css.CssBorderLeftStyle) style.CascadingOrder(new org.w3c.css.properties.css.CssBorderLeftStyle(), + style, selector); + } + return cssBorder.borderStyle.left; + } /** * get the font-stretch property + * * @return a CssFontStretch instance */ public org.w3c.css.properties.css.CssFontStretch getFontStretch() { @@ -147,6 +157,7 @@ /** * get the font-size-adjust property + * * @return a CssFontSizeAdjust instance */ public org.w3c.css.properties.css.CssFontSizeAdjust getFontSizeAdjust() { @@ -159,6 +170,7 @@ /** * Get the text-shadow property + * * @return a CssTextShadow instance */ public final org.w3c.css.properties.css.CssTextShadow getTextShadow() { @@ -288,7 +300,7 @@ } return cssOutline; } - + public final CssCursor getCursor() { if (cssCursor == null) { cssCursor = @@ -296,4 +308,32 @@ } return cssCursor; } + + public final CssMarkerOffset getMarkerOffset() { + if (cssMarkerOffset == null) { + cssMarkerOffset = + (CssMarkerOffset) style.CascadingOrder(new CssMarkerOffset(), + style, selector); + } + return cssMarkerOffset; + } + + /** + * Find conflicts in this Style + * + * @param warnings For warnings reports. + * @param allSelectors All contexts is the entire style sheet. + */ + public void findConflicts(ApplContext ac, Warnings warnings, + CssSelectors selector, CssSelectors[] allSelectors) { + super.findConflicts(ac, warnings, selector, allSelectors); + + if (cssMarkerOffset != null) { + if ((cssDisplay == null) || (!marker.equals(cssDisplay.get()))) { + warnings.addWarning(new Warning(cssMarkerOffset, + "marker", 1, ac)); + } + } + } + }
Received on Friday, 2 November 2012 14:34:31 UTC