incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Maj <>
Subject Re: navigator.orientation API + tests
Date Tue, 13 Mar 2012 20:07:18 GMT
Pretty sure iOS is the only platform with this implementation.

On 3/13/12 12:40 PM, "Shazron" <> wrote:

>I just realize the resize event will only work for iOS if we throw out
>the concept of there being two types of Landscape and Portrait
>(LandscapeLeft, LandscapeRight, Portrait and PortraitUpsideDown) which
>exist with the current window.orientation. Are the two types of
>Landscape and Portrait only used in iOS, what about BB and Android, or
>On Tue, Mar 13, 2012 at 10:28 AM, Filip Maj <> wrote:
>> Certainly works on Android and at least on the Torch (BBs with an
>> accelerometer)
>> On 3/13/12 10:21 AM, "Shazron" <> wrote:
>>>Is that what Android / BB does and is reliable and tested?
>>>On Tue, Mar 13, 2012 at 9:15 AM, Filip Maj <> wrote:
>>>> I don't think we need to jump on supporting the new
>>>> (DeviceOrientation/Motion) events in the cordova API right away.
>>>> As a first step I would simply remove the tests for
>>>> As for replacing it: you can attach to the "resize" event on window,
>>>> compare the screen width vs. screen height to figure out what
>>>> the device is in.
>>>> On 3/13/12 9:02 AM, "Shazron" <> wrote:
>>>>>If we go ahead with removing iOS < 4.2 support, the backfilling of
>>>>>support of the two events in JS can be removed:
>>>>>I'll let others chime in about removing window.orientation in iOS
>>>>>before adding an issue in jira.
>>>>>If we remove it, here are my recommendations:
>>>>>   1) Remove iOS < 4.2 support in Cordova
>>>>>   2) Write docs regarding what replaces window.orientation, and how
>>>>>to use the new event(s) to detect simple orientation changes
>>>>>On Tue, Mar 13, 2012 at 8:40 AM, Shazron <> wrote:
>>>>>> The iOS window.orientation and orientationchange event items (which
>>>>>> are not W3C, and has been in iOS since 1.1) was to support these
>>>>>> features in a UIWebView which came for free in Mobile Safari.
>>>>>> description is here:
>>>>>> Apple already supports the DeviceMotionEvent and
>>>>>> DeviceOrientationEvents in iOS 4.2 (which we backfill support for
>>>>>> older iOS versions) and those are W3C drafts are I believe.
>>>>>> Also those two events are not exact replacements for
>>>>>> window.orientation - we would need to have to have equivalents /
>>>>>> educate users on how to map the event values to the appropriate
>>>>>> window.orientation ones.
>>>>>> Shaz
>>>>>> On Tue, Mar 13, 2012 at 8:19 AM, Filip Maj <>
>>>>>>> Hey all,
>>>>>>> In mobile-spec we have a series of tests checking an API available
>>>>>>>navigator.orientation [1]. From what I can tell / remember, this
>>>>>>>something that we support as a legacy, as neither Android or
>>>>>>>have it but I believe there are leftovers in iOS (before cordova-js
>>>>>>>integration) that still have this API.
>>>>>>> I do not think it is based on any W3C spec. The closest thing
>>>>>>>find is something the Geolocation Working Group are drafting up,
>>>>>>>event called device orientation [2].
>>>>>>> My thinking is, remove this API completely. It is not part of
>>>>>>>documentation and as far as I can tell only iOS supports it right
>>>>>>>Instead, set new tasks to implement the W3C deviceorientation
>>>>>>>perhaps come up with a simpler, synchronous API of our own!).
>>>>>>> Thoughts?

View raw message