RESOLVED FIXED 31363
fast/css/color-correction tests crash on Windows
https://bugs.webkit.org/show_bug.cgi?id=31363
Summary fast/css/color-correction tests crash on Windows
Brian Weinstein
Reported 2009-11-11 11:12:03 PST
This is caused by sRGBColorSpaceRef() returning null, which causes CFColorCreate to return null, and then when CFRelease(cgColor) is called, that causes a crash. This is all in WebCore/platform/graphics/cg/GraphicsContextCG.cpp.
Attachments
Null Checks (2.30 KB, patch)
2009-11-11 11:19 PST, Brian Weinstein
darin: review-
bweinstein: commit-queue-
Add tests to Skipped List (1.07 KB, patch)
2009-11-11 13:52 PST, Brian Weinstein
no flags
WebCore Workaround + Skipped List Removal (2.40 KB, patch)
2009-11-11 14:38 PST, Brian Weinstein
no flags
Brian Weinstein
Comment 1 2009-11-11 11:19:57 PST
Created attachment 42982 [details] Null Checks
Beth Dakin
Comment 2 2009-11-11 12:40:53 PST
I wonder why this is failing. Brian, do you know if it ALWAYS fails? We need to find out kCGColorSpaceSRGB is supposed to be available on Windows. If it is not available and it always fails, that is a bummer because it means this feature won't work on Windows. If this feature really doesn't exist on Windows, then the best solution is probably to edit the #ifdef in sRGBColorSpace() and make it return deviceColorSpace for Tiger and Windows. Then we will not need the null checks, and we will still draw something when the property is specified.
Darin Adler
Comment 3 2009-11-11 12:44:28 PST
Comment on attachment 42982 [details] Null Checks I don’t understand why this is appropriate. Is it really OK to just do the wrong thing and use the wrong color? Doesn't this break the feature on Windows and worse, make it use the wrong color in various places? > - CGContextSetStrokeColorSpace(context, sRGBColorSpaceRef()); > + if (CGColorSpaceRef sRGBColorSpace = sRGBColorSpaceRef()) > + CGContextSetFillColorSpace(context, sRGBColorSpace); You changed stroke to fill here. If Windows CG is getting 0 for some of these things we need to figure out why. Just doing the wrong thing to avoid a crash is not good. In the mean time, skipping the tests might be the best short term measure. review- because of the stroke to fill change and also my general disagreement that this is a fix.
Brian Weinstein
Comment 4 2009-11-11 12:47:13 PST
Understood, this patch was to get feedback on the best way to handle it, which I now have plenty of. I like Beth's solution, and think that would be the right way to handle it for now.
Beth Dakin
Comment 5 2009-11-11 12:50:14 PST
kCGColorSpaceSRGB should be available according to the header. Looks like we need to file a CG bug.
Brian Weinstein
Comment 6 2009-11-11 13:34:11 PST
Until then I will skip these tests on Windows.
Brian Weinstein
Comment 7 2009-11-11 13:52:17 PST
Created attachment 42996 [details] Add tests to Skipped List Should we also add a temporary check in static CGColorSpaceRef sRGBColorSpaceRef() to return deviceRGBColorSpaceRef() if we are on Windows until the bug is fixed? If so, I can do that in another patch.
Darin Adler
Comment 8 2009-11-11 13:53:34 PST
(In reply to comment #7) > Should we also add a temporary check in > > static CGColorSpaceRef sRGBColorSpaceRef() to return deviceRGBColorSpaceRef() > if we are on Windows until the bug is fixed? If so, I can do that in another > patch. You should talk to Beth and Adele about that.
Brian Weinstein
Comment 9 2009-11-11 13:58:54 PST
Comment on attachment 42996 [details] Add tests to Skipped List Skipped list changes landed in r50841.
Brian Weinstein
Comment 10 2009-11-11 14:38:36 PST
Created attachment 43006 [details] WebCore Workaround + Skipped List Removal
Beth Dakin
Comment 11 2009-11-11 14:42:25 PST
Comment on attachment 43006 [details] WebCore Workaround + Skipped List Removal > +#if PLATFORM(WIN) > + return deviceRGBColorSpaceRef(); > +#else > #ifdef BUILDING_ON_TIGER > return deviceRGBColorSpaceRef(); > #else > static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); > return sRGBSpace; > #endif > +#endif > } I think you can re-write this as: #if PLATORM(WIN) || DEFINED(BUILDING_ON_TIGER) return deviceRGBColorSpaceRef(); #else static CGColorSpaceRef sRGBSpace = CGColorSpaceCreateWithName(kCGColorSpaceSRGB); return sRGBSpace; #endif which might be a little neater, but it's up to you.
Darin Adler
Comment 12 2009-11-11 14:43:58 PST
defined, not DEFINED
Brian Weinstein
Comment 13 2009-11-11 14:48:27 PST
Happy I re-compiled after making that fix. That is a lot cleaner, I am making that change and landing. Keeping the bug open though until this workaround is fixed. I'll add a FIXME as well referencing this bug.
Brian Weinstein
Comment 14 2009-11-11 14:50:50 PST
Comment on attachment 43006 [details] WebCore Workaround + Skipped List Removal Landed in r50843. Keeping the bug open until we can use correct sCGColorSpaceSRGB without crashing.
Darin Adler
Comment 15 2009-11-11 14:52:34 PST
(In reply to comment #14) > Keeping the bug open until we can use correct sCGColorSpaceSRGB without crashing. I'm not sure that's right. Lets make a new bug talking about what's really wrong.
Brian Weinstein
Comment 16 2009-11-11 14:55:18 PST
(In reply to comment #15) > (In reply to comment #14) > > Keeping the bug open until we can use correct sCGColorSpaceSRGB without crashing. > > I'm not sure that's right. Lets make a new bug talking about what's really > wrong. Sure, that's fair. I'll close this, since the tests aren't crashing anymore.
Beth Dakin
Comment 17 2009-11-11 20:34:10 PST
<https://bugs.webkit.org/show_bug.cgi?id=31316> and <rdar://problem/7387791> Make -webkit-color-correction correct color on Windows To track re-enabling this feature. I also filed a CG bug linked to from the Radar.
Stephen White
Comment 18 2010-02-08 12:26:04 PST
Stephen White
Comment 19 2010-02-08 12:32:58 PST
Hmm, sorry about that. Seems like "webkit-patch land" picked up the wrong bug ID; ignore the previous comment.
Brent Fulgham
Comment 20 2013-11-22 13:23:59 PST
The NULL color space issue is now corrected.
Note You need to log in before you can comment on or make changes to this bug.