@media (min-resolution: 1.4dppx) doesn't apply when layout.css.devPixelsPerPx is set to 1.4

NEW
Unassigned

Status

()

Core
Layout
4 years ago
4 years ago

People

(Reporter: jwilde, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 years ago
Created attachment 777617 [details]
failing testcase

Steps to reproduce:
- Open attached testcase (tested on Windows 8 only)
- Set layout.css.devPixelsPerPx to 1.4

Expected result:
Testcase turns green and says ">= 1.4 dppx", indicating that the @media query applied correctly.

Actual result:
Testcase stays blue and says "< 1.4 dppx". It doesn't start to turn green until layout.css.devPixelsPerPx is about 1.412.
I think the reality is that the devPixelsPerPx pref is rounded such that its reciprocal is the nearest number that is a multiple of 1/60.  (See nsDeviceContext::UpdateScaledAppUnits, which computes nsDeviceContext::mAppUnitsPerDevPixel.)
Windows 8 scales apps on high-dpi displays to 1.4dppx or 1.8dppx.  This rounding means that it is tricky for us to scale chrome or content in Firefox to match that resolution exactly.
You need to log in before you can comment on or make changes to this bug.