- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 05 Jan 2010 19:49:53 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/values In directory hutz:/tmp/cvs-serv14290/org/w3c/css/values Modified Files: CssColor.java CssColorCSS1.java CssColorCSS21.java Log Message: fix for background-attachment inheritance + background-color CSS3 + starting wrk on background + encoding of some files Index: CssColorCSS21.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssColorCSS21.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- CssColorCSS21.java 5 Jan 2010 13:50:00 -0000 1.6 +++ CssColorCSS21.java 5 Jan 2010 19:49:51 -0000 1.7 @@ -7,6 +7,9 @@ import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; +import static org.w3c.css.values.CssColorConstants.SYSTEMCOLORS; +import static org.w3c.css.values.CssColorConstants.COLORNAME_CSS21; + /** * CssColorCSS21<br /> * Created: Aug 30, 2005 1:53:59 PM<br /> @@ -17,55 +20,54 @@ private static int[] tableSystemColorHash; static { - // We create the two table containing hashvalues of each color - tableColorHash = new int[COLORNAME_CSS21.length]; - for (int i = 0; i < COLORNAME_CSS21.length; i++) { - tableColorHash[i] = COLORNAME_CSS21[i].toLowerCase().hashCode(); - } + // We create the two table containing hashvalues of each color + tableColorHash = new int[COLORNAME_CSS21.length]; + for (int i = 0; i < COLORNAME_CSS21.length; i++) { + tableColorHash[i] = COLORNAME_CSS21[i].toLowerCase().hashCode(); + } - tableSystemColorHash = new int[SYSTEMCOLORS.length]; - for (int i = 0; i < tableSystemColorHash.length; i++) { - tableSystemColorHash[i] = SYSTEMCOLORS[i].toLowerCase().hashCode(); - } + tableSystemColorHash = new int[SYSTEMCOLORS.length]; + for (int i = 0; i < tableSystemColorHash.length; i++) { + tableSystemColorHash[i] = SYSTEMCOLORS[i].toLowerCase().hashCode(); + } } public CssColorCSS21(ApplContext ac, String s) - throws InvalidParamException - { - setIdentColor(s, ac); + throws InvalidParamException { + setIdentColor(s, ac); } /** * Parse an ident color. */ private void setIdentColor(String s, ApplContext ac) - throws InvalidParamException { - String lower_s = s.toLowerCase(); - int hash = lower_s.hashCode(); + throws InvalidParamException { + String lower_s = s.toLowerCase(); + int hash = lower_s.hashCode(); - int indexOfColor = searchColor(hash, tableColorHash); + int indexOfColor = searchColor(hash, tableColorHash); - if (indexOfColor != -1) { - computeIdentColor(definedColors, COLORNAME_CSS21[indexOfColor]); - } else { - // the color has not been found, search it the system colors - indexOfColor = searchColor(hash, tableSystemColorHash); - if(indexOfColor != -1) { - computeIdentColor(definedColors, SYSTEMCOLORS[indexOfColor]); - } else { - // the color does not exist in this profile, this is an error - throw new InvalidParamException("value", s, "color", ac); - } - } + if (indexOfColor != -1) { + computeIdentColor(definedColors, COLORNAME_CSS21[indexOfColor]); + } else { + // the color has not been found, search it the system colors + indexOfColor = searchColor(hash, tableSystemColorHash); + if (indexOfColor != -1) { + computeIdentColor(definedColors, SYSTEMCOLORS[indexOfColor]); + } else { + // the color does not exist in this profile, this is an error + throw new InvalidParamException("value", s, "color", ac); + } + } } private int searchColor(int colorHash, int[] tableColorHash) { - for (int i =0; i < tableColorHash.length; i++) { - if (tableColorHash[i] == colorHash) { - return i; - } - } - return -1; + for (int i = 0; i < tableColorHash.length; i++) { + if (tableColorHash[i] == colorHash) { + return i; + } + } + return -1; } } Index: CssColorCSS1.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssColorCSS1.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- CssColorCSS1.java 5 Jan 2010 13:50:00 -0000 1.14 +++ CssColorCSS1.java 5 Jan 2010 19:49:51 -0000 1.15 @@ -160,7 +160,7 @@ */ public class CssColorCSS1 extends CssColor { - static HashMap<String,Object> definedColorsCSS1; + private static HashMap<String,Object> definedColorsCSS1; /** * Create a new CssColorCSS1 Index: CssColor.java =================================================================== RCS file: /sources/public/2002/css-validator/org/w3c/css/values/CssColor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- CssColor.java 5 Jan 2010 13:50:00 -0000 1.19 +++ CssColor.java 5 Jan 2010 19:49:51 -0000 1.20 @@ -7,223 +7,224 @@ package org.w3c.css.values; -import java.util.HashMap; -import java.util.Vector; - import org.w3c.css.util.ApplContext; import org.w3c.css.util.InvalidParamException; import org.w3c.css.util.Util; +import java.util.HashMap; [...1991 lines suppressed...] + /* + definedColors.put("ActiveHyperlink", "ActiveHyperlink"); + definedColors.put("ActiveHyperlinkText", "ActiveHyperlinkText"); + definedColors.put("HoverHyperlink", "HoverHyperlink"); + definedColors.put("HoverHyperlinkText", "HoverHyperlinkText"); + definedColors.put("Hyperlink", "Hyperlink"); + definedColors.put("HyperlinkText", "HyperlinkText"); + definedColors.put("VisitedHyperlink", "VisitedHyperlink"); + definedColors.put("VisitedHyperlinkText", "VisitedHyperlinkText"); + */ - //Flavor system color - definedColors.put("flavor","flavor"); - definedColors.put("currentcolor","currentColor"); + //Flavor system color + definedColors.put("flavor", "flavor"); + definedColors.put("currentcolor", "currentColor"); }
Received on Tuesday, 5 January 2010 19:49:54 UTC