RE: Supporting Portrait-First and Landscape-First devices in HTML5 Device Orientation

On Aug 15, 2013 5:11 PM, "Dhruv Chadha" <Dhruv.Chadha@microsoft.com> wrote:
>
> Tab,
>
> We sympathize with the goal of creating a simple programming model for
developers but we don’t believe that is what is currently specified on the
device and screen orientation specs (as we stated in our earlier response
to Jonas).  Our proposal maps existing native implementations done by iOS,
Android, and Windows.  These native APIs provide capabilities to discover
the native orientation of the device and to remap the coordinate system
based on the user selected orientation.
>
> We believe that mapping the coordinates to the current screen orientation
would generate the following issues:
> - Changes the design of the API as defined by current draft of the device
orientation spec and will break interoperability with current
implementations

I agree this is a problem.

> - If the browser’s orientation is not locked, rotating the device would
reset the coordinates back to 0 in the reference axis for each 90 degree
rotation since the browser App UI would rotate as well

Why is this bad? Maybe I'm not understanding the concern?

> - Does not provide flexibility.  What happens if the developer is not
interested in automatically re-mapping the coordinate system?  They
wouldn’t have an ability to change this behavior.

What are the use cases for wanting to allow the screen to reorient while at
the same time not adjusting the coordinate system? Are these use cases more
common than the cases where you would want to adjust the coordinate system?

A potential solution is to add a separate set of events exactly like the
current DeviceOrientation events, but that are relative to the screen
orientation rather than the device orientation. Sadly that might be the
only way to keep compatibility with existing deployed implementations,
while still keeping a decent API.

> - the alpha value (+Z) for device orientation should always be aligned to
the input from the compass (i.e. hardware sensors) unless the developer
requests a re-mapping

I don't understand this. Could you provide an example or describe in more
detail?

/ Jonas

Received on Friday, 16 August 2013 03:04:19 UTC