Bug 40880 - SVG properties fill and stroke do not accept system colors
Summary: SVG properties fill and stroke do not accept system colors
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Rob Buis
URL: http://dev.w3.org/SVG/profiles/1.1F2/...
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-19 10:35 PDT by Rob Buis
Modified: 2010-06-28 00:40 PDT (History)
4 users (show)

See Also:


Attachments
Patch (7.72 KB, patch)
2010-06-19 10:41 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Test all css system colors (31.43 KB, patch)
2010-06-24 00:26 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Incorporate Dirks suggestions into test (23.14 KB, patch)
2010-06-24 13:26 PDT, Rob Buis
krit: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Buis 2010-06-19 10:35:35 PDT
The problem is clearly demonstrated by the given url
Comment 1 Rob Buis 2010-06-19 10:41:21 PDT
Created attachment 59188 [details]
Patch
Comment 2 Rob Buis 2010-06-24 00:26:26 PDT
Created attachment 59620 [details]
Test all css system colors
Comment 3 Dirk Schulze 2010-06-24 00:53:50 PDT
I would put all system colors into an array and create the elements on the fly by  with it's property in a loop, that would make the test much more readable. Something like:

svgElement = document.getElementsByTagName("svg")[0];
systemColors = new Array("Window", "WindowFrame", ...)
for(int i=0;i<systemColors.length;++i){
...


Every PASS message has the same result.  Maybe you can add the current system Color name and the real RGB numbers. This makes it easier to analyse the test on regression that may occure later and should be easy to implement with the mentioned loop of above.

What do you think?
Comment 4 Rob Buis 2010-06-24 01:03:20 PDT
Hello Dirk,
(In reply to comment #3)
> I would put all system colors into an array and create the elements on the fly by  with it's property in a loop, that would make the test much more readable. Something like:
> 
> svgElement = document.getElementsByTagName("svg")[0];
> systemColors = new Array("Window", "WindowFrame", ...)
> for(int i=0;i<systemColors.length;++i){
> ...
> 
> 
> Every PASS message has the same result.  Maybe you can add the current system Color name and the real RGB numbers. This makes it easier to analyse the test on regression that may occure later and should be easy to implement with the mentioned loop of above.
> 
> What do you think?

You are right of course! I already felt when reediting the text that it was a bit "exhaustive" and verbose. I like the suggestions and will create an improved patch, after which we can hopefully wrap this one up :)
Cheers,

Rob.

PS: even though I discovered "Menu" system color needed to be supported compared to the old patch(done with this patch), it doesnt solve "text on background with similar color" problem. For the moment I assume this is just because unfortunate system colors were supported, or maybe some not at all with a default to black?
Comment 5 Dirk Schulze 2010-06-24 01:17:39 PDT
(In reply to comment #4)
> You are right of course! I already felt when reediting the text that it was a bit "exhaustive" and verbose. I like the suggestions and will create an improved patch, after which we can hopefully wrap this one up :)
> Cheers,
> 
> Rob.
> 
> PS: even though I discovered "Menu" system color needed to be supported compared to the old patch(done with this patch), it doesnt solve "text on background with similar color" problem. For the moment I assume this is just because unfortunate system colors were supported, or maybe some not at all with a default to black?

Hi Rob,

Menu and others have a default color. Menu black, others can have different colors. This is allowed according to the Spec:
"For systems that do not have a corresponding value, the specified value should be mapped to the nearest system value, or to a default color."
At the long term even the default vlaues schould move to the platform code. But this is not our problem at the moment and should be solved in RenderTheme instead of SVG.

PS: I was wrong, system colors are part of CSS2 and therefor have to be supported by SVG :-)
Comment 6 Rob Buis 2010-06-24 13:26:18 PDT
Created attachment 59689 [details]
Incorporate Dirks suggestions into test
Comment 7 Dirk Schulze 2010-06-24 23:16:04 PDT
Comment on attachment 59689 [details]
Incorporate Dirks suggestions into test

Great Patch! r=me
Comment 8 WebKit Review Bot 2010-06-25 00:46:07 PDT
http://trac.webkit.org/changeset/61837 might have broken Qt Linux Release
Comment 9 Rob Buis 2010-06-28 00:40:20 PDT
Fixed by r61837.