[Webkit-unassigned] [Bug 53707] Viewport Warning/Error Messages Are Now Inaccurate

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 3 11:23:08 PST 2011


--- Comment #32 from Kenneth Rohde Christiansen <kenneth at webkit.org>  2011-03-03 11:23:07 PST ---
(In reply to comment #29)
> (In reply to comment #28)
> > For instance on the iPhone 4, if im not wrong, device-width will
> > report 320, there in reality it is 640. ie, 640 / 2.0 = 320.
> > 
> > The Android extensions makes it possible to avoid this upscaling of the
> > contents, by setting target-densitydpi = device-dpi, so we need to make
> > sure that is parsed at this time.
> That is an interesting point. So, given that, we would need to wait until
> both the target-densitydpi and width are parsed, so essentially after
> the entire meta tag parsing? Is that really necessary.
>   <meta name="viewport" content="width=320, target-densitydpi=2.0">
>   <meta name="viewport" content="target-densitydpi=2.0, width=320">
> With target-densitydpi does the "device-width" constant ever change,
> or does it just change its effective value?

In the above case it is not necessary as you are using fixed values. But in the case of using device-width is it.

<meta name="viewport" content="width=device-width, target-densitydpi=160">

on a 480 wide device substitutes device-width with 320, due to the higher dpi of 240, where as 

<meta name="viewport" content="width=device-width, target-densitydpi=240">

substitutes device-width with 480.

The target-densitydpi only affects device-width and device-height substitution as well as sets the pixelRatio (target-densitydpi / 160; default is 160).

Google calls a pixel at 160 DPI a density independent pixel. The fact is that the original iPhone has a DPI of 160 which resulted in everyone adapting their web pages and web apps to that. On a phone with a higher DPI such as 240 the buttons etc become too small, so they are scaled up. Even the iPhone 4 scaled everything up with 2.0 when there is a viewport meta tag present.

With the target-densitydpi features, it is possible to actually take advantage of the increased DPI by for instance disabling the upscaling and using different CSS using media queries such as @media all and (-webkit-pixel-ratio... ) { }

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list