Closed Bug 847596 Opened 8 years ago Closed 8 years ago

Paris binding for DeviceMotionEvent

Categories

(Core :: DOM: Events, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: smaug, Assigned: smaug)

References

Details

Attachments

(2 files, 1 obsolete file)

No description provided.
Assignee: nobody → bugs
This is tiny bit painful with the current setup and binding behavior. But patch coming + 
some extra tests.
Attached patch patch (obsolete) — Splinter Review
Not super-pretty, but wanted to keep the existing behavior
(which is not exactly what the spec has, but spec isn't too good either).
So, need to support both JS callback interfaces and natively implemented stuff.
Added some tests too.
https://tbpl.mozilla.org/?tree=Try&rev=04a89abd2958
Attachment #731401 - Flags: review?(peterv)
Hopefully osx likes this
https://tbpl.mozilla.org/?tree=Try&rev=3b8b959c86c7
Attachment #731401 - Attachment is obsolete: true
Attachment #731401 - Flags: review?(peterv)
Attachment #731454 - Flags: review?(peterv)
Comment on attachment 731454 [details] [diff] [review]
less using namespace

Review of attachment 731454 [details] [diff] [review]:
-----------------------------------------------------------------

::: content/events/src/nsDOMDeviceMotionEvent.cpp
@@ +60,5 @@
> +                                              ErrorResult& aRv)
> +{
> +  nsresult rv = nsDOMEvent::InitEvent(aEventType, aCanBubble, aCancelable);
> +  aRv = rv;
> +  NS_ENSURE_SUCCESS_VOID(rv);

I think

  aRv = nsDOMEvent::InitEvent(aEventType, aCanBubble, aCancelable);
  if (aRv.Failed()) {
    return;
  }

is clearer.

::: dom/webidl/DeviceMotionEvent.webidl
@@ +17,5 @@
> +                             boolean canBubbleArg,
> +                             boolean cancelableArg,
> +                             DummyDeviceMotionCallback? acceleration,
> +                             DummyDeviceMotionCallback? accelerationIncludingGravity,
> +                             DummyDeviceMotionCallback? rotationRate,

Please make these be DeviceAcceleration/DeviceRotationRate and remove the DummyDeviceMotionCallback, it seems to work fine in my testing.
Attachment #731454 - Flags: review?(peterv) → review+
Something has changed since this seems to work now.
https://hg.mozilla.org/mozilla-central/rev/2d71598ee2ea
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
You need to log in before you can comment on or make changes to this bug.