Some issues detected on the last 2010_0 release

Alex Jitianu <[email protected]>
Newsgroups gmane.org.w3c.validator.css
Message-ID <[email protected]>
Hi,
Here are some possible problems I've detected on the CSS Validator:

1. If a CSS3 attribute selector has a prefix, the validator doesn't 
recognize it. Ex:
       @namespace foo "http://www.example.com";
       *[foo|att=val] { color: blue }

2. Validating each of  the 2 properties below will result in a NPE (wich 
is represented as Parse Error [empty string]):
       text-shadow: 0.1em 0.1em rgba(0, 0, 0, 0.5);
       box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);

I believe the cause is that function "rgba" is not recognized as valid 
COLOR values.

The next property fails with a ClassCastException. It should give the 
error "0 is not a color value ":
  box-shadow: 3px 3px 5px 0;

I believe both problems can be solved if the code from 
org.w3c.css.properties.css1.CssColor will be used to validate the COLOR 
part in org.w3c.css.properties.css3.CssBoxShadow.java and 
org.w3c.css.properties.css3.CssBoxShadow.java

3. Resource CSS3Properties.properties has an invalid entry:
      text-overflow : org.w3c.css.properties.css3.CssTextOverflowCSS3

I think it should be:
      text-overflow : org.w3c.css.properties.css3.CssTextOverflow

4. in org.w3c.css.parser.CssPropertyFactory, whenever throwing a  
"noexistence" exception the profile should also be passed through 
translations :
    "pfsOk.toString()" replaced with 
"ac.getMsg().getString(pfsOk.toString())"

5. org.w3c.css.properties.css1.CssBackgroundMob. The NULL check from 
line 121 should be moved before line 117 otherwise a NPE could arrise.

6.In  org.w3c.css.util.ApplContext.isNamespaceDefined(URL, String), 
reference "namespaces" can be null (is lazy created on method 
"setNamespace") so the call  "namespaces.get(url)" can throw a NPE.

Suggestions :

1. In class org.w3c.css.css.StyleSheetParser a new parse method over a 
reader can be useful :
        public void parse(ApplContext ac, Reader inputReader, URL url, 
String kind, String media, int origin)

2. In class org.w3c.css.parser.CssFouffa a new constructor over a reader 
can be useful :
       public CssFouffa(ApplContext ac, Reader reader,  URL file, int 
beginLine)

3. In org.w3c.css.parser.CssFouffa.handleImport(URL url, String file, 
boolean is_url, AtRuleMedia media), the following block is a problem if 
you invoke the validator for local CSSs:

     //if it's not permitted to import... (direct input)
     if (url.getProtocol().equals("file")) {
         ac.getFrame().addWarning("unsupported-import");
         return;
     }

Hope it helps,
Alex
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.