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

Re: User Agents Do Not Implement Absolute Length Units, Places Responsive Design in Jeopardy

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Thu, 27 Oct 2011 15:01:34 -0400
Message-ID: <4EA9AA8E.1090303@mit.edu>
To: www-style@w3.org
On 10/27/11 2:34 PM, Fran├žois REMY wrote:
> OK, I accept your argument. In fact, you just have transformed the problem
> from "we need to have physical units" to "let's make the pixel unit virtual
> to match a physical range". But then, how well must a "px" match 1/96 inch
> per dot ?

Good question.

> Can it be 1/120ipd? Can it be 1/180ipd?

The spec says:

  For such devices it is recommended that the pixel unit refer to the
  whole number of device pixels that best approximates the reference

which means that the answer depends on the size of the device pixels. 
It's also not a hard requirement.  But clearly, if this requirement is 
followed then 1/180ipd can't happen, because you'd just double your CSS 
pixel size and use 1/90ipd.... assuming the viewing distance is arms-length.

> I'm ready to accept that
> the size of a screen can remain unknown in the detail, but you should
> always
> have an order of magnitude available to help your adapt your layout.

I'm not sure what you mean here...

> Could it be possible for a website to specify a "target resolution"?

In what sense?

> <meta name="viewport" value="min-dpi: 80, max-dpi:120" />

"dpi" is a somewhat meaningless metric unless you know the viewing 
distance, no?  If not, what would be the use case?

> If the device's (approximative) dpi is in the desired range, the site is
> shown unzoomed. But if it doesn't fit the range, the zoom is computed to
> match as closely as possible the median value between the minimal and
> maximal dpi value (a physical snapping could be used to round translations
> like 1px -> 1.85physPixel to 1px -> 2physPixel).

I'm not sure what use case you're trying to address.  Could you explain 

> Even if there's a certain range of DPI I'm needing to care about instead of
> one, I can deal whit the fact an inch is a little bigger or smaller than
> one
> inch. But at least, I can test my website on a range of device and see it
> works well on those devices. But if a new "strange" device appear, it
> should
> do fine (or at least as fine as it is possible) because it tries to
> "emulate" the kind of devices I tested my website on.

That's the general idea, yes.

> To summarize, what I propose is to accept the fact there's an uncertainty
> but limit that uncertainty to an acceptable level to the developer.

That's what the current spec tries to do, within the level of 
capabilities of the device.

Received on Thursday, 27 October 2011 19:02:03 UTC

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