W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2012

Re: [screen-orient] Updated editor draft

From: Jonas Sicking <jonas@sicking.cc>
Date: Mon, 5 Nov 2012 14:37:09 -0800
Message-ID: <CA+c2ei-0PBpYcRZNoT7z9tgbtRa5y8DHvKfYkM-pPH-JvYhagQ@mail.gmail.com>
To: Lars Knudsen <larsgk@gmail.com>
Cc: Mounir Lamouri <mounir@lamouri.fr>, WebApps WG <public-webapps@w3.org>
On Mon, Nov 5, 2012 at 9:19 AM, Lars Knudsen <larsgk@gmail.com> wrote:
> Why not use the existing definitions in the orientation change event?
>
> http://developer.apple.com/library/ios/#documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html#//apple_ref/doc/uid/TP40006511-SW16
>
> simple "landscape" and "portrait" can always be deducted from the values -
> but you have more precise info.  This is also possible to map to/from
> accelerometer data if needed.
>
> (speaking as a web demos/apps/games developer).
>
> code quote:
>
> switch(window.orientation)
>                 {
>                     case 0:
>                         displayStr += "Portrait";
>                     break;
>
>                     case -90:
>                         displayStr += "Landscape (right, screen turned
> clockwise)";
>                     break;
>
>                     case 90:
>                         displayStr += "Landscape (left, screen turned
> counterclockwise)";
>                     break;
>
>                     case 180:
>                         displayStr += "Portrait (upside-down portrait)";
>                     break;
>
>                 }


This is only true on devices whose "main orientation" is portrait
mode. At least on some devices which have the normal mode of operation
being in landscape mode, the above returns flipped values.

/ Jonas
Received on Monday, 5 November 2012 22:38:07 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:55 GMT