2002/css-validator/org/w3c/css/properties/css3 CssJustifyContent.java,NONE,1.1 Css3Style.java,1.105,1.106

Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv20362/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssJustifyContent.java 
Log Message:
justify-content per http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/#justify-content

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- Css3Style.java	7 Oct 2012 12:49:05 -0000	1.105
+++ Css3Style.java	7 Oct 2012 12:59:37 -0000	1.106
@@ -47,6 +47,7 @@
 import org.w3c.css.properties.css.CssFontVariantPosition;
 import org.w3c.css.properties.css.CssHangingPunctuation;
 import org.w3c.css.properties.css.CssHyphens;
+import org.w3c.css.properties.css.CssJustifyContent;
 import org.w3c.css.properties.css.CssLineBreak;
 import org.w3c.css.properties.css.CssMarqueeDirection;
 import org.w3c.css.properties.css.CssMarqueePlayCount;
@@ -160,6 +161,7 @@
 	public CssFlexDirection cssFlexDirection;
 	public CssFlexWrap cssFlexWrap;
 	public CssFlexFlow cssFlexFlow;
+	public CssJustifyContent cssJustifyContent;
 	
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1191,6 +1193,16 @@
 		}
 		return cssFlexFlow;
 	}
+
+	public CssJustifyContent getJustifyContent() {
+		if (cssJustifyContent == null) {
+			cssJustifyContent =
+					(CssJustifyContent) style.CascadingOrder(
+							new CssJustifyContent(), style, selector);
+		}
+		return cssJustifyContent;
+	}
+	
 	///
 
 	/**

--- NEW FILE: CssJustifyContent.java ---
// $Id: CssJustifyContent.java,v 1.1 2012/10/07 12:59:37 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.css3;

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/2012/CR-css3-flexbox-20120918/#justify-content
 */
public class CssJustifyContent extends org.w3c.css.properties.css.CssJustifyContent {

	public static final CssIdent[] allowed_values;

	static {
		String[] _allowed_values = {"flex-start", "flex-end", "center",
				"space-between", "space-around"};
		allowed_values = new CssIdent[_allowed_values.length];
		int i = 0;
		for (String s : _allowed_values) {
			allowed_values[i++] = CssIdent.getIdent(s);
		}
	}

	public static CssIdent getAllowedIdent(CssIdent ident) {
		for (CssIdent id : allowed_values) {
			if (id.equals(ident)) {
				return id;
			}
		}
		return null;
	}

	/**
	 * Create a new CssJustifyContent
	 */
	public CssJustifyContent() {
		value = initial;
	}

	/**
	 * Creates a new CssJustifyContent
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssJustifyContent(ApplContext ac, CssExpression expression, boolean check)
			throws InvalidParamException {
		if (check && expression.getCount() > 1) {
			throw new InvalidParamException("unrecognize", ac);
		}
		setByUser();

		CssValue val;
		char op;

		val = expression.getValue();
		op = expression.getOperator();

		if (val.getType() == CssTypes.CSS_IDENT) {
			CssIdent ident = (CssIdent) val;
			if (inherit.equals(ident)) {
				value = inherit;
			} else {
				value = getAllowedIdent(ident);
				if (value == null) {
					throw new InvalidParamException("value",
							val.toString(),
							getPropertyName(), ac);
				}
			}
		} else {
			throw new InvalidParamException("value",
					val.toString(),
					getPropertyName(), ac);
		}
		expression.next();

	}

	public CssJustifyContent(ApplContext ac, CssExpression expression)
			throws InvalidParamException {
		this(ac, expression, false);
	}

}

Received on Sunday, 7 October 2012 12:59:41 UTC