- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Sat, 09 Jan 2010 10:36:49 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/values
In directory hutz:/tmp/cvs-serv14741/values
Modified Files:
CssExpression.java
Log Message:
added mark/reset to navigate in the CssExpression, modified parsing of background-position in CSS3 background
Index: CssExpression.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssExpression.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- CssExpression.java 5 Jan 2010 13:50:00 -0000 1.9
+++ CssExpression.java 9 Jan 2010 10:36:47 -0000 1.10
@@ -18,6 +18,28 @@
private ArrayList<ValueOperator> items = new ArrayList<ValueOperator>();
private int count = 0;
private int index = 0;
+ private int mark = -1;
+
+
+ /**
+ * mark the current position, it can be set to this
+ * position later by using reset
+ */
+ public void mark() {
+ mark = index;
+ }
+
+ /**
+ * reset to the marked location
+ * of the start if nothing has been marked.
+ */
+ public void reset() {
+ if (mark >= 0) {
+ index = mark;
+ } else {
+ index = 0;
+ }
+ }
/**
* Add a value to the end of the expression
@@ -185,7 +207,7 @@
*/
public String toStringFromStart() {
StringBuilder sb = new StringBuilder();
- for ( ValueOperator anItem : items) {
+ for (ValueOperator anItem : items) {
sb.append(anItem.value.toString()).append(anItem.operator);
}
return sb.toString();
Received on Saturday, 9 January 2010 10:36:51 UTC