Closed Bug 716173 Opened 8 years ago Closed 8 years ago

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED INVALID

People

(Reporter: nhirata, Assigned: dougt)

References

()

Details

(Keywords: dev-doc-complete, Whiteboard: regression)

Attachments

(2 files)

1. go to http://www.html5rocks.com/en/tutorials/device/orientation/deviceorientationsample.html on Firefox
2. tilt the macbook pro

Expected: the html5 logo will move in some fashion
Actual: doesn't move

Note:
1. Nightly 12.0a1 (2012-01-04), Mac 10.6.8
2. I tried it on mobile, it only detects landscape/portrait, it doesn't tilt the logo. (Android Aurora 20120106, Nexus S, 2.3.1)
3. On chrome (16.0.912.75) it works as expected on the macbook pro
The page does some capability sniffing and whatnot....

In our case, it adds a listener for the "deviceorientation" event, but I don't see the listener ever fire.  Should it fire?

As far as mobile goes, the page doesn't use a 3d transform for Gecko, unlike WebKit, so you won't get any logo-tilting there; the best you can hope for is logo rotation.
(http://www.html5rocks.com is in general Chrome only demo site.)

I don't know on which devices we support deviceorientation. Dougt?
Duplicate of this bug: 728285
As noted in the dupe bug: On a mac book pro the MDN docs (https://developer.mozilla.org/en/detecting_device_orientation) fail to describe how to properly use the api. An online demo (http://sandbox.juurlink.org/accelerometer/) seem to fail while being supported on current gen Chrome. The website claims to work on firefox 3.6+ but it is failing on aurora (12). I am using a mac book pro which seems to have traditionally supported this feature.
This looks like a regression from bug 615597, based on bisecting on nightlies.  That bug changed the callee (nsAccelerometer::AccelerationChanged) and the android callers but not the other callers.  So the callee is getting values in a totally different coordinate system than the one it expects, and just ignoring them...

Then there was a further change in bug 662678, I think (it's mis-attributed to bug 615597) which made Macs file devicemotion but not deviceorientation.  Is that actually correct?

Oh, and that last change is still dev-doc-needed...  :(

Alon, Doug, Olli, could you take a look at this please?
Blocks: 615597
Whiteboard: regression
Version: 12 Branch → Trunk
do we have automated testing for this?
Can Marionette help with testing that?
brad - no.
olli - most android devcies, most mbp, some windows laptops, fewer linux laptops.

I'll take a look.
Assignee: nobody → doug.turner
The Mac device motion data is generated from the "SMC" Motion Sensor.  This sensor's purpose is to detect sudden acceleration changes and inform the storage system to avoid damaging spinning hard drive platters.

Mac Book's have no other known sensors that detect orientation data.

Although you can roughly determine orientation changes based on acceleration, we are not doing that.

Many Android devices support both acceleration and orientation sensors.  This is why the demo works fine on Android devices (although the axis is incorrect in the demo).


The demo can be fixed to support both devices that have no orientation sensors.
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → INVALID
oh, and when I said you could determine orientation based on acceleration -- i meant it in the loosest way possible.  accelerometers do not measure pitch.  you really need a gyro.
Ah, ok.  We really really really need to fix our docs, then.  And get Chrome to drop support for this event on this hardware.... or do whatever they do.
i'll work on the chrome bit.
Added dev-doc-needed so we can track this for documentation (see Comment 13)
Keywords: dev-doc-needed
The https://developer.mozilla.org/en-US/docs/WebAPI/Detecting_device_orientation article has been updated.

It provides a live example for the deviceorientation event but Firefox and Chrome does not handle the angle the same ways on some axis.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.