Bug 18355 - rgb() or rgba() values should be only accepted when all integers or all percentages.
Summary: rgb() or rgba() values should be only accepted when all integers or all perce...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://www.w3.org/TR/css3-color/#rgb-...
Keywords: HasReduction
: 18588 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-07 23:44 PDT by Robert Blaut
Modified: 2008-04-29 16:00 PDT (History)
1 user (show)

See Also:


Attachments
no mixed rgb() values (923 bytes, text/html)
2008-04-07 23:45 PDT, Robert Blaut
no flags Details
no mixed rgba() values (974 bytes, text/html)
2008-04-07 23:46 PDT, Robert Blaut
no flags Details
patch (37.55 KB, patch)
2008-04-29 08:47 PDT, Anatoli Papirovski
darin: review+
Details | Formatted Diff | Diff
patch for svg test case (1.65 KB, patch)
2008-04-29 15:03 PDT, Anatoli Papirovski
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Blaut 2008-04-07 23:44:20 PDT
CSS3 Color Module specification says: "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 ')'." and "The format of an RGBA value in the functional notation is 'rgba(' followed by a comma-separated list of three numerical values (either three integer values or three percentage values), followed by an <alphavalue>, followed by ')'."

Mixing of integers with percentages is disallowed. Two tests from css3-color Conformance Test Suite:  http://www.w3.org/Style/CSS/Test/CSS3/Color/20070927/ check these cases:
http://www.w3.org/Style/CSS/Test/CSS3/Color/20070927/html4/t040202-rgba-func-no-mixed-f.htm
http://www.w3.org/Style/CSS/Test/CSS3/Color/20070927/html4/t040201-rgb-func-no-mixed-f.htm
Comment 1 Robert Blaut 2008-04-07 23:45:39 PDT
Created attachment 20398 [details]
no mixed rgb() values
Comment 2 Robert Blaut 2008-04-07 23:46:04 PDT
Created attachment 20399 [details]
no mixed rgba() values
Comment 3 Anatoli Papirovski 2008-04-29 08:47:19 PDT
Created attachment 20889 [details]
patch

This is valid both per css 2.1 and css 3 spec, as far as I can tell.

Also, this is a duplicate of bug 18588.
Comment 4 Anatoli Papirovski 2008-04-29 08:48:20 PDT
Actually, meant to say that 18588 is a duplicate of this one.
Comment 5 Darin Adler 2008-04-29 09:19:15 PDT
Comment on attachment 20889 [details]
patch

Looks good to me. r=me
Comment 6 Darin Adler 2008-04-29 09:19:27 PDT
*** Bug 18588 has been marked as a duplicate of this bug. ***
Comment 7 mitz 2008-04-29 09:56:07 PDT
Landed as <http://trac.webkit.org/changeset/32689>.
Comment 8 Anatoli Papirovski 2008-04-29 15:03:16 PDT
Created attachment 20893 [details]
patch for svg test case

Forgot to modify one of the test cases and its results...
Comment 9 mitz 2008-04-29 16:00:25 PDT
Comment on attachment 20893 [details]
patch for svg test case

I should have caught this before landing.

r=me