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

Re: [css3-images][css4-images] Replace 'dppx' with 'x'?

From: Brad Kemper <brad.kemper@gmail.com>
Date: Thu, 14 Jun 2012 15:46:20 -0700
Message-Id: <EC2DA863-C816-4F94-B0E0-6A4B17CC8BA7@gmail.com>
Cc: Simon Fraser <smfr@me.com>, Florian Rivoal <florianr@opera.com>, "www-style@w3.org" <www-style@w3.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
On Jun 14, 2012, at 12:18 PM, "Tab Atkins Jr." <jackalmage@gmail.com> wrote:

> On Thu, Jun 14, 2012 at 11:25 AM, Simon Fraser <smfr@me.com> wrote:
>> On May 29, 2012, at 4:22 PM, Tab Atkins Jr. wrote:
>>> On Tue, May 29, 2012 at 1:08 AM, Florian Rivoal <florianr@opera.com> wrote:
>>>> On Fri, 25 May 2012 20:07:53 +0200, Christoph Päper
>>>> <christoph.paeper@crissov.de> wrote:
>>>>> Of course, all the reciprocal length units are plain stupid and
>>>>> unnecessary – and always have been.
>>>>> 
>>>>>  image-resolution: <count> [ / <length> ]?;
>>>>>  image-resolution: 1dot; /* with 1px default */
>>>>>  image-resolution: 300dot/1in;
>>>>>  image-resolution: 100dot / 1mm;
>>>> 
>>>> I wasn't there when you initially suggested that, but I think I like it. It
>>>> may be too late to introduce something like that, but I wouldn't mind being
>>>> proven wrong about this.
>>> 
>>> The 'image-resolution' property was reverse-implemented based on what
>>> already existed, so we can't remove what exists, but we can always add
>>> more syntax later.  However, I don't think adding ratios for
>>> expressing resolution is a good thing unless we do it everywhere.
>> 
>> My problem with the dppx unit is that the ratio of device pixels to CSS pixels only makes
>> sense when the page is unscaled. Most mobile devices (and, increasingly, desktop browsers)
>> present pages at a non-unit scale, and allow users to zoom the page in and out. When zoomed,
>> there's an additional scale factor applied that needs to be taken into account in the relationship
>> between device pixels and CSS pixels. The 'dppx' unit pretends that such a scale factor does not
>> exist, which is confusing.
>> 
>> In addition, I still think that most authors will interpret "resolution" in terms of physical screen size,
>> not the 1:96 fixed CSS inch:pixel ratio.
>> 
>> Both are strong arguments for a simple multiplier factor in media queries, as used by device-pixel-ratio.
> 
> You're saying that the value of device-pixel-ratio is sensitive to
> zoom?  So that on a high-res (2x) phone viewing a page that is also
> initially viewport-zoomed to half its size, the device-pixel-ratio is
> 4?

Zooming is not defined anywhere in CSS, but I tend to think of it as an operation that changes the size of a CSS px while simultaneously changing the viewport width and height by the inverse. So, a 400px wide viewport zoomed out to where a px is half it's 100% size is then 200px (but the same physical size). Then, unlike in IE7-8, things like background-position just work when zooming. It wouldn't affect media queries or JavaScript queries, and the dppx of the image would stay the same. 
Received on Thursday, 14 June 2012 22:46:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT