Bug 114331 - WebView color management differs from Safari
Summary: WebView color management differs from Safari
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.8
: P2 Minor
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-04-09 21:54 PDT by Jonathan Hammer
Modified: 2013-08-26 15:48 PDT (History)
8 users (show)

See Also:


Attachments
Original test page. (176 bytes, text/html)
2013-04-09 22:46 PDT, Benjamin Poulain
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Hammer 2013-04-09 21:54:12 PDT
CSS colors appear to render in a different color space when the HTML document is loaded in Safari versus loaded in a WebView (from the Obj-C WebKit.framework).

Specifically, the document at http://ethreesoftware.com/misc/colortest.html has a background-color of rgb(70, 130, 180). When Safari renders the document and a screenshot is taken (PNG tagged with the current display profile), sampling the background pixels in Photoshop yields the correct rgb(70, 130, 180) values. If you load the exact same document inside of a WebView, take a screenshot, and sample the background pixels, the colors are instead rgb(58, 128, 182). Example screenshot at http://ethreesoftware.com/misc/webview-left-safari-right.png.

Not sure what might be going on here. Is the WebView not using NSDeviceRGBColorSpace but Safari is? Is there some kind of OpenGL surface interaction that's going on? The above results seem consistent no matter what application I test with (i.e. WebViews in Apple Mail, in third-party apps like Coda, and in reduced test-case apps consisting of just a window and a WebView—all render the "wrong" color).

OS X 10.8.3 (12D78), Safari 6.0.3 (8536.28.10)
Comment 1 Jonathan Hammer 2013-04-09 21:58:55 PDT
Forgot to mention that this is WebKit version 536.28.10
Comment 2 mitz 2013-04-09 22:31:35 PDT
<rdar://problem/12263557>
Comment 3 Benjamin Poulain 2013-04-09 22:46:47 PDT
Created attachment 197209 [details]
Original test page.

Original test page attached.

Jonathan: for info, Radar is the internal bug tracker of Apple.
The link above and the keyword "InRadar" indicate this issue is now also being tracked by Apple.
Comment 4 Simon Fraser (smfr) 2013-04-09 23:04:29 PDT
Probably related to the fact that Safari is rendering via CoreAnimation.