Background: Mobile devices have much less screen real-estate than
desktop computers. Many traditional websites expect viewports that are
wider than O(400px), though. That's why mobile browsers typically
render pages to viewports that are much bigger (O(1000px)) and
initially present them zoomed out (if necessary). The user can then
zoom in as they wish. For web apps that *are* optimized for small
screen real estate, Apple originally added the <meta name=viewport>
directive to Mobile Safari for letting the app control various
viewport properties such as initial size and scale as well as
zoomability. This has since been adopted by all major mobile browsers,
including Fennec and is kind of a de-facto standard, for better or for
worse. See e.g.
https://developer.mozilla.org/en/Mobile/Viewport_meta_tag and
http://www.quirksmode.org/blog/archives/2012/07/webkit_as_defac.html
In B2G we are now faced with the following questions:
(a) in which cases should we support <meta name=viewport>?
(b) what should the default viewport settings be?
If Fennec supports <meta name=viewport>, there's a strong case to be
made that browser windows in B2G should too. This presumably means it
should apply to <iframe mozbrowser> as used in browser tabs and, when
sites are "bookmarked" to the homescreen somehow, also to their
<iframe mozbrowser> containers. Basically, whenever we show "regular"
websites, we should be on par with Fennec.
A more open question is whether beyond that it should apply to <iframe
mozbrowser mozapp> elements, in other words, apps that have been
installed as such.
I can come up with the following pros and cons:
Pro:
* We've been promoting Open Web Apps as a very lightweight mechanism
around already existing web apps. Rendering them differently depending
on whether they're installed or running in a browser could be
interpreted as breaking the promise that essentially reads "B2G apps
=== web apps".
* With <meta name=viewport> being part of the defacto mobile web,
mobile web app developers would presumably expect it to work on B2G.
Con:
* <meta name=viewport> is a non-standard hack that is better served by
e.g. the @viewport CSS rule
http://dev.w3.org/csswg/css-device-adapt/.
We should allow regular web content to function for now, as we do in
Fennec, but not promote it as part of our app stack.
Thoughts? More pros/cons?
P.S.: The implementation is being tracked at
https://bugzilla.mozilla.org/show_bug.cgi?id=746502.