W3C home > Mailing lists > Public > www-validator-cvs@w3.org > January 2010

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

From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
Date: Thu, 07 Jan 2010 20:31:04 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1NSz0a-0008Na-Tr@lionel-hutz.w3.org>
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css
In directory hutz:/tmp/cvs-serv32186/css

Modified Files:
	CssBackgroundPosition.java 
Log Message:
bug fix for bg-position...

Index: CssBackgroundPosition.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css/CssBackgroundPosition.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- CssBackgroundPosition.java	7 Jan 2010 20:21:37 -0000	1.4
+++ CssBackgroundPosition.java	7 Jan 2010 20:31:02 -0000	1.5
@@ -27,7 +27,7 @@
 
 /**
  * http://www.w3.org/TR/2009/CR-css3-background-20091217/#background-position
- * 
+ * <p/>
  * Name: 	background-position
  * Value: 	&lt;bg-position&gt; [ , &lt;bg-position&gt; ]*
  * Initial: 	0% 0%
@@ -250,8 +250,7 @@
     }
 
     public void check(CssBackgroundPositionValue v, ApplContext ac)
-            throws InvalidParamException
-    {
+            throws InvalidParamException {
         int nb_keyword = 0;
         int nb_percentage = 0;
         int nb_length = 0;
@@ -430,9 +429,9 @@
                                         aValue, propertyName, ac);
                             }
                             if (id2 == null) {
-                                off2 = aValue;
-                            } else {
                                 off1 = aValue;
+                            } else {
+                                off2 = aValue;
                             }
                             got_ident = false;
                             break;
@@ -445,10 +444,10 @@
                 // //keyword
                 if (isVertical(id1) || isHorizontal(id2)) {
                     // if an offset is present and value is 'center'
-                    if ( ((off1 != null) && !isVertical(id1)) ||
-                         ((off2 != null) && !isHorizontal(id2) )) {
-                        throw  new InvalidParamException("incompatible",
-                                            id1, id2, ac);
+                    if (((off1 != null) && !isVertical(id1)) ||
+                            ((off2 != null) && !isHorizontal(id2))) {
+                        throw new InvalidParamException("incompatible",
+                                id1, id2, ac);
                     }
                     v.horizontal = id2;
                     v.val_horizontal = identToPercent(id2);
@@ -457,10 +456,10 @@
                     v.val_vertical = identToPercent(id1);
                     v.vertical_offset = off1;
                 } else {
-                    if ( ((off2 != null) && !isVertical(id2)) ||
-                         ((off1 != null) && !isHorizontal(id1) )) {
-                        throw  new InvalidParamException("incompatible",
-                                            id1, id2, ac);
+                    if (((off2 != null) && !isVertical(id2)) ||
+                            ((off1 != null) && !isHorizontal(id1))) {
+                        throw new InvalidParamException("incompatible",
+                                id1, id2, ac);
                     }
                     v.horizontal = id1;
                     v.val_horizontal = identToPercent(id1);
@@ -492,6 +491,7 @@
     }
 
     // placeholder for the different values
+
     public class CssBackgroundPositionValue extends CssValueList {
         public CssValue vertical = null;
         public CssValue horizontal = null;
Received on Thursday, 7 January 2010 20:31:06 UTC

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