W3C home > Mailing lists > Public > www-validator-cvs@w3.org > December 2009

2002/css-validator/org/w3c/css/properties/css21 CssBackgroundCSS21.java,1.4,1.5

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 10 Dec 2009 14:34:40 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1NIk6K-0004e8-Hp@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css21
In directory hutz:/tmp/cvs-serv17840

Modified Files:
	CssBackgroundCSS21.java 
Log Message:
better fix for background parsing bug expressed earlier.


Index: CssBackgroundCSS21.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css21/CssBackgroundCSS21.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBackgroundCSS21.java	25 Mar 2008 18:43:10 -0000	1.4
+++ CssBackgroundCSS21.java	10 Dec 2009 14:34:38 -0000	1.5
@@ -42,6 +42,7 @@
 	CssValue val;
 	char op = SPACE;
 	boolean find = true;
+	CssExpression background_position_expression = null;
 
 	// too many values
 	if(check && expression.getCount() > 6) {
@@ -88,11 +89,12 @@
 	    case CssTypes.CSS_NUMBER:
 	    case CssTypes.CSS_PERCENTAGE:
 	    case CssTypes.CSS_LENGTH:
-		if (getPosition() == null) {
-		    setPosition(new CssBackgroundPositionCSS21(ac,expression));
-		    continue;
+		if (background_position_expression == null) {
+		    background_position_expression = new CssExpression();
 		}
-		find = false;
+		background_position_expression.addValue(val);
+		expression.next();
+		find = true;
 		break;
 	    case CssTypes.CSS_IDENT:
 		// the hard part, as ident can be from different subproperties
@@ -117,17 +119,20 @@
 		// check background-attachment ident
 		if (CssBackgroundAttachmentCSS2.checkMatchingIdent(identval)) {
 		    if (getAttachment() == null) {
-			setAttachment(new CssBackgroundAttachmentCSS2(ac, expression));
+			setAttachment(new CssBackgroundAttachmentCSS2(ac, 
+								   expression));
 			find = true;
 		    }
 		    break;
 		}		
 		// check backgorund-position ident
 		if (CssBackgroundPositionCSS21.checkMatchingIdent(identval)) {
-		    if (getPosition() == null) {
-			setPosition(new CssBackgroundPositionCSS21(ac, expression));
-			find = true;
+		    if (background_position_expression == null) {
+			background_position_expression = new CssExpression();
 		    }
+		    background_position_expression.addValue(val);
+		    expression.next();
+		    find = true;
 		    break;
 		}
 
@@ -156,6 +161,11 @@
 						ac);
 	    }
 	}
+	if (background_position_expression != null) {
+	    setPosition(new CssBackgroundPositionCSS21(ac,
+					        background_position_expression, 
+						       check));
+	}
     }
 
     public CssBackgroundCSS21(ApplContext ac, CssExpression expression)
Received on Thursday, 10 December 2009 14:34:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 26 April 2012 12:55:16 GMT