[webkit-dev] Double-Resolution (Retina) Images - Re: -webkit-image-set

Chris Hutten-Czapski chutten at rim.com
Wed Apr 25 10:23:26 PDT 2012


>> Assuming I'm understanding Kalle correctly, it seems this could
>> already be accomplished with @media resolution?
>>
>> http://www.w3.org/TR/css3-mediaqueries/#resolution

Not to be too cute about it, but CSS dpi is _always_ 96 CSS pixels per CSS inch. What this means onscreen is (almost) completely up to the user-agent. This is (potentially) why the resolution media query is defined (via the very link above) to only work for bitmap media types, not screen.

Dealing with hardware that has a screen dpi much higher than what CSS prescribes for a device at its viewing distance (viewing distance matters: http://www.w3.org/TR/css3-values/#reference-pixel ) is a hard problem, and is one that is being discussed at length on the previously-mentioned threads and elsewhere. 

The iPhone seems to handle it by introducing a third type of pixels between hardware and CSS (a device/density-independent-pixel, or dip) that allows them to pretend that even the new iPhone has only 320px of width in portrait. BlackBerry has done other things at various times, currently taking advantage of dpi scaling (a little of which you can see in BlackBerry::WebKit::WebPagePrivate::recomputeVirtualViewportFromViewportArguments ). Android and Chrome-for-Android also have congruent practices, even exposing some of it to authors using target-densitydpi.

Using HTML attributes and CSS properties to offload the effort of supporting multiple densities to the author from the user-agent might be the best way to solve this problem. I'm not as conversant in all the points as I feel I'd need to be to render a full opinion, but my uneducated opinion is that this sounds kinda hackish. 

Regardless, this indeed seems like it should be discussed by the standards bodies, not webkit-dev.

Style,

Chris H-C

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.


More information about the webkit-dev mailing list