Summary: | screen.colorDepth and screen.pixelDepth return 32 on Windows, but should return 24 (according to CSSOM View and Firefox) | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Adam Roben (:aroben) <aroben> | ||||
Component: | DOM | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | annevk, ap, darin, dbaron, hyatt | ||||
Priority: | P2 | Keywords: | InRadar, PlatformOnly | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Attachments: |
|
Description
Adam Roben (:aroben)
2010-07-26 06:22:33 PDT
It looks like we should fix this in the screenDepth function in PlatformScreenWin.cpp. See <https://bugzilla.mozilla.org/show_bug.cgi?id=424386> and <https://bugzilla.mozilla.org/show_bug.cgi?id=466669> for Mozilla's discussion of this issue. (In reply to comment #2) > It looks like we should fix this in the screenDepth function in PlatformScreenWin.cpp. Here's the screenDepth function: <http://trac.webkit.org/browser/trunk/WebCore/platform/win/PlatformScreenWin.cpp?rev=52791#L68>. The problem is that deviceInfo.dmBitsPerPel is 32 rather than 24 as we expect. We should notice this and return 24 instead. See also <http://dbaron.org/log/20100725-colorDepth> Created attachment 69249 [details]
Make sure screen.colorDepth/screen.pixelDepth don't include the bits used for alpha
Comment on attachment 69249 [details] Make sure screen.colorDepth/screen.pixelDepth don't include the bits used for alpha View in context: https://bugs.webkit.org/attachment.cgi?id=69249&action=review > LayoutTests/fast/dom/Window/window-screen-properties.html:6 > +if (depth == 16 || depth == 24) { > + document.write("PASS: window.screen.pixelDepth is either 16 or 24"); Hm, is 16 really an OK value? I guess that could mean 6+5+5 or something, but that seems strange. (In reply to comment #7) > (From update of attachment 69249 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=69249&action=review > > > LayoutTests/fast/dom/Window/window-screen-properties.html:6 > > +if (depth == 16 || depth == 24) { > > + document.write("PASS: window.screen.pixelDepth is either 16 or 24"); > > Hm, is 16 really an OK value? I guess that could mean 6+5+5 or something, but that seems strange. http://en.wikipedia.org/wiki/Color_depth#HighColor says that is exactly what happens (6 bits for green, 5 for red, 5 for blue). That page also implies we should be allowing many more values. Comment on attachment 69249 [details] Make sure screen.colorDepth/screen.pixelDepth don't include the bits used for alpha View in context: https://bugs.webkit.org/attachment.cgi?id=69249&action=review >>> LayoutTests/fast/dom/Window/window-screen-properties.html:6 >>> + document.write("PASS: window.screen.pixelDepth is either 16 or 24"); >> >> Hm, is 16 really an OK value? I guess that could mean 6+5+5 or something, but that seems strange. > > http://en.wikipedia.org/wiki/Color_depth#HighColor says that is exactly what happens (6 bits for green, 5 for red, 5 for blue). That page also implies we should be allowing many more values. Hyatt and I decided to change the test only to allow 24, since bug 42973 imposes that requirement, too. Committed r68808: <http://trac.webkit.org/changeset/68808> |