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

Re: [mediaqueries] resolution and device-pixel-ratio

From: Dean Jackson <dino@apple.com>
Date: Thu, 14 Nov 2013 09:54:35 +0800
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>, Florian Rivoal <florian@rivoal.net>, "www-style@w3.org" <www-style@w3.org>
Message-id: <B2CD0867-B00C-4E50-B2D9-54195B5DBCFB@apple.com>
To: John Mellor <johnme@google.com>
Related: the CSS WG resolved at its meeting two days ago that Apple will make a proposal for something that covers the following issues:

- a definition for all the types of zooms
- the fixed number of device pixels to a CSS px at 1:1 zoom
- the value of zoom that maps how large a CSS px is now relative to the natural scale (the one browsers do without changing the width of the viewport)
- the "user" zoom factor (sometimes called pinch zoom), where everything including the width of the viewport is scaled.

The goal is that there would be media queries, and possibly direct DOM interfaces, that allow an author to configure content based on all these things. The other goal is to come up with something such that the current device-pixel-ratio behaviour can be deprecated (it's incompatible between browsers and we don't want to break content).

Dean

On 13 Nov 2013, at 7:16 pm, John Mellor <johnme@google.com> wrote:

> Either path seems reasonable, but FWIW resolution is much easier to get wrong, since (except in print) CSS dpi != physical dpi (which is much less well known than the fact that CSS in != physical in). So if you copy (physical) values from mobile device specifications, it's easy to write incorrect MQs like (min-resolution:320dpi), which the author thinks is equivalent to (min-resolution:2dppx), but actually corresponds to (min-resolution:3.33dppx)!
> 
> That can probably be solved by developer outreach that recommends dppx, or recommends dpi for improved backwards compatibility, but explaining that you should always take the desired dppx value and multiply it by 96, rather than copying physical values; however I suspect this will remain a source of errors.
> 
> 
> On Sun, Nov 10, 2013 at 5:08 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> On Sat, Nov 9, 2013 at 7:50 AM, Florian Rivoal <florian@rivoal.net> wrote:
> > During a recent conf call, while discussing the resolution and
> > device-pixel-ratio media queries, it seemed that many people suggested that
> > the "resolution" MQ has failed, and that we should pave the cow paths, and
> > standardize device-pixel-ratio, possibly as an alias to resolution.
> >
> > Technically, this would not be difficult, but we had explicitly decided to
> > do the opposite when we finished MQ3. I am not sure if this change of
> > position reflects a change in opinion across the WG, or merely who was
> > attending this particular conf call.
> >
> > This is what we wrote about it back then:
> > http://www.w3.org/blog/CSS/2012/06/14/unprefix-webkit-device-pixel-ratio/
> >
> > Similarly, MDN advises against device-pixel-ratio in favor of resolution:
> > https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries#-moz-device-pixel-ratio
> >
> > As far as I know:
> > Gecko and Blink (and Presto) supports resolution, including the dppx unit.
> > IE has it without the dppx unit.
> > Webkit sticks to -webkit-device-pixel-ratio only
> >
> > Resolution is more interoperable than when we chose it as the path forward,
> > so I am not sure I understand why this is being reopened.
> >
> > At this stage, I think what is relevant is not some much anyone's (me
> > included) naming preference, but what browser vendors plan to do.
> 
> Agreed.  While the support for 'resolution' is relatively recent, it's
> still clearly the interoperable solution now, except for WebKit.  No
> reason to reopen this.
> 
> ~TJ
> 
> 


Received on Thursday, 14 November 2013 01:55:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:36 UTC