This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16700 - Validating with CSS 1 Profile always reports an error
Summary: Validating with CSS 1 Profile always reports an error
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 1.0 (show other bugs)
Version: CSS Validator
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-11 12:04 UTC by Radu Coravu
Modified: 2012-09-21 14:46 UTC (History)
1 user (show)

See Also:


Attachments

Description Radu Coravu 2012-04-11 12:04:21 UTC
If I valida a simple CSS like:

a{
 margin-top: 0;
}

with the profile set to CSS 1, this error is reported:

org.w3c.css.util.InvalidParamException: unrecognized media all 
org.w3c.css.util.InvalidParamException: unrecognized media all 
	at org.w3c.css.media.css1.AtRuleMedia.addMedia(AtRuleMedia.java:27)
	at org.w3c.css.css.StyleSheetParser.addMedias(StyleSheetParser.java:242)
	at org.w3c.css.css.StyleSheetParser.parse(StyleSheetParser.java:468)


In a previous CSS Validator version the StyleSheetParser class contained the following code:

if (media == null) {
                if (ac.getCssVersion() != CssVersion.CSS1) {
		if (ac.getMedium() == null) {
		    media = "all";
		} else {
		    media = ac.getMedium();
		}
	    }

But the clause "ac.getCssVersion() != CssVersion.CSS1" was removed in the latest version.
Comment 1 Yves Lafon 2012-08-30 09:23:29 UTC
The code you provide is in the actual version, so the media all must be set somewhere else, if it still fails. (I noticed an issue with form submission on the cssval so that might be linked).
For this bug report, as the code you want to re-add is already there, it is ok to close this bug?
Comment 2 Radu Coravu 2012-08-30 09:44:39 UTC
Sure Yves, no problem.