Bug 48120 - SVGColor::cssText() shouldn't return #RRGGBBAA colors
Summary: SVGColor::cssText() shouldn't return #RRGGBBAA colors
Status: RESOLVED DUPLICATE of bug 55119
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: 54539
  Show dependency treegraph
 
Reported: 2010-10-22 03:36 PDT by Andreas Kling
Modified: 2011-02-25 00:49 PST (History)
3 users (show)

See Also:


Attachments
Proposed patch (11.48 KB, patch)
2010-10-22 03:43 PDT, Andreas Kling
darin: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-10-22 03:36:02 PDT
For SVG_COLORTYPE_RGBCOLOR, SVGColor::cssText() currently returns Color::name() which uses #RRGGBBAA notation for colors with alpha < 255.
These color values are not valid CSS and can't be set. We should return spec compliant serialized colors (i.e using rgba() notation for colors with alpha.)
Comment 1 Andreas Kling 2010-10-22 03:43:21 PDT
Created attachment 71545 [details]
Proposed patch
Comment 2 Darin Adler 2010-10-22 03:48:21 PDT
Comment on attachment 71545 [details]
Proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=71545&action=review

Fix looks good, but tests do not.

> LayoutTests/ChangeLog:9
> +        Color::serialized() is already exercised in depth by fast/canvas tests.

Sure, it’s good that function has good test coverage, but this patch doesn’t include a test case for the bug you are fixing!

These test results only show that we are switching from uppercase hex to lowercase hex.
Comment 3 Dirk Schulze 2010-10-22 03:49:47 PDT
Ok, the problem is, that SVG doesn't support RGBA. But we added RGBA support recently with rgba(..,..,..,..). This is a violation of the specification, but a useful one. Therefor SVG_COLORTYPE_RGBCOLOR is also a unlucky name now, since it implicates that there are just three channels (what the spec explicitly wants).
We should look what the other Browsers are doing and should definitely write to the www-svg mailing list. Didn't take a look at the SVG 1.1se specification, but I doubt that someone specified it yet. This is also a topic the svg-css task force should look at.
Can you investigate more please?
Comment 4 Nikolas Zimmermann 2011-02-25 00:49:16 PST
For now, we shouldn't exose these colors through CSS, as long as it's not specified how.
I'll also ask on the SVG WG, now that I'm a member :-)

Bug 55119 rewrites SVGColor/SVGPaint to be spec compilant, and depends on this bug to be fixed, as well.

*** This bug has been marked as a duplicate of bug 55119 ***