Re: Device Orientation specification co-editor

Hi Rob,

On Mon, Mar 24, 2014 at 5:28 AM, Rob Manson <roBman@buildar.com> wrote:
>
> Hey Rich,
>
>> FWIW, I think the current worked example included in the spec is
>> useful but a little hard to parse for developers. Here is a JavaScript
>> implementation of the worked example currently provided in the
>> specification:http://people.opera.com/richt/release/tests/orientation/spec_workedexample.html.
>>
>> It may be good to include accompanying JavaScript code for any
>> mathematical notation used.
>
> Yeah I think code version of the worked examples are very useful. Interestingly this doesn't work in iOS Safari 8(

iOS-based devices do not return 'absolute'
DeviceOrientationEvent.alpha values [1]. That is to say, iOS-based
browsers return an arbitrary value for DeviceOrientationEvent.alpha,
typically zero-centered in the direction in which the web page
initially started invoking Device Orientation Events (though not
necessarily so IIUC).

The fix for this is to replace the 'alpha' value passed in (in psuedo-code):

alpha = DeviceOrientationEvent.alpha

to:

alpha = 360 - DeviceOrientationEvent.webkitCompassHeading

for iOS-based browsers.

I filed an issue against the specification on if and how we should
incorporate this information in the specification itself [2] since it
is not clear if the Webkit-community will fix this based on previous
objections raised in [1]. Do feel free to file bugs on individual
browser bug trackers too of course :)

>
>> Perhaps we can clarify this with additional JavaScript examples being
>> added to the spec. Let us know what would you like to see.
>>
>
> Yep...putting together some more notes along with the 3D models.

Looking forward to your inputs.

FWIW, Tim and I have been working on a number of examples also. I'm
maintaining those tentative specification patches as branches on [3]
for now and patch reviews happen on [4]. This process seems to be
working well so far.

If you have spec inputs please do raise pull requests or issues
against the specification at [5] and we can then review them according
to the same process.

br/ Rich


[1] http://lists.w3.org/Archives/Public/public-geolocation/2011Jul/0014.html

[2] https://github.com/w3c/deviceorientation/issues/6

[3] https://github.com/richtr/deviceorientation

[4] https://github.com/w3c/deviceorientation/pulls

[5] https://github.com/w3c/deviceorientation

Received on Monday, 24 March 2014 08:47:06 UTC