Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add screen-adjusted device orientation attributes to DeviceOrientationEvent interface #10

Closed

Conversation

richtr
Copy link
Member

@richtr richtr commented Aug 28, 2014

Add screenAlpha, screenBeta and screenGamma attributes to the DeviceOrientationEvent interface.

This spec addition was proposed and discussed on the W3C WebApps mailing list at http://lists.w3.org/Archives/Public/public-webapps/2014JulSep/0203.html. Mozilla have expressed support to implement this and we have a patch ready for Chromium for this also (pending addition of these attributes to the spec).

@richtr richtr changed the title Add screen-adjusted device orientation attributes to DeviceOrientation Event objects Add screen-adjusted device orientation attributes to DeviceOrientationEvent interface Aug 28, 2014
@anssiko
Copy link
Member

anssiko commented Aug 20, 2018

Generic Sensor API defines a local coordinate system that can be either the device coordinate system or the screen coordinate system.

The Accelerometer, Gyroscope, and Magnetometer specifications that decompose the DeviceOrientationEvent and DeviceMotionEvent into low-level primitives as well as the fusion sensor Orientation Sensor use these concepts, and allow the web developer to define whether the local coordinate system is to be bound to the device coordinate system or the screen coordinate system addressing this issue.

https://w3c.github.io/accelerometer/#enumdef-accelerometerlocalcoordinatesystem
https://w3c.github.io/gyroscope/#enumdef-gyroscopelocalcoordinatesystem
https://w3c.github.io/magnetometer/#enumdef-magnetometerlocalcoordinatesystem
https://w3c.github.io/orientation-sensor/#enumdef-orientationsensorlocalcoordinatesystem

Proposal: Since the Generic Sensor-based APIs now provide a modern API surface that satisfies this requirement, close this PR and do not add this new feature to the DeviceOrientation Event spec. Any concerns, please let us know in the PR comments.

@anssiko
Copy link
Member

anssiko commented Sep 6, 2018

Hearing no concerns, it looks like this issue can be closed.

But before closing, I'd like to get feedback whether we should add some informative text along the following lines to the DeviceOrientation Event spec:

Web developers looking to define whether the sensor readings are to be resolved in relation to the screen or the device orientation are advised to consult the Accelerometer, Gyroscope, and Magnetometer specifications that decompose the DeviceOrientationEvent and DeviceMotionEvent into low-level primitives as well as the fusion sensor Orientation Sensor. These specifications specify a local coordinate system that can be either the device coordinate system or the screen coordinate system.

@TolMera
Copy link

TolMera commented Sep 6, 2018

Informative text would be useful yes, however an example jsfiddle or something of that nature that would allow someone to see when their local device does not resolve in the expected manner would be extra useful, thought this probably falls outside the scope of what you may want to provide here. Not all browsers/devices allow resolution of orientation information in a uniform manner, so I would have myself supported the concept of a "screenAlpha et al"

@anssiko
Copy link
Member

anssiko commented Sep 6, 2018

@TolMera, thanks for the feedback! Couple of alternatives building upon the existing work:

  • Add local coordinate system tests in the cross-browser test suite (e.g. https://wpt.fyi/results/gyroscope) (source) for this feature. Looping in @Honry to check. To be able to automate this, probably need an extension to the WebDriver API too.

  • Add a new test to the Sensor tester (source) tool that is built exactly for this, running functional tests.

Contributions welcome!

@Honry
Copy link

Honry commented Sep 7, 2018

@anssiko, actually we've been working on these,

Maybe @rakuco would like to help review, friendly ping. :)

@reillyeon
Copy link
Member

Discussed at Devices and Sensors WG Face-to-face at TPAC 2018. Closing this issue as we are not adding new features that are not implemented by any vendor.

@reillyeon reillyeon closed this Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants