Re: [screen-orientation] Locking to 'current' orientation

On Mon, Dec 2, 2013 at 10:52 PM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Nov 26, 2013 9:17 AM, "Mounir Lamouri" <mounir@lamouri.fr> wrote:
> >
> > Hi,
> >
> > I got some requests from different organizations to add the ability to
> > lock to the 'current' orientation in the Screen Orientation API.
> >
> > >From Javascript, that would allow writing
> >   window.screen.lockOrientation('current');
> > instead of
> >   window.screen.lockOrientation(window.screen.orientation);
> > Basically, a syntax sugar.
>
> I don't care too much about this one. But syntax sugar for something
> that isn't really a very common operation seems excessive. Unless
> locking to current is something we really want to encourage?
>

The whole point is that the API must not allow locking to a particular
orientation at all, only to the current orientation.  Allowing web pages to
cause my phone to *switch* orientations is crazy.  (You'd end up with half
of the web locking to one orientation or another, because the page "looks
better that way", and you'll have the browser jumping between orientations
as you hit browser back, causing the browser UI itself to jump around.)

Locking to the current orientation deals with the use cases surrounding
gyro-based games, where you don't want the phone shifting orientations as
you move the device, without exposing something as insane as letting pages
actually force a particular orientation.

-- 
Glenn Maynard

Received on Tuesday, 3 December 2013 05:07:34 UTC