- From: Yves Lafon via cvs-syncmail <cvsmail@w3.org>
- Date: Fri, 26 Aug 2005 14:09:52 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/org/w3c/css/properties/css1
In directory hutz:/tmp/cvs-serv31827/org/w3c/css/properties/css1
Modified Files:
Css1Style.java CssBackground.java CssBackgroundCSS1.java
CssBackgroundCSS2.java CssBackgroundColor.java
CssBackgroundPosition.java CssBackgroundPositionCSS1.java
CssBackgroundPositionCSS2.java CssColor.java CssColorCSS1.java
CssColorCSS2.java CssDisplay.java CssFont.java
CssFontCSS1.java CssFontCSS2.java CssFontVariantCSS2.java
Log Message:
All changes made by Jean-Guilhem Rouel:
Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
Errors in font, the handling of 'transparent', CSS Parser reinits...
http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
Index: CssFontCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssFontCSS1.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssFontCSS1.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssFontCSS1.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -43,6 +61,7 @@
import org.w3c.css.util.ApplContext;
import org.w3c.css.util.InvalidParamException;
import org.w3c.css.values.CssExpression;
+import org.w3c.css.values.CssIdent;
import org.w3c.css.values.CssLength;
import org.w3c.css.values.CssOperator;
import org.w3c.css.values.CssPercentage;
@@ -120,6 +139,8 @@
// internal hack for strings comparaison
//private static int[] hash_values;
+ static CssIdent normal = new CssIdent("normal");
+
/**
* Create a new CssFontCSS1
*/
@@ -139,24 +160,32 @@
char op = SPACE;
boolean find = true;
int max_values = 3;
- //int normal = "normal".hashCode();
-
+
+ int normalNb = 0;
+
while (find && max_values-- > 0) {
find = false;
val = expression.getValue();
- op = expression.getOperator();
-
+ op = expression.getOperator();
+
if (val == null) {
throw new InvalidParamException("few-value", getPropertyName(), ac);
- }
+ }
- if (fontStyle == null) {
+ if(val.equals(normal)) {
+ normalNb++;
+ expression.next();
+ find = true;
+ }
+
+ if (!find && fontStyle == null) {
try {
- fontStyle = new CssFontStyleCSS1(ac, expression);
+ fontStyle = new CssFontStyleCSS1(ac, expression);
find = true;
} catch (InvalidParamException e) {
}
}
+
if (!find && fontVariant == null) {
try {
fontVariant = new CssFontVariantCSS1(ac, expression);
@@ -164,55 +193,63 @@
} catch (InvalidParamException e) {
}
}
+
if (!find && fontWeight == null) {
try {
fontWeight = new CssFontWeightCSS1(ac, expression);
find = true;
} catch (InvalidParamException e) {
+ // we have now (or not)
+ // [ 'font-style' || 'font-variant' || 'font-weight' ]?
+ //break;
}
}
+
if (find && op != SPACE) {
throw new InvalidParamException("operator",
((new Character(op)).toString()), ac);
}
-
- }
- /*
- if (fontStyle == null) {
- fontStyle = new CssFontStyleCSS1();
}
- if (fontVariant == null) {
- fontVariant = new CssFontVariantCSS1();
- }
- if (fontWeight == null) {
- fontWeight = new CssFontWeightCSS1();
+
+ // "normal" values
+ CssExpression normalExpr = new CssExpression();
+ normalExpr.addValue(normal);
+
+ for(int i = 0; i < normalNb; i++) {
+ if (fontStyle == null) {
+ fontStyle = new CssFontStyleCSS1(ac, normalExpr);
+ normalExpr.starts();
+ }
+ else if (fontVariant == null) {
+ fontVariant = new CssFontVariantCSS1(ac, normalExpr);
+ normalExpr.starts();
+ }
+ else if (fontWeight == null) {
+ fontWeight = new CssFontWeightCSS1(ac, normalExpr);
+ normalExpr.starts();
+ }
}
- */
+
val = expression.getValue();
- op = expression.getOperator();
-
+ op = expression.getOperator();
if (val == null) {
throw new InvalidParamException("few-value", getPropertyName(), ac);
}
-
+
fontSize = new CssFontSizeCSS1(ac, expression);
if (op == SLASH) {
op = expression.getOperator();
lineHeight = new CssLineHeightCSS1(ac, expression);
}
-// else {
-// lineHeight = new CssLineHeightCSS1();
-// }
-
- if (op == SPACE && expression.getValue() != null) {
+
+ if (op == SPACE && expression.getValue() != null) {
fontFamily = new CssFontFamilyCSS1(ac, expression, true);
} else {
expression.starts();
throw new InvalidParamException("few-value", expression.toString(), ac);
- }
-
+ }
setByUser();
}
Index: CssBackgroundColor.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundColor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundColor.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackgroundColor.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -120,7 +138,8 @@
if (val.equals(inherit)) {
color = inherit;
expression.next();
- } else {
+ }
+ else {
color = new org.w3c.css.values.CssColor(ac, (String) val.get());
expression.next();
}
Index: CssBackgroundCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundCSS1.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundCSS1.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackgroundCSS1.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -184,6 +202,9 @@
((new Character(op)).toString()),
ac);
}
+ if(check && !find && val != null) {
+ throw new InvalidParamException("unrecognize", ac);
+ }
}
/*
if (color == null)
Index: CssDisplay.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssDisplay.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssDisplay.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssDisplay.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -7,6 +7,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -69,10 +87,10 @@
int value;
private static String[] DISPLAY = {
- "none", "block", "inline", "list-item", "run-in", "compact", "table-row",
- "table-cell", "table-row-group", "table-header-group", "table-footer-group",
- "table-column", "table-column-group", "table-caption", "ruby-text", "ruby-base",
- "ruby-base-group", "ruby-text-group", "initial", "inherit", "inline-block", "icon"
+ "none", "block", "inline", "list-item", "run-in", "compact", "table", "table-row",
+ "table-cell", "table-row-group", "table-header-group", "table-footer-group",
+ "table-column", "table-column-group", "table-caption", "ruby-text", "ruby-base",
+ "ruby-base-group", "ruby-text-group", "initial", "inherit", "inline-block", "icon"
};
private static int[] hash_values;
Index: CssBackground.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackground.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackground.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackground.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -220,10 +238,13 @@
//}
}
}
+ if(check && !find && val != null) {
+ throw new InvalidParamException("unrecognize", ac);
+ }
}
}
-
+
/**
* Returns the value of this property
*/
Index: CssFontVariantCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssFontVariantCSS2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssFontVariantCSS2.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssFontVariantCSS2.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -185,7 +203,7 @@
*
* @param style The CssStyle
*/
- public void addToStyle(ApplContext ac, CssStyle style) {
+ public void addToStyle(ApplContext ac, CssStyle style) {
CssFontCSS2 cssFont = ((Css1Style) style).cssFontCSS2;
if (cssFont.fontVariant != null)
style.addRedefinitionWarning(ac, this);
Index: CssFontCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssFontCSS2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssFontCSS2.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssFontCSS2.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -121,6 +139,8 @@
// internal hack for strings comparaison
private static int[] hash_values;
+ static CssIdent normal = new CssIdent("normal");
+
/**
* Create a new CssFont
*/
@@ -140,7 +160,8 @@
char op = SPACE;
boolean find = true;
int max_values = 3;
- //int normal = "normal".hashCode();
+
+ int normalNb = 0;
if (val instanceof CssIdent) {
CssIdent ident = checkIdent((CssIdent) val);
@@ -158,7 +179,7 @@
find = false;
val = expression.getValue();
op = expression.getOperator();
-
+
if (val == null) {
throw new InvalidParamException("few-value", getPropertyName(), ac);
}
@@ -167,13 +188,20 @@
throw new InvalidParamException("unrecognize", ac);
}
- if (fontStyle == null) {
+ if(val.equals(normal)) {
+ normalNb++;
+ expression.next();
+ find = true;
+ }
+
+ if (!find && fontStyle == null) {
try {
fontStyle = new CssFontStyleCSS2(ac, expression);
find = true;
} catch (InvalidParamException e) {
}
}
+
if (!find && fontVariant == null) {
try {
fontVariant = new CssFontVariantCSS2(ac, expression);
@@ -181,6 +209,7 @@
} catch (InvalidParamException e) {
}
}
+
if (!find && fontWeight == null) {
try {
fontWeight = new CssFontWeightCSS2(ac, expression);
@@ -188,25 +217,35 @@
} catch (InvalidParamException e) {
// we have now (or not)
// [ 'font-style' || 'font-variant' || 'font-weight' ]?
- break;
+ //break;
}
}
+
if (find && op != SPACE) {
throw new InvalidParamException("operator",
((new Character(op)).toString()), ac);
- }
- }
- /*
- if (fontStyle == null) {
- fontStyle = new CssFontStyleCSS2();
- }
- if (fontVariant == null) {
- fontVariant = new CssFontVariantCSS2();
+ }
}
- if (fontWeight == null) {
- fontWeight = new CssFontWeightCSS2();
+
+ // "normal" values
+ CssExpression normalExpr = new CssExpression();
+ normalExpr.addValue(normal);
+
+ for(int i = 0; i < normalNb; i++) {
+ if (fontStyle == null) {
+ fontStyle = new CssFontStyleCSS2(ac, normalExpr);
+ normalExpr.starts();
+ }
+ else if (fontVariant == null) {
+ fontVariant = new CssFontVariantCSS2(ac, normalExpr);
+ normalExpr.starts();
+ }
+ else if (fontWeight == null) {
+ fontWeight = new CssFontWeightCSS2(ac, normalExpr);
+ normalExpr.starts();
+ }
}
- */
+
val = expression.getValue();
op = expression.getOperator();
@@ -219,14 +258,14 @@
}
fontSize = new CssFontSizeCSS2(ac, expression);
-
+
if (op == SLASH) {
op = expression.getOperator();
+ if(expression.getValue().equals(inherit)) {
+ throw new InvalidParamException("unrecognize", ac);
+ }
lineHeight = new CssLineHeightCSS2(ac, expression);
}
-// else {
-// lineHeight = new CssLineHeightCSS2();
-// }
if(expression.getValue().equals(inherit)) {
throw new InvalidParamException("unrecognize", ac);
Index: CssFont.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssFont.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssFont.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssFont.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -121,6 +139,8 @@
// internal hack for strings comparaison
private static int[] hash_values;
+ static CssIdent normal = new CssIdent("normal");
+
/**
* Create a new CssFont
*/
@@ -140,13 +160,13 @@
char op = SPACE;
boolean find = true;
int max_values = 3;
- //int normal = "normal".hashCode();
- boolean manyValues = expression.getCount() > 1;
+ int normalNb = 0;
+
if (val instanceof CssIdent) {
CssIdent ident = checkIdent((CssIdent) val);
if (ident != null) {
- if(manyValues) {
+ if(expression.getCount() > 1) {
throw new InvalidParamException("unrecognize", ac);
}
value = ident;
@@ -158,23 +178,30 @@
while (find && max_values-- > 0) {
find = false;
val = expression.getValue();
- op = expression.getOperator();
-
+ op = expression.getOperator();
+
if (val == null) {
throw new InvalidParamException("few-value", getPropertyName(), ac);
}
- if(manyValues && val.equals(inherit)) {
+ if(val.equals(inherit)) {
throw new InvalidParamException("unrecognize", ac);
}
- if (fontStyle == null) {
+ if(val.equals(normal)) {
+ normalNb++;
+ expression.next();
+ find = true;
+ }
+
+ if (!find && fontStyle == null) {
try {
- fontStyle = new CssFontStyle(ac, expression);
+ fontStyle = new CssFontStyle(ac, expression);
find = true;
} catch (InvalidParamException e) {
}
}
+
if (!find && fontVariant == null) {
try {
fontVariant = new CssFontVariant(ac, expression);
@@ -182,63 +209,74 @@
} catch (InvalidParamException e) {
}
}
+
if (!find && fontWeight == null) {
try {
fontWeight = new CssFontWeight(ac, expression);
find = true;
} catch (InvalidParamException e) {
+ // we have now (or not)
+ // [ 'font-style' || 'font-variant' || 'font-weight' ]?
+ //break;
}
}
+
if (find && op != SPACE) {
throw new InvalidParamException("operator",
((new Character(op)).toString()), ac);
}
-
- }
- /*
- if (fontStyle == null) {
- fontStyle = new CssFontStyle();
}
- if (fontVariant == null) {
- fontVariant = new CssFontVariant();
- }
- if (fontWeight == null) {
- fontWeight = new CssFontWeight();
+
+ // "normal" values
+ CssExpression normalExpr = new CssExpression();
+ normalExpr.addValue(normal);
+
+ for(int i = 0; i < normalNb; i++) {
+ if (fontStyle == null) {
+ fontStyle = new CssFontStyle(ac, normalExpr);
+ normalExpr.starts();
+ }
+ else if (fontVariant == null) {
+ fontVariant = new CssFontVariant(ac, normalExpr);
+ normalExpr.starts();
+ }
+ else if (fontWeight == null) {
+ fontWeight = new CssFontWeight(ac, normalExpr);
+ normalExpr.starts();
+ }
}
- */
+
val = expression.getValue();
- op = expression.getOperator();
-
+ op = expression.getOperator();
if (val == null) {
throw new InvalidParamException("few-value", getPropertyName(), ac);
}
- if(manyValues && val.equals(inherit)) {
+ if(val.equals(inherit)) {
throw new InvalidParamException("unrecognize", ac);
}
-
+
fontSize = new CssFontSize(ac, expression);
if (op == SLASH) {
op = expression.getOperator();
+ if(expression.getValue().equals(inherit)) {
+ throw new InvalidParamException("unrecognize", ac);
+ }
lineHeight = new CssLineHeight(ac, expression);
- }
-// else {
-// lineHeight = new CssLineHeight();
-// }
+ }
- if(manyValues && val.equals(inherit)) {
+ if(expression.getValue().equals(inherit)) {
throw new InvalidParamException("unrecognize", ac);
}
-
- if (op == SPACE && expression.getValue() != null) {
+
+ if (op == SPACE && expression.getValue() != null) {
fontFamily = new CssFontFamily(ac, expression, true);
} else {
expression.starts();
throw new InvalidParamException("few-value", expression.toString(), ac);
- }
-
+ }
setByUser();
}
Index: CssColorCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssColorCSS2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssColorCSS2.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssColorCSS2.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -173,7 +191,9 @@
* Returns a string representation of the object.
*/
public String toString() {
- return color.toString();
+ if(color != null)
+ return color.toString();
+ return "";
}
/**
@@ -185,7 +205,7 @@
Css1Style style0 = (Css1Style) style;
if (style0.cssColorCSS2 != null) {
style0.addRedefinitionWarning(ac, this);
- }
+ }
style0.cssColorCSS2 = this;
}
Index: CssBackgroundPosition.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundPosition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundPosition.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackgroundPosition.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -196,9 +214,15 @@
if(val instanceof CssIdent) {
int index1 = IndexOfIdent((String) val.get());
+ if(index1 == -1) {
+ throw new InvalidParamException("value", val, "background-position", ac);
+ }
// two keywords
if(next instanceof CssIdent) {
int index2 = IndexOfIdent((String) next.get());
+ if(index2 == -1) {
+ throw new InvalidParamException("value", next, "background-position", ac);
+ }
// one is vertical, the other is vertical
// or the two are 'center'
if((isHorizontal(index1) && isVertical(index2)) ||
@@ -253,6 +277,9 @@
// a percentage/length and an keyword
if(next instanceof CssIdent) {
int index = IndexOfIdent((String) next.get());
+ if(index == -1) {
+ throw new InvalidParamException("value", val, "background-position", ac);
+ }
// the keyword must be a vertical one
if(isVertical(index)) {
first = val;
Index: Css1Style.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/Css1Style.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Css1Style.java 23 Aug 2005 16:23:12 -0000 1.1
+++ Css1Style.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
[...2785 lines suppressed...]
-
+
}
class RelativeAndAbsolute {
@@ -2798,12 +2816,12 @@
} else if (value instanceof CssLength) {
CssLength length = (CssLength) value;
if (!length.getUnit().equals("ex")
- || !length.getUnit().equals("em")) {
+ || !length.getUnit().equals("em")) {
absolute |= true;
} else {
relative |= true;
}
}
}
-
+
}
Index: CssBackgroundPositionCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundPositionCSS1.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundPositionCSS1.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackgroundPositionCSS1.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -196,9 +214,15 @@
if(val instanceof CssIdent) {
int index1 = IndexOfIdent((String) val.get());
+ if(index1 == -1) {
+ throw new InvalidParamException("value", val, "background-position", ac);
+ }
// two keywords
if(next instanceof CssIdent) {
int index2 = IndexOfIdent((String) next.get());
+ if(index2 == -1) {
+ throw new InvalidParamException("value", next, "background-position", ac);
+ }
// one is vertical, the other is vertical
// or the two are 'center'
if((isHorizontal(index1) && isVertical(index2)) ||
@@ -216,17 +240,14 @@
}
}
// only one value
- else if(next == null) {
+ else if(!check || next == null) {
first = val;
}
// the second value is invalid
- else if(check) {
+ else {
throw new InvalidParamException("value", next,
getPropertyName(), ac);
}
- else {
- first = val;
- }
}
else if(val instanceof CssLength || val instanceof CssPercentage
|| val instanceof CssNumber) {
Index: CssColor.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssColor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssColor.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssColor.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -64,10 +64,12 @@
CssValue val = expression.getValue();
setByUser();
+
if (val.equals(inherit)) {
color = inherit;
expression.next();
- } else if (val instanceof org.w3c.css.values.CssColor) {
+ }
+ else if (val instanceof org.w3c.css.values.CssColor) {
color = val;
expression.next();
} else if (val instanceof CssFunction) {
@@ -216,7 +218,7 @@
params.getValue(),
getPropertyName(), ac);
}
- } else if (val instanceof CssIdent) {
+ } else if (val instanceof CssIdent) {
if ("css1".equals(ac.getCssVersion())) {
color = new org.w3c.css.values.CssColorCSS1(ac, (String) val.get());
} else if ("css2".equals(ac.getCssVersion())) {
@@ -228,7 +230,7 @@
}
// color = new org.w3c.css.values.CssColor();
expression.next();
- } else {
+ } else {
throw new InvalidParamException("value", expression.getValue(),
getPropertyName(), ac);
}
Index: CssColorCSS1.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssColorCSS1.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssColorCSS1.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssColorCSS1.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -168,7 +186,9 @@
* Returns a string representation of the object.
*/
public String toString() {
- return color.toString();
+ if(color != null)
+ return color.toString();
+ return "";
}
/**
Index: CssBackgroundCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundCSS2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundCSS2.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackgroundCSS2.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -195,6 +213,9 @@
((new Character(op)).toString()),
ac);
}
+ if(check && !find && val != null) {
+ throw new InvalidParamException("unrecognize", ac);
+ }
}
/*
if (color == null)
Index: CssBackgroundPositionCSS2.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/properties/css1/CssBackgroundPositionCSS2.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- CssBackgroundPositionCSS2.java 23 Aug 2005 16:23:12 -0000 1.1
+++ CssBackgroundPositionCSS2.java 26 Aug 2005 14:09:49 -0000 1.2
@@ -6,6 +6,24 @@
// Please first read the full copyright statement in file COPYRIGHT.html
/*
* $Log$
+ * Revision 1.2 2005/08/26 14:09:49 ylafon
+ * All changes made by Jean-Guilhem Rouel:
+ *
+ * Fix for bugs: 1269, 979, 791, 777, 776, 767, 765, 763, 576, 363
+ *
+ * Errors in font, the handling of 'transparent', CSS Parser reinits...
+ *
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=1269
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=979
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=791
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=777
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=776
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=767
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=765
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=763
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=576
+ * http://www.w3.org/Bugs/Public/show_bug.cgi?id=363
+ *
* Revision 1.1 2005/08/23 16:23:12 ylafon
* Patch by Jean-Guilhem Rouel
*
@@ -194,11 +212,17 @@
CssValue next = expression.getNextValue();
- if(val instanceof CssIdent) {
+ if(val instanceof CssIdent) {
int index1 = IndexOfIdent((String) val.get());
+ if(index1 == -1) {
+ throw new InvalidParamException("value", val, "background-position", ac);
+ }
// two keywords
- if(next instanceof CssIdent) {
+ if(next instanceof CssIdent) {
int index2 = IndexOfIdent((String) next.get());
+ if(index2 == -1) {
+ throw new InvalidParamException("value", next, "background-position", ac);
+ }
// one is vertical, the other is vertical
// or the two are 'center'
if((isHorizontal(index1) && isVertical(index2)) ||
@@ -253,6 +277,9 @@
// a percentage/length and an keyword
if(next instanceof CssIdent) {
int index = IndexOfIdent((String) next.get());
+ if(index == -1) {
+ throw new InvalidParamException("value", next, "background-position", ac);
+ }
// the keyword must be a vertical one
if(isVertical(index)) {
first = val;
@@ -504,12 +531,11 @@
return first.equals(DefaultValue0) && second.equals(DefaultValue0);
}
- private int IndexOfIdent(String ident) throws InvalidParamException {
+ private int IndexOfIdent(String ident) {
int hash = ident.hashCode();
for (int i = 0; i < POSITION.length; i++)
if (hash_values[i] == hash)
return i;
-
return -1;
}
Received on Friday, 26 August 2005 14:10:13 UTC