Version: (using KDE 4.2.2) OS: Linux Installed from: Ubuntu Packages Testcase -------- http://www.hixie.ch/tests/evil/css/css21/tests/t040306-syntax-01-f.htm Relevant excerpt of code ------------------------ <style type="text/css"> p.incorrect { color: green } p#numnumpercent { color: rgb(255, 0, 0%) } p#percentnumnum { color: rgb(100%, 0, 0) } p#percentpercentnum { color: rgb(100%, 0%, 0) } p#percentnumpercent { color: rgb(100%, 0, 0%) } </style> <p id="numnumpercent" class="incorrect">This should be green</p> <p id="percentnumnum" class="incorrect">This should be green</p> <p id="percentpercentnum" class="incorrect">This should be green</p> <p id="percentnumpercent" class="incorrect">This should be green</p> Description ----------- { The format of an RGB value in the functional notation is 'rgb(' followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ')'. } CSS 2.1, section 4.3.6, Color defined, specified as a numerical RGB specification. http://www.w3.org/TR/CSS21/syndata.html#value-def-color From reading the spec, we are lead to believe that the "or" is exclusive: so, it's either 3 integers or 3 percentage values but not mixed, with no mixing allowed. Therefore the 4 CSS rules p#numnumpercent { color: rgb(255, 0, 0%) } p#percentnumnum { color: rgb(100%, 0, 0) } p#percentpercentnum { color: rgb(100%, 0%, 0) } p#percentnumpercent { color: rgb(100%, 0, 0%) } should trigger respectively 4 parsing errors and then p.incorrect { color: green } should apply making the first 4 lines as green, not red. I searched for a duplicate and did not find any. regards, Gérard
The CSS validator will also report parsing errors for the 4 respective declarations. 1 p#numnumpercent Value Error : color This number should be an integer. ) 2 p#percentnumnum Value Error : color 0 is an incorrect percentage ) 3 p#percentpercentnum Value Error : color 0 is an incorrect percentage ) 4 p#percentnumpercent Value Error : color 0 is an incorrect percentage ) regards, Gérard
This bug still occurs, occurs as well in Konqueror 4.2.3 regards, Gérard
(fixed in my tree, waiting commit)
The testcase mentioned in the description has been submitted to become part of the CSS 2.1 Conformance test suite: RGB color syntax error handling (test for validity) http://www.w3.org/Style/CSS/Test/CSS2.1/current/html4/color-000.htm regards, Gérard
SVN commit 971234 by ggarand: don't allow mix of percents and integers in functional-style colour declarations since it is explicitely disallowed by CSS 2.1 BUG: 193434 M +5 -3 cssparser.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=971234
SVN commit 971651 by ggarand: automatically merged revision 971234: don't allow mix of percents and integers in functional-style colour declarations since it is explicitely disallowed by CSS 2.1 BUG: 193434 M +5 -3 cssparser.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=971651
I get expected results with Konqueror 4.2.4. Marking as VERIFIED regards, Gérard