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 1269 - color: rgb(real, int, int) should be reported as an error
Summary: color: rgb(real, int, int) should be reported as an error
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 1.0 (show other bugs)
Version: CSS Validator
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Olivier Thereaux
QA Contact: qa-dev tracking
URL: http://www.gtalbot.org/BrowserBugsSec...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-24 20:18 UTC by Gérard Talbot
Modified: 2005-08-29 12:41 UTC (History)
0 users

See Also:


Attachments

Description Gérard Talbot 2005-04-24 20:18:23 UTC
"illegal values, *_or values with illegal parts_*, are treated as if the
declaration weren't there at all" 
CSS 1, section 7.1 Forward-compatible parsing
http://www.w3.org/TR/CSS1#forward-compatible-parsing

"Illegal values. User agents must ignore a declaration with an illegal value."
CSS 2.1, section 4.2 Rules for handling parsing errors
http://www.w3.org/TR/CSS21/syndata.html#parsing-errors

"Unsupported ValuesIf a UA does not support a particular value, it should ignore
that value when parsing stylesheets, as if that value was an illegal value."
CSS3, section 5. Rules for handling parsing errors or unsupported features 
http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#error-handling

Actual results:
The CSS validator truncates the illegal part and does not report any parsing error.

Expected results:
The CSS validator should report the error and notify accordingly that only
integer value in the 0 - 255 range are valid.

Note: Safari 1.2+ and Mozilla-based browsers will parse a real value as an error
and will apply error condition to the declaration.
Comment 1 Yves Lafon 2005-08-26 14:22:19 UTC
Fixed, see http://qa-dev.w3.org:8001/css-validator/
Comment 2 Gérard Talbot 2005-08-26 17:07:32 UTC
Yves, the parsing error is detected and reported but the error message is rather
vague in my opinion. "Invalid RGB function" will certainly confuse a few people
and does not help as best as one could. 

1- Would it be possible to refine the error message? Just asking...

2- If one submits the file
http://www.hixie.ch/tests/evil/css/css21/tests/t040306-syntax-01-f.htm
the qa-dev.w3.org:8001/css-validator CSS validator reports that 

p#percentpercentpercent1  {

     color : rgb(0.0, 50.0, 0.0);

}
p#percentpercentpercent2 {

     color : rgb(0.0, 49.99, 0.0)

are valid info when the submitted rules were

    p#percentpercentpercent1 { color: rgb(0%, 50%, 0%) }
    p#percentpercentpercent2 { color: rgb(0%, 49.99%, 0%) }

Notice that the "%" is lost. Small glitch. Should I open a bug for that?

http://qa-dev.w3.org:8001/css-validator/validator?uri=http%3A%2F%2Fwww.hixie.ch%2Ftests%2Fevil%2Fcss%2Fcss21%2Ftests%2Ft040306-syntax-01-f.htm
Comment 3 Bj 2005-08-26 17:39:54 UTC
Please open a new one.
Comment 4 Yves Lafon 2005-08-29 12:41:07 UTC
> are valid info when the submitted rules were
> 
>     p#percentpercentpercent1 { color: rgb(0%, 50%, 0%) }
>     p#percentpercentpercent2 { color: rgb(0%, 49.99%, 0%) }
> 
> Notice that the "%" is lost. Small glitch. Should I open a bug for that?
> 
>
http://qa-dev.w3.org:8001/css-validator/validator?uri=http%3A%2F%2Fwww.hixie.ch%2Ftests%2Fevil%2Fcss%2Fcss21%2Ftests%2Ft040306-syntax-01-f.htm

It should be fixed now.