This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20277 - Incorrect implementation of CssBackgroundPositionValue.toString()
Summary: Incorrect implementation of CssBackgroundPositionValue.toString()
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: Parser (show other bugs)
Version: CSS Validator
Hardware: All All
: P2 major
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-06 17:19 UTC by Hannes Erven
Modified: 2012-12-13 08:53 UTC (History)
0 users

See Also:


Attachments

Description Hannes Erven 2012-12-06 17:19:59 UTC
The current code swaps the horizonal and vertical offsets in its toString() output.


Here's a patch for the file org/w3c/css/properties/css3/CssBackgroundPosition.java :

Index: CssBackgroundPosition.java
===================================================================
--- CssBackgroundPosition.java	(revision 8290)
+++ CssBackgroundPosition.java	(working copy)
@@ -439,21 +439,22 @@
 
         public String toString() {
             StringBuilder sb = new StringBuilder();
+            if (horizontal != null) {
+                sb.append(horizontal);
+                if (horizontal_offset != null) {
+                    sb.append(' ').append(horizontal_offset);
+                }
+                if (vertical != null) {
+                    sb.append(' ');
+                }
+            }
+
             if (vertical != null) {
                 sb.append(vertical);
                 if (vertical_offset != null) {
                     sb.append(' ').append(vertical_offset);
                 }
-                if (horizontal != null) {
-                    sb.append(' ');
-                }
             }
-            if (horizontal != null) {
-                sb.append(horizontal);
-                if (horizontal_offset != null) {
-                    sb.append(' ').append(horizontal_offset);
-                }
-            }
             return sb.toString();
         }
     }
Comment 1 Yves Lafon 2012-12-13 08:53:47 UTC
Fixed by removing the inner class definition (it was not necessary, and even worse buggy as you pointed out).