Open Bug 848726 Opened 12 years ago Updated 2 years ago

window.DeviceMotionEvent should not be defined if the hardware cannot provide accelerometer data

Categories

(Core :: DOM: Device Interfaces, defect, P3)

x86
macOS
defect

Tracking

()

People

(Reporter: alice.lieutier, Unassigned)

References

Details

Attachments

(1 file)

Attached file testcase
There should be a way for web developpers to know if they can use the DeviceMotionEvent on the browser they use with the hardware they use. Currently, window.DeviceMotionEvent is always exposed in Firefox, even when the hardware does not provide information about the device motion (e.g. on most desktop). I attached a simple feature sniff for DeviceMotionEvent. Here is a page that records data from DeviceMotionEvent: http://alicelieutier.github.com/skiptherope/accelerometer.html
Can we have a method that adds the method in the window interface based on the availability of the feature with WebIDL? Doug, do we have a way to know that upfront?
Doug, is there any way for Gecko to know if DeviceMotionEvent is supported by the system? For example, SSD disks don't give that support even if we have a MacOS X backend.
Flags: needinfo?(doug.turner)
we could do more than we do now, for sure.
Flags: needinfo?(doug.turner)
Priority: -- → P3
See Also: → 1536382
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: