ArchiveOrangemail archive

www-style.w3.org


(List home) (Recent threads) (200 other W3C lists)

Subscription Options

  • RSS or Atom: Read-only subscription using a browser or aggregator. This is the recommended way if you don't need to send messages to the list. You can learn more about feed syndication and clients here.
  • Conventional: All messages are delivered to your mail address, and you can reply. To subscribe, send an email to the list's subscribe (we seem to have lost it) address with "subscribe" in the subject line.
  • Moderate traffic list: up to 30 messages per day
  • This list contains about 27,282 messages, beginning Mar 2011
  • 35 messages added yesterday
Report the Spam
This button sends a spam report to the moderator. Please use it sparingly. For other removal requests, read this.
Are you sure? yes no

trying not to reopen the physical length units / DPI in resolution MQs thread but failing

Ad
Edward O'Connor 1335305186Tue, 24 Apr 2012 22:06:26 +0000 (UTC)
Hi,

An iPhone 4 has an actual resolution of 326dpi, whereas the new iPad has
a resolution of 264dpi. Yet, insofar as the resolution media query is
concerned, both devices have the same "resolution" (192 'dpi').

It makes me really sad that Web authors can't simply go to Wikipedia's
"List of displays by pixel density" page[1], cut and paste, and end up
with a stylesheet that does what they mean. We need to fix this.


Ted

P.S. While we're at it, I second Florian's suggestion (from several
months ago) that we adopt 'device-pixel-ratio' as an official media
query. It's easy to use; authors readily understand how to use it to
distinguish between Retina displays and low-DPI displays.

1. http://en.wikipedia.org/wiki/List_of_displays...
fantasai 1335307337Tue, 24 Apr 2012 22:42:17 +0000 (UTC)
On 04/24/2012 03:05 PM, Edward O'Connor wrote:
>
> P.S. While we're at it, I second Florian's suggestion (from several
> months ago) that we adopt 'device-pixel-ratio' as an official media
> query. It's easy to use; authors readily understand how to use it to
> distinguish between Retina displays and low-DPI displays.
>
> 1. http://en.wikipedia.org/wiki/List_of_displays...I don't understand how it's any better than resolution: 2ddpx;

~fantasai
Florian Rivoal 1335343890Wed, 25 Apr 2012 08:51:30 +0000 (UTC)
On Wed, 25 Apr 2012 00:39:00 +0200, fantasai  
 wrote:

> On 04/24/2012 03:05 PM, Edward O'Connor wrote:
>>
>> P.S. While we're at it, I second Florian's suggestion (from several
>> months ago) that we adopt 'device-pixel-ratio' as an official media
>> query. It's easy to use; authors readily understand how to use it to
>> distinguish between Retina displays and low-DPI displays.
>>
>> 1. http://en.wikipedia.org/wiki/List_of_displays...
>
> I don't understand how it's any better than resolution: 2ddpx;I proposed it when it wasn't clear that resolution meant the same thing.
Now that it does, and given a little time to make sure implementations
get it right and implement dppx, I think evangelists, tutorial writers
etc should switch from teaching device-pixel-ratio to teaching resolution.
Hopefully, authors will follow before long.

I am also toying with the idea of adding an informative note to CSS Media
queries (level 4) explaining how to map -*-device-pixel-ratio to
resolution.
Felix Miata 1335344916Wed, 25 Apr 2012 09:08:36 +0000 (UTC)
On 2012/04/25 10:50 (GMT+0200) Florian Rivoal composed:

> On Wed, 25 Apr 2012 00:39:00 +0200, fantasai wrote:

>>  I don't understand how it's any better than resolution: 2ddpx;

> I proposed it when it wasn't clear that resolution meant the same thing.
> Now that it does, and given a little time to make sure implementations
> get it right and implement dppx, I think evangelists, tutorial writers
> etc should switch from teaching device-pixel-ratio to teaching resolution.
> Hopefully, authors will follow before long.Hopefully the final spec will induce authors to clear the word resolution 
from their vocabularies and usage. They should be developing resolution 
independently. Resolution should not matter to authors any more than to 
anyone else, which is to say not at all beyond point of display purchase, 
where choosing the highest possible resolution should result in the highest 
quality results, rather than as it is now in most desktop cases at a penalty 
of what is in effect unzooming the entirety of the desktop.> I am also toying with the idea of adding an informative note to CSS Media
> queries (level 4) explaining how to map -*-device-pixel-ratio to
> resolution.
Maciej Stachowiak 1335347017Wed, 25 Apr 2012 09:43:37 +0000 (UTC)
On Apr 24, 2012, at 3:39 PM, fantasai  wrote:

> On 04/24/2012 03:05 PM, Edward O'Connor wrote:
>> 
>> P.S. While we're at it, I second Florian's suggestion (from several
>> months ago) that we adopt 'device-pixel-ratio' as an official media
>> query. It's easy to use; authors readily understand how to use it to
>> distinguish between Retina displays and low-DPI displays.
>> 
>> 1. http://en.wikipedia.org/wiki/List_of_displays...
> 
> I don't understand how it's any better than resolution: 2ddpx;
>There seem to be at least three advantages, if, perhaps, relatively minor ones.

1) 'device-pixel-ratio: 2' is more readily understandable - ddpx is a mysterious abbreviation.
2) device-pixel-ratio is deployed in existing content (albeit with a webkit prefix); declining to standardize it seems likely to increase the scope of the prefix problem.
3) device-pixel-ratio has actual deployment experience showing it is usable for its intended purpose.

In what way is 'resolution: 2ddpx' better?

Regards,
Maciej
fantasai 1335370336Wed, 25 Apr 2012 16:12:16 +0000 (UTC)
On 04/25/2012 02:40 AM, Maciej Stachowiak wrote:
>
> There seem to be at least three advantages, if, perhaps, relatively minor ones.
>
> 1) 'device-pixel-ratio: 2' is more readily understandable - ddpx is a mysterious abbreviation.
> 2) device-pixel-ratio is deployed in existing content (albeit with a webkit prefix); declining to standardize it seems likely to increase the scope of the prefix problem.
> 3) device-pixel-ratio has actual deployment experience showing it is usable for its intended purpose.
>
> In what way is 'resolution: 2ddpx' better?It doesn't add anything new. It uses an existing mechanism to do the same thing.

~fantasai
Maciej Stachowiak 1335374517Wed, 25 Apr 2012 17:21:57 +0000 (UTC)
On Apr 25, 2012, at 9:11 AM, fantasai  wrote:

> On 04/25/2012 02:40 AM, Maciej Stachowiak wrote:
>> 
>> There seem to be at least three advantages, if, perhaps, relatively minor ones.
>> 
>> 1) 'device-pixel-ratio: 2' is more readily understandable - ddpx is a mysterious abbreviation.
>> 2) device-pixel-ratio is deployed in existing content (albeit with a webkit prefix); declining to standardize it seems likely to increase the scope of the prefix problem.
>> 3) device-pixel-ratio has actual deployment experience showing it is usable for its intended purpose.
>> 
>> In what way is 'resolution: 2ddpx' better?
> 
> It doesn't add anything new. It uses an existing mechanism to do the same thing.I don't follow closely, so I may be misinformed, but isn't the dppx unit something new? It looks like it wasn't present in the Sept 11 Working Draft of Values & Units.

Regards,
Maciej
Florian Rivoal 1335375642Wed, 25 Apr 2012 17:40:42 +0000 (UTC)
On Wed, 25 Apr 2012 19:21:04 +0200, Maciej Stachowiak   
wrote:

>
> On Apr 25, 2012, at 9:11 AM, fantasai   
> wrote:
>
>> On 04/25/2012 02:40 AM, Maciej Stachowiak wrote:
>>>
>>> There seem to be at least three advantages, if, perhaps, relatively  
>>> minor ones.
>>>
>>> 1) 'device-pixel-ratio: 2' is more readily understandable - ddpx is a  
>>> mysterious abbreviation.
>>> 2) device-pixel-ratio is deployed in existing content (albeit with a  
>>> webkit prefix); declining to standardize it seems likely to increase  
>>> the scope of the prefix problem.
>>> 3) device-pixel-ratio has actual deployment experience showing it is  
>>> usable for its intended purpose.
>>>
>>> In what way is 'resolution: 2ddpx' better?
>>
>> It doesn't add anything new. It uses an existing mechanism to do the  
>> same thing.
>
> I don't follow closely, so I may be misinformed, but isn't the dppx unit  
> something new? It looks like it wasn't present in the Sept 11 Working  
> Draft of Values & Units.I am not completely sure when dppx was introduced, but it is not needed
for the functionality.

"resolution: 192dpi" is completely synonymous to "resolution: 2dppx"

The later one is more readable though.

  - Florian
Tab Atkins Jr. 1335396588Wed, 25 Apr 2012 23:29:48 +0000 (UTC)
On Wed, Apr 25, 2012 at 10:21 AM, Maciej Stachowiak  wrote:
> On Apr 25, 2012, at 9:11 AM, fantasai  wrote:
>> On 04/25/2012 02:40 AM, Maciej Stachowiak wrote:
>>>
>>> There seem to be at least three advantages, if, perhaps, relatively minor ones.
>>>
>>> 1) 'device-pixel-ratio: 2' is more readily understandable - ddpx is a mysterious abbreviation.
>>> 2) device-pixel-ratio is deployed in existing content (albeit with a webkit prefix); declining to standardize it seems likely to increase the scope of the prefix problem.
>>> 3) device-pixel-ratio has actual deployment experience showing it is usable for its intended purpose.
>>>
>>> In what way is 'resolution: 2ddpx' better?
>>
>> It doesn't add anything new. It uses an existing mechanism to do the same thing.
>
> I don't follow closely, so I may be misinformed, but isn't the dppx unit something new? It looks like it wasn't present in the Sept 11 Working Draft of Values & Units.At the time it was only defined in Image Values, as that is where it
was introduced.

It's been in the V&U Editor's Draft for some time, and is present in
the current Working Draft (published in early March).  Why are you
referring to the Sep 2011 WD?

~TJ
Maciej Stachowiak 1335404084Thu, 26 Apr 2012 01:34:44 +0000 (UTC)
On Apr 25, 2012, at 4:27 PM, Tab Atkins Jr.  wrote:

> On Wed, Apr 25, 2012 at 10:21 AM, Maciej Stachowiak  wrote:
>> On Apr 25, 2012, at 9:11 AM, fantasai  wrote:
>>> On 04/25/2012 02:40 AM, Maciej Stachowiak wrote:
>>>> 
>>>> There seem to be at least three advantages, if, perhaps, relatively minor ones.
>>>> 
>>>> 1) 'device-pixel-ratio: 2' is more readily understandable - ddpx is a mysterious abbreviation.
>>>> 2) device-pixel-ratio is deployed in existing content (albeit with a webkit prefix); declining to standardize it seems likely to increase the scope of the prefix problem.
>>>> 3) device-pixel-ratio has actual deployment experience showing it is usable for its intended purpose.
>>>> 
>>>> In what way is 'resolution: 2ddpx' better?
>>> 
>>> It doesn't add anything new. It uses an existing mechanism to do the same thing.
>> 
>> I don't follow closely, so I may be misinformed, but isn't the dppx unit something new? It looks like it wasn't present in the Sept 11 Working Draft of Values & Units.
> 
> At the time it was only defined in Image Values, as that is where it
> was introduced.
> 
> It's been in the V&U Editor's Draft for some time, and is present in
> the current Working Draft (published in early March).  Why are you
> referring to the Sep 2011 WD?Because I wanted a quick way to to see when it was added. I'm unable to readily tell when it was first added to Image Values.

For comparison, device-pixel-ratio was first implemented as a vendor extension in 2006[1] and exists (prefixed) in at least WebKit, Presto and Gecko. So I wondered why device-pixel-ratio counts as "add[ing] anything new" but the dppx unit does not. I don't follow closely, so maybe there is some reason for diverging from content and implementations here.

Regards,
Maciej

[1] http://www.webkit.org/blog/55/high-dpi-web-si...
Edward O'Connor 1336646030Thu, 10 May 2012 10:33:50 +0000 (UTC)
Authors need to be able detect when (and how) CSS pixels differ from
device pixels. The most straightforward way to give them this ability is
to directly expose this in a media query. This is what WebKit does with
its  -webkit-device-pixel-ratio media query.

It's also—separately—useful for authors to be able to distinguish
between displays of different resolution. Consider the iPhone 4 and the
new iPad. Both devices' CSS-to-device pixel ratio is 2. But the
resolution of these displays is quite different (326dpi and 264dpi,
respectively). Authors should be able to distinguish these two displays
in a media query.

Yes, these screens have different pixel dimensions, so authors can use a
width or height media query to distinguish between them. But I think
it's best if authors can express their *intent* in the media query they
use. Using a width media query expresses the author's intent to style
things differently on wider or narrower displays, whereas using a
resolution media query should express an intent to style things
differently on displays that have different resolutions.

It's really, profoundly weird to me that the media query named
"resolution" doesn't do this, but is instead a strangely-named and
strangely-valued synonym of device-pixel-ratio. It's weird that the
resolution media query's meaning has essentially nothing to do with the
plain English meaning of the word "resolution."

Not only is this weird, authors and developers in the wild don't and
won't understand this. For instance, consider this email[1] to
webkit-dev from Eric Seidel, a core WebKit developer. He—completely
reasonably—assumes that 

            @media screen and (min-resolution: 264dpi) { … }

would match on both the new iPad and the iPhone 4 & 4s. But it doesn't!
As far as the resolution media query is concerned, both of thesedisplays have a resolution of 192dpi. Let me quote what I said in the
initial email on this thread:

>> It makes me really sad that Web authors can't simply go to
>> Wikipedia's "List of displays by pixel density" page[2], cut and
>> paste, and end up with a stylesheet that does what they mean. We
>> need to fix this.fantasai replied:> I don't understand how [device-pixel-ratio: 2] is any better than
> resolution: 2ddpx;As currently defined, these both do the same thing. I agree that we need
a media query to do this—to detect the relationship of CSS pixels and
device pixels—but I think naming such a media query "resolution" is a
mistake. Also, as Maciej pointed out, ddpx is much less understandable
to people unfamiliar with it.


Ted

1. https://lists.webkit.org/pipermail/webkit-dev...
2. http://en.wikipedia.org/wiki/List_of_displays...
Øyvind Stenhaug 1336656005Thu, 10 May 2012 13:20:05 +0000 (UTC)
On Thu, 10 May 2012 12:31:16 +0200, Edward O'Connor   
wrote:

> fantasai replied:
>> I don't understand how [device-pixel-ratio: 2] is any better than
>> resolution: 2ddpx;
>
> As currently defined, these both do the same thing. I agree that we need
> a media query to do this—to detect the relationship of CSS pixels and
> device pixels—but I think naming such a media query "resolution" is a
> mistake. Also, as Maciej pointed out, ddpx is much less understandable
> to people unfamiliar with it.It's dppx, of course, not ddpx. Being familiar with the "px" unit and  
knowing what e.g. "dpi" stands for, I don't find it hard to figure out (or  
remember) what "dppx" means. I don't find the term "device-pixel-ratio"  
more readily understandable at all. A ratio of what, to what?
fantasai 1335307337Tue, 24 Apr 2012 22:42:17 +0000 (UTC)
On 04/24/2012 03:05 PM, Edward O'Connor wrote:
>
> P.S. While we're at it, I second Florian's suggestion (from several
> months ago) that we adopt 'device-pixel-ratio' as an official media
> query. It's easy to use; authors readily understand how to use it to
> distinguish between Retina displays and low-DPI displays.
>
> 1. http://en.wikipedia.org/wiki/List_of_displays...I don't understand how it's any better than resolution: 2dppx;

~fantasai
Florian Rivoal 1335345025Wed, 25 Apr 2012 09:10:25 +0000 (UTC)
On Wed, 25 Apr 2012 00:05:06 +0200, Edward O'Connor   
wrote:

> An iPhone 4 has an actual resolution of 326dpi, whereas the new iPad has
> a resolution of 264dpi. Yet, insofar as the resolution media query is
> concerned, both devices have the same "resolution" (192 'dpi').
>
> It makes me really sad that Web authors can't simply go to Wikipedia's
> "List of displays by pixel density" page[1], cut and paste, and end up
> with a stylesheet that does what they mean. We need to fix this.When the dppx unit gets wide support, I believe it will be the prefered
unit to express resolution media queries. And with that unit, it becomes
very clear what resolution does and does not tell you.

For instance, resolution is a good media query to use to figure out if
you should to provide high resolution images to make things as crisp as
possible.

Trying to use resolution to find out if you should make the text bigger
to deal with hight resolution screens is misguided. If the css pixel
didn't solve that problem for you, it would be interesting to get the
physical dots per physical inches, but it does.

  - Florian
Ad
Home | About | Privacy