Bug 31382

Summary: Make -webkit-color-correction work with shadows
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: CSSAssignee: Beth Dakin <bdakin>
Status: RESOLVED FIXED    
Severity: Normal CC: bdakin
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Patch simon.fraser: review+

Description Beth Dakin 2009-11-11 15:39:18 PST
New CSS feature -webkit-color-correction does not currently work with box-shadow or text-shadow. This should be rectified!
Comment 1 Beth Dakin 2009-11-11 15:55:26 PST
Created attachment 43015 [details]
Patch

A few things about this patch:

1. As I mention in the Changelog, this doesn't fix canvas shadows. I will fix those when I fix canvas <https://bugs.webkit.org/show_bug.cgi?id=31319>
2. I did not make a new variable on the state for the shadow ColorSpace. This is not necessary with the way things are currently implemented. Furthermore, I realized that it is probably silly to have both a strokeColorSpace and a fillColorSpace -- I am pretty certain that even when the colors are different, stroke and fill will have the same ColorSpace, right? Anyway, it seems like these could be collapsed into one variable. I did not do that with the patch, but I am considering it. Maybe now or maybe later, what do you think?
Comment 2 Simon Fraser (smfr) 2009-11-11 16:25:21 PST
Comment on attachment 43015 [details]
Patch

> Index: WebCore/platform/graphics/cg/GraphicsContextCG.cpp
> ===================================================================

> +    CGColorRef cgColor = NULL;

Should be 0, not NULL. It would be nice to rewrite this using RetainPtrs at some point.
Comment 3 Simon Fraser (smfr) 2009-11-11 17:07:38 PST
Comment on attachment 43015 [details]
Patch

r++++++
Comment 4 Beth Dakin 2009-11-11 17:51:31 PST
Yay! Committed fix with revision 50852.