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

2002/css-validator/org/w3c/css/properties/css3 CssOverflowWrap.java,NONE,1.1 Css3Style.java,1.44,1.45

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 30 Aug 2012 12:26:48 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1T73pg-00077f-Af@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css3
In directory hutz:/tmp/cvs-serv27306/css3

Modified Files:
	Css3Style.java 
Added Files:
	CssOverflowWrap.java 
Log Message:
overflow-wrap / word-wrap per http://www.w3.org/TR/2012/WD-css3-text-20120814/#overflow-wrap0

Index: Css3Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css3/Css3Style.java,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- Css3Style.java	20 Aug 2012 21:04:39 -0000	1.44
+++ Css3Style.java	30 Aug 2012 12:26:45 -0000	1.45
@@ -39,6 +39,7 @@
 import org.w3c.css.properties.css.CssFontVariantNumeric;
 import org.w3c.css.properties.css.CssFontVariantPosition;
 import org.w3c.css.properties.css.CssOpacity;
+import org.w3c.css.properties.css.CssOverflowWrap;
 import org.w3c.css.util.ApplContext;
 import org.w3c.css.util.Util;
 import org.w3c.css.util.Warning;
@@ -135,6 +136,8 @@
 	public CssFontFeatureSettings cssFontFeatureSettings;
 	public CssFontVariantAlternates cssFontVariantAlternates;
 
+	public CssOverflowWrap cssOverflowWrap;
+
 	CssDropInitialAfterAdjust cssDropInitialAfterAdjust;
 	CssDropInitialAfterAlign cssDropInitialAfterAlign;
 	CssDropInitialBeforeAdjust cssDropInitialBeforeAdjust;
@@ -1390,6 +1393,15 @@
 		return cssFontVariantAlternates;
 	}
 
+	public CssOverflowWrap getOverflowWrap() {
+		if (cssOverflowWrap == null) {
+			cssOverflowWrap =
+					(CssOverflowWrap) style.CascadingOrder(
+							new CssOverflowWrap(), style, selector);
+		}
+		return cssOverflowWrap;
+	}
+
 	///
 
 	public CssTextIndentCSS3 getTextIndentCSS3() {

--- NEW FILE: CssOverflowWrap.java ---
// $Id: CssOverflowWrap.java,v 1.1 2012/08/30 12:26:45 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/WD-css3-text-20120814/#overflow-wrap0
 *
 * Note that word-wrap is also an alias for this.
 */
public class CssOverflowWrap extends org.w3c.css.properties.css.CssOverflowWrap {

	public static final CssIdent normal, break_word;

	static {
		normal = CssIdent.getIdent("normal");
		break_word = CssIdent.getIdent("break-word");
	}

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

	/**
	 * Creates a new CssOverflowWrap
	 *
	 * @param expression The expression for this property
	 * @throws org.w3c.css.util.InvalidParamException
	 *          Expressions are incorrect
	 */
	public CssOverflowWrap(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 if (normal.equals(ident)) {
				value = normal;
			} else if (break_word.equals(ident)) {
				value = break_word;
			} else {
				throw new InvalidParamException("value",
						val.toString(),
						getPropertyName(), ac);
			}
		} else {
			throw new InvalidParamException("value",
					val.toString(),
					getPropertyName(), ac);
		}
		expression.next();

	}

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

}
Received on Thursday, 30 August 2012 12:26:49 UTC

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