RESOLVED FIXED 22300
Use of NSCalibratedRGBColorSpace for CSS system colors causes layout tests to fail due to screen calibration
https://bugs.webkit.org/show_bug.cgi?id=22300
Summary Use of NSCalibratedRGBColorSpace for CSS system colors causes layout tests to...
Simon Fraser (smfr)
Reported 2008-11-16 20:07:25 PST
The following layout tests: fast/forms/disabled-select-change-index.html fast/forms/file-input-disabled.html fast/forms/input-text-maxlength.html fast/forms/input-text-paste-maxlength.html always fail for me at home because the disabled text control color differs from the expected: - RenderButton {INPUT} at (0,0) size 78x18 [color=#808080] [bgcolor=#C0C0C0] + RenderButton {INPUT} at (0,0) size 78x18 [color=#6D6D6D] [bgcolor=#C0C0C0] Deugging shows that for me, [[NSColor disabledControlTextColor] colorUsingColorSpaceName:NSCalibratedRGBColorSpace] returns #6d6d6d, not #808080. Maybe NSCalibratedRGBColorSpace is the wrong color space to use?
Attachments
Patch v1 (12.58 KB, patch)
2008-11-20 19:00 PST, Pierre-Olivier Latour
mitz: review+
Simon Fraser (smfr)
Comment 1 2008-11-16 20:07:51 PST
mitz
Comment 2 2008-11-16 20:08:22 PST
(In reply to comment #0) > Maybe NSCalibratedRGBColorSpace is the wrong color space to use? I think you're right.
Pierre-Olivier Latour
Comment 3 2008-11-20 17:49:22 PST
This failure is pretty easy to reproduce: just set your display profile to sRGB for instance. Note that it won't reproduce if you run with --pixel as this temporarily changes the display profile to Generic RGB.
Pierre-Olivier Latour
Comment 4 2008-11-20 18:11:02 PST
I had a look at the webcore and webkit source, and it seems that: 1) CG colorspace are always device except for one case (in CreateCGColorIfDifferent()) 2) AppKit colorspace can be device or calibrated and I don't see a clear pattern
Pierre-Olivier Latour
Comment 5 2008-11-20 19:00:08 PST
Created attachment 25329 [details] Patch v1 The way to fix this issue and other potential ones is to ensure WebKit is always using Device RGB colorspace internally, which is mostly the case today. Note that I replaced calls to +[NSColor whiteColor] as well since these return colors in calibrated colorspace. I ran all layout tests with pixel tests enabled and disabled and no regressions were reported, except for platform/mac/fast/text/attributed-substring-from-range-001.html which needs to be updated.
mitz
Comment 6 2008-11-21 10:23:21 PST
Comment on attachment 25329 [details] Patch v1 r=me
Dean Jackson
Comment 7 2008-11-21 12:02:31 PST
Committed r38671 M WebKit/mac/ChangeLog M WebKit/mac/WebView/WebHTMLView.mm M WebCore/ChangeLog M WebCore/page/mac/AccessibilityObjectWrapper.mm M WebCore/platform/graphics/mac/ColorMac.h M WebCore/platform/graphics/mac/ColorMac.mm M WebCore/rendering/RenderThemeMac.mm M LayoutTests/platform/mac/fast/text/attributed-substring-from-range-001-expected.txt M LayoutTests/ChangeLog
Note You need to log in before you can comment on or make changes to this bug.