Last Comment Bug 667919 - window.ondevicemotion and window.ondeviceorientation
: window.ondevicemotion and window.ondeviceorientation
Status: RESOLVED FIXED
: dev-doc-complete
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla6
Assigned To: Doug Turner (:dougt)
:
Mentors:
Depends on: 615597
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-28 08:58 PDT by Doug Turner (:dougt)
Modified: 2013-04-04 13:52 PDT (History)
7 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
fixed


Attachments
patch v.1 (8.42 KB, patch)
2011-06-28 09:07 PDT, Doug Turner (:dougt)
bugs: review+
asa: approval‑mozilla‑aurora+
Details | Diff | Review

Description Doug Turner (:dougt) 2011-06-28 08:58:37 PDT
webkit is supporting ondevicemotion and ondeviceorientation on the window object.  we should do similar for compatibility.
Comment 1 Doug Turner (:dougt) 2011-06-28 09:07:11 PDT
Created attachment 542491 [details] [diff] [review]
patch v.1
Comment 2 Olli Pettay [:smaug] (high review load, please consider other reviewers) 2011-06-28 09:09:39 PDT
Comment on attachment 542491 [details] [diff] [review]
patch v.1

r=me if you add tests for this new feature.
Comment 4 Marco Bonardo [::mak] 2011-06-29 02:23:03 PDT
http://hg.mozilla.org/mozilla-central/rev/d36b92c20241
Comment 5 Johnathan Nightingale [:johnath] 2011-06-29 11:52:14 PDT
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.
Comment 6 Doug Turner (:dougt) 2011-06-29 12:03:53 PDT
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.
Comment 7 Asa Dotzler [:asa] 2011-06-30 14:52:06 PDT
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.
Comment 8 Doug Turner (:dougt) 2011-06-30 15:06:31 PDT
http://hg.mozilla.org/releases/mozilla-aurora/rev/506903048c61

thanks asa.
Comment 9 Doug Turner (:dougt) 2011-06-30 16:07:07 PDT
merge failed.  backing out, will reland tonight.
Comment 10 Doug Turner (:dougt) 2011-06-30 16:11:25 PDT
backout changeset: http://hg.mozilla.org/releases/mozilla-aurora/rev/130934a607ae
Comment 12 Makoto Kato [:m_kato] 2011-07-24 18:31:47 PDT
This is landed into Firefox 6, so target is mozilla6.
Comment 13 Eric Shepherd [:sheppy] 2011-09-25 12:57:37 PDT
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.

Note You need to log in before you can comment on or make changes to this bug.