Closed Bug 667919 Opened 9 years ago Closed 9 years ago

window.ondevicemotion and window.ondeviceorientation

Categories

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

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla6
Tracking Status
firefox6 --- fixed

People

(Reporter: dougt, Assigned: dougt)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

webkit is supporting ondevicemotion and ondeviceorientation on the window object.  we should do similar for compatibility.
Attached patch patch v.1Splinter Review
Assignee: nobody → doug.turner
Attachment #542491 - Flags: review?(Olli.Pettay)
Comment on attachment 542491 [details] [diff] [review]
patch v.1

r=me if you add tests for this new feature.
Attachment #542491 - Flags: review?(Olli.Pettay) → review+
Attachment #542491 - Flags: approval-mozilla-aurora?
http://hg.mozilla.org/mozilla-central/rev/d36b92c20241
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Comment on attachment 542491 [details] [diff] [review]
patch v.1

Discussed in triage today - we didn't have dougt around so it might need a re-nom if we got it wrong, but it felt like straight-additive change which isn't what Aurora is for, and we didn't see a strong reason to rush this, given that it will hit aurora in next week's migration anyhow. Re-nom if needed.
Attachment #542491 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora-
Comment on attachment 542491 [details] [diff] [review]
patch v.1

Sorry -- I didn't include a reason or risk assestment:

basically this change is a alias from window.ondevicemotion --> addEventListener("devicemotion", ...

This is a simple patch which gets us access to more sites that support device motion and orientation.  The iphone (and other webkits) use this style: window.onevent.  We didn't implement it as it wasn't outlined in the spec, but, given website compat, we feel that it is important to us.

So, if we take this small change, we get device motion functionality on sites that work on the iphone.  If we don't, it will appear broken for a few more weeks.

Ideally, this device motion (which has landed for ff6) could be a high level feature -- we are now supporting the new w3c spec.  However, without this aliasing that I mentioned, it might appear broken to many users.


The risk is low.  There are tests to ensure that the events fire.  The patch is modeled after a similar alias we did for onhashchange.
Attachment #542491 - Flags: approval-mozilla-aurora- → approval-mozilla-aurora?
Comment on attachment 542491 [details] [diff] [review]
patch v.1

From the jaws of defeat!! Thanks for the more detailed information Doug. We have reversed ourselves.
Attachment #542491 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
merge failed.  backing out, will reland tonight.
Keywords: dev-doc-needed
Depends on: 615597
This is landed into Firefox 6, so target is mozilla6.
Target Milestone: mozilla7 → mozilla6
Documentation added:

https://developer.mozilla.org/en/DOM/window.ondevicemotion
https://developer.mozilla.org/en/DOM/window.ondeviceorientation

And mentioned on Firefox 7 for developers.

Still a work in progress in that I need to add examples, which are coming. I'm working on the event docs, which will cover examples. That's being tracked by the doc needed for bug 615597, so I'm marking this one as done.
Component: DOM: Other → DOM
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.