W3C home > Mailing lists > Public > www-style@w3.org > October 2012

Re: [css3-mediaqueries] (min-resolution: 0dpi) is false in several browsers.

From: Kenneth Rohde Christiansen <kenneth.r.christiansen@intel.com>
Date: Sun, 21 Oct 2012 17:23:20 +0200
Message-ID: <CAEC208sfsywqL1hK7dBpsWbCg1Q2AjsqgE5G6H4GOTjC0+DAkw@mail.gmail.com>
To: Florian Rivoal <florian@rivoal.net>
Cc: Simon Sapin <simon.sapin@kozea.fr>, "www-style@w3.org list" <www-style@w3.org>, Peter Beverloo <beverloo@google.com>, John Mellor <johnme@chromium.org>
Hi there,

OK thanks for making that clear.


On Sun, Oct 21, 2012 at 5:17 PM, Florian Rivoal <florian@rivoal.net> wrote:
> Kenneth Rohde Christiansen <kenneth.christiansen@gmail.com> wrote:
>>The first iPhone (and many later phones) shipped with a DPI of 160,
>>which is what most mobile web apps have been optimized for.
>>The iPhone 4, shipped with a DPI of 320 (retina display) and a
>>device-pixel-ratio == 2.0, meaning that one CSS unit is defined at 160
>>DPI still.
> You are correct if dpi is defined as physical pixels per physical inch, which is a reasonable thing to do when describing the characteristics of the hardware. This is not what the dpi unit in css means, tough. It refers to physical pixels per css inch, where a css inch is defined as 96 css pixels. The difference between physical inches and css inches is intentional.
> According to this definition, the first iphone had 96 dpi, and the iphone 4 had 192dpi. This is, per definition, equivalent to 1dppx and 2dppx, respectively.
>>A bit of background:
>>On Sun, Oct 21, 2012 at 2:25 PM, Simon Sapin <simon.sapin@kozea.fr>
>>> Le 21/10/2012 14:06, Kenneth Rohde Christiansen a écrit :
>>>> Then that is very different from the device-pixel-ratio it is
>>>> to replace, as device-pixel-ratio: 1 on iOS etc corresponds to a DPI
>>>> of 160, and 2 to a DPI of the double.
>>> Where is this 160 number coming from? By "a DPI of 160", do you mean
>>> pixels per physical inch on a particular device?
>>> The CSS dpi unit is not the same, it is in device pixels per CSS
>>inch. A CSS
>>> inch is always 96 CSS pixels.
>>> About device-pixel-ratio, what is it’s exact definition? I couldn’t
>>find it.
>>> Apparently it ways supposed to be documented in [1] but according to
>>> archive.org is never was.
>>> The best hint I found is in a Mozilla bug[2]:
>>>> It looks like Webkit's 'ratio' is the number of device pixels per
>>>> pixel.
>>> There is also a CSSWG blog post[3] suggesting that eg.
>>> (-webkit-device-pixel-ratio: 2) is exactly the same as
>>> (resolution: 192dpi)
>>> [1] http://webkit.org/specs/MediaQueriesExtensions.html
>>> [2] https://bugzilla.mozilla.org/show_bug.cgi?id=474356#c6
>>> [3]
>>> --
>>> Simon Sapin

Intel Denmark Aps
Langelinie Alle 35, DK-2100 Copenhagen
CVR No. 76716919

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
Received on Sunday, 21 October 2012 15:24:08 UTC

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