[whatwg] Features for responsive Web design

=?GB2312?Q?Kornel_Lesi=A8=BDski?= kornel at geekhood.net
Thu Aug 9 02:29:17 PDT 2012

On 8 sie 2012, at 12:57, "Florian Rivoal" <florianr at opera.com> wrote:

>>> Is there a good reason to believe that * will be something other than a
>>> power of two?
>>> That is, could we just optimize the *x syntax away and specify that the
>>> first option is 1x, the second is 2x, the third is 4x, etc.?
> If you look at mobile phones, there are a bunch of existing devices with
> 1.5 device pixel per css pixel, and also some with 2.25, so I don't
> think we can assume only powers of 2 will be used.

Pixel-perfect design for non-integer scaling ratios is very hard. To have evenly thin lines (1 device pixel wide) on such screens you have to use fractional CSS pixel sizes, and fractions need to be different for different scaling ratios. 

I don't think anybody will take advantage of that. IMHO non-integer ratios are a mistake that can/will be corrected. 

Fractional ratios have proven to be unnecessary: on desktops 1x CSS pixel changed from 72dpi (CRT) to 130dpi on notebook screens, but we haven't got fractional scaling ratios along the way. Variability in screen sizes and actual DPI has been accepted. The same can happen with 1.5x-2.5x screens: pretend they all are 2x, vary CSS pixel width/height, accept physical size of CSS pixel will be slightly different.

For example the 2.25 ratio doesn't make sense to me. 12.5% increase in screen density is going to be imperceptible. A better solution would be to use the crisp 2x ratio and have bigger screen area (in CSS pixels).

For mobile browsers which have zoom it's easy as they can pretend to have 2x scaling ratio on a virtual viewport and resize it to screen of any other density.

That's what "Retina" MacBook Pro does with whole screen when user requests screen resolution that isn't 1:1 with screen pixels.

You can see from previous OS X releases that Apple has struggled with implementation of fractional scaling ratios for years and has given up on them.

It's going to be easier to stick to 2x screens (like most desktop monitors settled on ~100dpi) or use "fake" 2x (scaled viewport) than expect authors to make pixel-perfect designs for 1.25, 1.5, 1.75, 2.25, etc. 

regards, Kornel

More information about the whatwg mailing list