add "orientation" to Widgets: P&C

Expressing a preferred starting orientation is a common use case for web apps; the Mozilla proposal includes this[1], as does the PhoneGap implementation of Widgets:P&C (using Preferences)[2]. 

Outside of mobile, we also have a use case for portal applications built with Apache Rave, where we may want to place a widget into a page region depending on whether it would better suit a wide or narrow region in the layout.

Orientation also already exists as a Media Feature[3]; there are two valid values of the orientation media feature, 'portrait' and 'landscape':

"The ‘orientation’ media feature is ‘portrait’ when the value of the ‘height’ media feature is greater than or equal to the value of the ‘width’ media feature. Otherwise ‘orientation’ is ‘landscape’."

PhoneGap also has "default", however this doesn't actually mean "default" but " enable both":

"please note that default means both landscape and portrait are enabled. If you want to use each platform's default settings (usually portrait-only), just remove this tag from your config.xml"

So orientation can refer to either or both of the preferred starting orientation of the web app, and the orientations enabled for the web app.

I suggest an orientation property with the following semantics:

orientation = "portrait" // enable portrait only
orientation = "landscape" // enable landscape only
orientation = "portrait landscape" // enable both, start in portrait by default
orientation = "landscape portrait" // enable both, start in landscape by default
orientation = "both" // enable both portrait and landscape orientation, start in current user agent orientation
[no value] // use user agent defaults

This could be added to Widgets:P&C as an attribute of the widget element; this would also need to be harmonized in the mozilla proposal. Alternatively, this could be developed as a standalone spec usable by both, a bit like VMMF[4].

-S

[1] https://people.mozilla.com/~anarayanan/webapps.html
[2] https://build.phonegap.com/docs/config-xml
[3] http://www.w3.org/TR/css3-mediaqueries/#orientation
[4] http://www.w3.org/TR/view-mode/

Received on Wednesday, 20 June 2012 06:34:44 UTC