W3C home > Mailing lists > Public > www-validator-cvs@w3.org > October 2012

2002/css-validator/org/w3c/css/properties/css3 CssFlexDirection.java,NONE,1.1 Css3Style.java,1.102,1.103 CssDisplay.java,1.3,1.4

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Sun, 07 Oct 2012 12:01:30 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1TKpY2-00021A-Jz@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv7698/css3

Modified Files:
	Css3Style.java CssDisplay.java 
Added Files:
	CssFlexDirection.java 
Log Message:


Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- Css3Style.java	7 Oct 2012 10:41:51 -0000	1.102
+++ Css3Style.java	7 Oct 2012 12:01:28 -0000	1.103
@@ -32,6 +32,7 @@
 import org.w3c.css.properties.css.CssColumnSpan;
 import org.w3c.css.properties.css.CssColumnWidth;
 import org.w3c.css.properties.css.CssColumns;
+import org.w3c.css.properties.css.CssFlexDirection;
 import org.w3c.css.properties.css.CssFontFeatureSettings;
 import org.w3c.css.properties.css.CssFontKerning;
 import org.w3c.css.properties.css.CssFontLanguageOverride;
@@ -154,6 +155,7 @@
 	public CssAlignContent cssAlignContent;
 	public CssAlignItems cssAlignItems;
 	public CssAlignSelf cssAlignSelf;
+	public CssFlexDirection cssFlexDirection;
 	
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
@@ -1158,6 +1160,16 @@
 		}
 		return cssAlignSelf;
 	}
+
+	public CssFlexDirection getFlexDirection() {
+		if (cssFlexDirection == null) {
+			cssFlexDirection =
+					(CssFlexDirection) style.CascadingOrder(
+							new CssFlexDirection(), style, selector);
+		}
+		return cssFlexDirection;
+	}
+	
 	///
 
 	/**

--- NEW FILE: CssFlexDirection.java ---
// $Id: CssFlexDirection.java,v 1.1 2012/10/07 12:01:28 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/#flex-direction
 */
public class CssFlexDirection extends org.w3c.css.properties.css.CssFlexDirection {

	public static final CssIdent[] allowed_values;

	static {
		String[] _allowed_values = {"row" ,"row-reverse" ,"column", "column-reverse"};
		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 CssFlexDirection
	 */
	public CssFlexDirection() {
		value = initial;
	}

	/**
	 * Creates a new CssFlexDirection
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssFlexDirection(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 CssFlexDirection(ApplContext ac, CssExpression expression)
			throws InvalidParamException {
		this(ac, expression, false);
	}

}


Index: CssDisplay.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/CssDisplay.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CssDisplay.java	24 Aug 2012 07:24:39 -0000	1.3
+++ CssDisplay.java	7 Oct 2012 12:01:28 -0000	1.4
@@ -15,6 +15,7 @@
 
 /**
  * @spec http://www.w3.org/TR/2007/WD-css3-box-20070809/#the-lsquo
+ * @spec http://www.w3.org/TR/2012/CR-css3-flexbox-20120918/#flex-containers
  * <p/>
  * TODO do &lt;template&gt; from http://www.w3.org/TR/2010/WD-css3-layout-20100429/#declaring-templates-the-display-property
  */
@@ -31,11 +32,15 @@
 				"table-caption", "ruby", "ruby-base", "ruby-text",
 				"ruby-base-group", "ruby-text-group", "none"
 		};
-		allowed_values = new CssIdent[DISPLAY.length];
+		String[] FLEX_DISPLAY = {"flex", "inline-flex"};
+		allowed_values = new CssIdent[DISPLAY.length+FLEX_DISPLAY.length];
 		int i = 0;
 		for (String aDISPLAY : DISPLAY) {
 			allowed_values[i++] = CssIdent.getIdent(aDISPLAY);
 		}
+		for(String aDISPLAY : FLEX_DISPLAY) {
+			allowed_values[i++] = CssIdent.getIdent(aDISPLAY);
+		}
 	}
 
 	public static CssIdent getMatchingIdent(CssIdent ident) {
Received on Sunday, 7 October 2012 12:01:32 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:52 UTC