2002/css-validator/org/w3c/css/parser/analyzer CssParser.java,1.21,1.22

Update of /sources/public/2002/css-validator/org/w3c/css/parser/analyzer
In directory hutz:/tmp/cvs-serv3187

Modified Files:
	CssParser.java 
Log Message:
Patch http://www.w3.org/Bugs/Public/attachment.cgi?id=463
by Peter Zhelezniakov
for Bug http://www.w3.org/Bugs/Public/show_bug.cgi?id=3627



Index: CssParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/parser/analyzer/CssParser.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- CssParser.java	26 Apr 2006 12:44:15 -0000	1.21
+++ CssParser.java	24 Apr 2007 10:26:26 -0000	1.22
@@ -3277,18 +3277,19 @@
                 case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
                 case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
                     int numValue = Character.digit(c, 16);
-                    int count = 0;
+                    int count = 1;
                     int p = 16;
-
-                    while (index + 1 < len && count < 6) {
+                    int maxCount = (ac.getCssVersion().equals("css1") ? 4 : 6);
+                        
+                    while (index + 1 < len) {
                         c = s.charAt(index+1);
 
-                        if (Character.digit(c, 16) != -1) {
+                        if (Character.digit(c, 16) != -1 && count++ < maxCount) {
                             numValue = (numValue * 16) + Character.digit(c, 16);
                             p *= 16;
                             index++;
                         } else {
-                            if (c == ' ') {
+                            if (c == ' ' || c == '\t') {
                                 // skip the latest white space
                                 index++;
                             }

Received on Tuesday, 24 April 2007 10:26:33 UTC