Bug 42973

Summary: (color:8) media query does not evaluate to true for 32bpp displays on Windows
Product: WebKit Reporter: Adam Roben (:aroben) <aroben>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: annevk, ap, darin, dbaron, hyatt, ossy
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
Attachments:
Description Flags
test case
none
LayoutTests-compatible test case
none
Fix color media queries on Windows darin: review+

Adam Roben (:aroben)
Reported 2010-07-26 06:32:28 PDT
Created attachment 62566 [details] test case To reproduce: 1. Load attached test case The box in the test case should be green, but is red. On Mac it is green. The problem is that the (color:8) media query is evaluating to false. Surprisingly, (color:10) evaluates to true on Windows.
Attachments
test case (244 bytes, text/html)
2010-07-26 06:32 PDT, Adam Roben (:aroben)
no flags
LayoutTests-compatible test case (726 bytes, text/html)
2010-09-29 15:37 PDT, Adam Roben (:aroben)
no flags
Fix color media queries on Windows (3.81 KB, patch)
2010-09-29 15:44 PDT, Adam Roben (:aroben)
darin: review+
Adam Roben (:aroben)
Comment 1 2010-07-26 06:35:14 PDT
The screenDepthPerComponent function is what is used to evaluate this media query: <http://trac.webkit.org/browser/trunk/WebCore/platform/win/PlatformScreenWin.cpp?rev=52791#L74> The problem (as in bug 42972) is that deviceInfo.bmBitsPerPel is returning 32, rather than 24. 32 / 3 == 10 (with integer truncation), which is why (color:10) is evaluating to true. Once we fix bug 42972, we could change screenDepthPerComponent to call through to screenDepth, rather than calling deviceInfoForWidget directly.
Adam Roben (:aroben)
Comment 2 2010-07-26 06:36:34 PDT
Adam Roben (:aroben)
Comment 3 2010-09-29 15:37:06 PDT
Created attachment 69262 [details] LayoutTests-compatible test case
Adam Roben (:aroben)
Comment 4 2010-09-29 15:44:57 PDT
Created attachment 69264 [details] Fix color media queries on Windows
Adam Roben (:aroben)
Comment 5 2010-09-29 15:45:27 PDT
Comment on attachment 69264 [details] Fix color media queries on Windows View in context: https://bugs.webkit.org/attachment.cgi?id=69264&action=review > LayoutTests/fast/media/color-does-not-include-alpha.html:12 > + @media (color:8) { > + #test { > + background-color: green; > + } > + } This test requires that all testers have 24bpp displays. Is this OK?
Adam Roben (:aroben)
Comment 6 2010-09-30 11:31:39 PDT
Csaba Osztrogonác
Comment 7 2010-10-01 01:23:03 PDT
(In reply to comment #6) > Committed r68809: <http://trac.webkit.org/changeset/68809> The new test fails on Qt, I filed a new bug to track it: https://bugs.webkit.org/show_bug.cgi?id=46966
Adam Roben (:aroben)
Comment 8 2010-10-01 05:09:11 PDT
(In reply to comment #7) > (In reply to comment #6) > > Committed r68809: <http://trac.webkit.org/changeset/68809> > > The new test fails on Qt, I filed a new bug to track it: > https://bugs.webkit.org/show_bug.cgi?id=46966 Sorry about that, and thanks!
Note You need to log in before you can comment on or make changes to this bug.