2002/css-validator/org/w3c/css/css StyleSheetParser.java,1.21,1.22 TagSoupStyleSheetHandler.java,1.8,1.9 XMLStyleSheetHandler.java,1.31,1.32

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

Modified Files:
	StyleSheetParser.java TagSoupStyleSheetHandler.java 
	XMLStyleSheetHandler.java 
Log Message:
more media check for CSS1, check media set in CSS, not in teh default interface

Index: StyleSheetParser.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/StyleSheetParser.java,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- StyleSheetParser.java	21 Oct 2011 14:14:41 -0000	1.21
+++ StyleSheetParser.java	23 Oct 2011 19:47:21 -0000	1.22
@@ -202,15 +202,19 @@
             //	    cssFouffa.setDefaultMedium(defaultmedium);
             //	    cssFouffa.doConfig();
             if (media == null) {
-                if (ac.getMedium() == null) {
-                    media = "all";
-                } else {
-                    media = ac.getMedium();
+                if (ac.getCssVersion() != CssVersion.CSS1) {
+                    if (ac.getMedium() == null) {
+                        media = "all";
+                    } else {
+                        media = ac.getMedium();
+                    }
                 }
             }
             AtRuleMedia m = AtRuleMedia.getInstance(ac.getCssVersion());
             try {
-                addMedias(m, media, ac);
+                if (media != null) {
+                    addMedias(m, media, ac);
+                }
                 cssFouffa.setAtRule(m);
             } catch (org.w3c.css.util.InvalidParamException e) {
                 Errors er = new Errors();
@@ -278,14 +282,13 @@
             //	    cssFouffa.setResponse(res);
             //	    cssFouffa.setDefaultMedium(defaultmedium);
             //	    cssFouffa.doConfig();
-
-            if (media == null) {
+            if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                 media = "all";
             }
 
             AtRuleMedia m = AtRuleMedia.getInstance(ac.getCssVersion());
             try {
-                if (ac.getCssVersion().compareTo(CssVersion.CSS1) > 0) {
+                if (media != null) {
                     addMedias(m, media, ac);
                 }
                 cssFouffa.setAtRule(m);
@@ -372,7 +375,9 @@
 
             try {
                 AtRuleMedia media = AtRuleMedia.getInstance(ac.getCssVersion());
-                media.addMedia(null, "all", ac);
+                if (ac.getCssVersion() != CssVersion.CSS1) {
+                    media.addMedia(null, "all", ac);
+                }
                 cssFouffa.setAtRule(media);
             } catch (InvalidParamException e) {
             } //ignore

Index: XMLStyleSheetHandler.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/XMLStyleSheetHandler.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- XMLStyleSheetHandler.java	29 Aug 2011 07:21:00 -0000	1.31
+++ XMLStyleSheetHandler.java	23 Oct 2011 19:47:21 -0000	1.32
@@ -16,6 +16,7 @@
 import org.w3c.css.parser.CssError;
 import org.w3c.css.parser.Errors;
 import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.CssVersion;
 import org.w3c.css.util.HTTPURL;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.util.Util;
@@ -198,7 +199,7 @@
                                 + url.toString() + "]");
                     }
                     String media = atts.get("media");
-                    if (media == null) {
+                    if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                         media = "all";
                     }
                     styleSheetParser.parseURL(ac, url, atts.get("title"), rel, media,
@@ -298,7 +299,7 @@
                                         + url.toString() + "]");
                     }
                     String media = atts.getValue("media");
-                    if (media == null) {
+                    if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                         media = "all";
                     }
                     styleSheetParser.parseURL(ac, url, atts.getValue("title"),
@@ -312,7 +313,7 @@
                 type = atts.getValue("type");
                 title = atts.getValue("title");
 
-                if (media == null) {
+                if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                     media = "all";
                 }
                 if (Util.onDebug) {

Index: TagSoupStyleSheetHandler.java
===================================================================
RCS file: /sources/public/2002/css-validator/org/w3c/css/css/TagSoupStyleSheetHandler.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- TagSoupStyleSheetHandler.java	3 Mar 2011 15:08:10 -0000	1.8
+++ TagSoupStyleSheetHandler.java	23 Oct 2011 19:47:21 -0000	1.9
@@ -17,6 +17,7 @@
 import org.w3c.css.parser.Errors;
 import org.w3c.css.parser.analyzer.TokenMgrError;
 import org.w3c.css.util.ApplContext;
+import org.w3c.css.util.CssVersion;
 import org.w3c.css.util.HTTPURL;
 import org.w3c.css.util.InvalidParamException;
 import org.w3c.css.util.Util;
@@ -198,7 +199,7 @@
                                 + url.toString() + "]");
                     }
                     String media = atts.get("media");
-                    if (media == null) {
+                    if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                         media = "all";
                     }
                     styleSheetParser.parseURL(ac,
@@ -317,7 +318,7 @@
                                 + url.toString() + "]");
                     }
                     String media = atts.getValue("media");
-                    if (media == null) {
+                    if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                         media = "all";
                     }
                     styleSheetParser.parseURL(ac,
@@ -335,7 +336,7 @@
                 type = atts.getValue("type");
                 title = atts.getValue("title");
 
-                if (media == null) {
+                if (media == null && ac.getCssVersion() != CssVersion.CSS1) {
                     media = "all";
                 }
                 if (Util.onDebug) {

Received on Sunday, 23 October 2011 19:47:24 UTC