W3C home > Mailing lists > Public > www-style@w3.org > December 2013

Re: Resolution MQ and number of decimal points

From: Simon Sapin <simon.sapin@exyr.org>
Date: Mon, 09 Dec 2013 00:44:06 +0000
Message-ID: <52A51256.20707@exyr.org>
To: Yoav Weiss <yoav@yoav.ws>, www-style list <www-style@w3.org>
On 08/12/2013 21:49, Yoav Weiss wrote:
> When adding some new resolution MQ layout tests to Blink, I noticed that
> current resolution MQs are compared as floats to devicePixelRatio.
> That's seems to be true for Gecko as well.
> Since devicePixelRatio is impacted by the page zoom level, it tends to
> get fraction values in both Chrome & Firefox when zooming in/out.
> Comparing the resolution MQ value as a float to DPR often turns it (when
> used without its min/max prefixes) to difficult to author and possibly
> fragile (since the actual value may differ between platforms, sensitive
> to implementation details, etc).
> Just as an example, the matching resolution MQ in firefox on a
> non-retina screen after 5 zoom-ins is (resolution: 1.7142857dppx)
> While the main use-case for using the resolution MQ to detect a zoom
> level may be testing, IMO it makes sense to define the number of decimal
> points the MQ needs to compare. I think that 2 or 3 decimal points
> comparison is probably enough.
> Thoughts?

Using un exact value such as (resolution: 1.7142857dppx) or even 
(resolution: 2dppx) seems like a bad idea as it only matches in a very 
narrow set of conditions.

Itís better to use ranges such as (min-resolution: 1.5dppx)

Simon Sapin
Received on Monday, 9 December 2013 00:44:31 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:17 UTC