[webkit-dev] Default viewport value on WAP DTDs

Hugo Parente Lima hugo.lima at openbossa.org
Thu May 3 13:46:26 PDT 2012


Hi,

I was pointed to trigger a discussion here about the patch:

https://bugs.webkit.org/show_bug.cgi?id=85425

I'll try to resume to issue:

If no viewport is specified webkit uses the magic and well know value of 980 
pixels for the canvas width, this value is very good for most websites 
developed for desktop usage, on the other side there are the websites[1] 
developed for small screen mobile devices. Those websites will look pretty 
ugly on a 980 pixels canvas, many of those websites uses a different DTD like:

<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" 
"http://www.wapforum.org/DTD/xhtml-mobile10.dtd">

The proposed patch changes the magic value of 980 pixels to "device-width" 
when this doctype is found causing the website to render nicely if the device 
screen is small, i.e. don't show the website in a 980 pixels canvas zoomed out 
to fit the <980 pixels screen.

Some webkit browsers already use this hack, like the N9 browser and if I 
understood correctly by the Zalan comments on the bug, the iOS Safari too.

Comments about why the viewport width should or shouldn't be changed by the 
doc type is appreciated. Thanks!

Regards
Hugo Parente Lima

[1] http://m.yahoo.com; http://www.google.com (using a user agent like: "Nokia 
7110/1.0")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20120503/e755d2c0/attachment.bin>


More information about the webkit-dev mailing list