CSS Device Adaptation and legacy meta tags and doctypes

Hi there,

Following a discussion on webkit-dev [1], we would like to have added
a nomative section in the CSS Device Adaptation spec [2], specifying
how to handle legacy viewport tags, such as HandheldFriendly.

The spec already briefly talks about XHTML-MP in the following:

"Certain DOCTYPEs (for instance XHTML Mobile Profile) are used to recognize
mobile documents which are assumed to be designed for handheld devices, hence
using the viewport size as the initial containing block size."

The Nokia N9 browser, WP7 Internet Explorer and Android already
implement such support. And testing shows that iOS at least does
similar things for XHTML-MP.

The IE team even has a blog post explaining how it works [3]

Basically there is a priority:

XHTML-MP doctype (overrides default configuration)
HandheldFriendly meta tag (overrides XHTML-MP doctype)
MobileOptimized (overrides HandheldFriendly, etc)
viewport (overrides MobileOptimized etc)

The XHTML-MP doctype would correspond to the following viewport meta
tag: <meta name="viewport" content="width=device-width,
height=device-height, initial-scale=1">

The same counts for HandheldFriendly (and MobileOptimized, in the case
the content attribute is missing or not parseable)

Else <meta name="MobileOptimized" content="320"> would to correspond
to  <meta name="viewport" content="width=320, initial-scale=1">

Cheers,
Kenneth

[1] http://thread.gmane.org/gmane.os.opendarwin.webkit.devel/20536
[2] http://www.w3.org/TR/css-device-adapt/
[3] http://blogs.msdn.com/b/iemobile/archive/2010/11/22/the-ie-mobile-viewport-on-windows-phone-7.aspx

-- 
Kenneth Rohde Christiansen
Senior Engineer
Nokia Mobile Phones, Browser / WebKit team
Phone  +45 4093 0598 / E-mail kenneth at webkit.org

http://codeposts.blogspot.com ﹆﹆﹆

Received on Wednesday, 9 May 2012 10:50:39 UTC