RESOLVED FIXED 8646
REGRESSION: window.screen.pixelDepth returns wrong value
https://bugs.webkit.org/show_bug.cgi?id=8646
Summary REGRESSION: window.screen.pixelDepth returns wrong value
Kimmo Kinnunen
Reported 2006-04-28 05:27:23 PDT
To reproduce enter following url to the safari url bar javascript:alert(window.screen.pixelDepth) For me it produces dialog with the text "520" in it. bug is in WebKit/WebCore/platform/mac/ScreenMac.mm From the ADC docs about NSScreen -- - (NSWindowDepth)depth Discussion The return value is not directly usable; you must pass it to functions such as NSBitsPerPixelFromDepth and NSColorSpaceFromDepth to obtain concrete values. -- Using NSBitsPerPixelFromDepth returns 24, where as stock Safari (312+?) and Firefox return 32
Attachments
patch, test case and change log (3.43 KB, patch)
2006-05-22 20:51 PDT, David Carson
hyatt: review+
Alexey Proskuryakov
Comment 1 2006-04-28 06:39:32 PDT
Same problem with window.screen.colorDepth.
Darin Adler
Comment 2 2006-04-28 14:11:27 PDT
It seems to me that we do want to use NSBitsPerPixelFromDepth, despite the fact that Firefox returns 32. But I'm not absolutely sure. We should look at older versions of Safari to see exactly where the 32 was coming from.
Darin Adler
Comment 3 2006-04-28 21:04:40 PDT
(In reply to comment #2) > We should look at older versions of Safari to see exactly where the 32 was > coming from. It was coming from CGDisplayBitsPerPixel(kCGDirectMainDisplay).
David Carson
Comment 4 2006-05-22 20:51:46 PDT
Created attachment 8471 [details] patch, test case and change log pixelDepth now returns 24. Even though FF returns 32.
Dave Hyatt
Comment 5 2006-05-24 12:56:01 PDT
Comment on attachment 8471 [details] patch, test case and change log r=me
Darin Adler
Comment 6 2006-06-01 22:41:47 PDT
Committed revision 14678.
Note You need to log in before you can comment on or make changes to this bug.