W3C home > Mailing lists > Public > www-style@w3.org > August 2010

Re: CSS Viewport proposal

From: Kenneth Christiansen <kenneth.christiansen@openbossa.org>
Date: Mon, 9 Aug 2010 14:02:23 -0300
Message-ID: <AANLkTikPf_Jtpfa+SjWAfb6_=cnr=0xge=vd9uKG0jU-@mail.gmail.com>
To: Rune Lillesveen <rune@opera.com>
Cc: www-style list <www-style@w3.org>
Basically the ratio is calculated, and the default DPI is considered
to be 160 which I guess is the DPI on the first iPhone and Android
devices.

With a DPI of 160 no scaling is needed. On the other hand if you have
a device such as the newer Android devices or the Nokia N900, if no
DPI is set, a scale of 1.5 is applied (Fennec does this on the N900 as
well), due to the DPI of the device being 240.

This is reflected via the -webkit-device-pixel-ratio media feature.

Instead of doing the scaling, the web developer can set
target-densitydpi to device-dpi (240 in the above case) in which no
scale is applied. This means that a initial-scale of 1.0 is actually
1.0 and not 1.5 as if the target-densitydpi was left out.

The list of options for target-densitydpi are as follows (copied from
Android changelog):

device-dpi:    Use the device's native dpi as target dpi.
low-dpi:       120dpi
medium-dpi:    160dpi, which is also the default as of today
high-dpi:      240dpi
<number>:      We take any number between 70 and 400 as a valid target dpi.

Cheers,
Kenneth

>> You should also consider adding the Android targetdpi extension.
>
> Perhaps. So how would you go about using that? In combination with the
> resolution media feature?
>
> I kind of see the point of using physical pixels for the intrinsic size of
> images.
>
> Will people complain about breaking with the specification of a CSS pixel?
>
> --
> Rune Lillesveen
> Senior Core Developer / Architect
> Opera Software ASA
>



-- 
Kenneth Rohde Christiansen
Technical Lead / Senior Software Engineer
Qt Labs Americas, Nokia Technology Institute, INdT
Phone  +55 81 8895 6002 / E-mail kenneth.christiansen at openbossa.org
Received on Monday, 9 August 2010 17:02:59 GMT

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