Bug 1487079 - Fix hasOrientation and hasPosition are switched on WebVR GamepadPose r=qdot,kip
authorImanol Fernandez <mortimergoro@gmail.com>
Wed, 29 Aug 2018 22:09:48 +0000
changeset 482351 5acb0074a4b37de8fcc0d727bfc68cc9a0c6bda3
parent 482336 8897c80e6240025264a58cf1b3ff7cbdf97c6e76
child 482352 8031da3e4c91cca4e32e9b5ef6e9ffba03e30eca
push id232
push userfmarier@mozilla.com
push dateWed, 05 Sep 2018 20:45:54 +0000
reviewersqdot, kip
bugs1487079
milestone63.0a1
Bug 1487079 - Fix hasOrientation and hasPosition are switched on WebVR GamepadPose r=qdot,kip Differential Revision: https://phabricator.services.mozilla.com/D4534
dom/gamepad/GamepadPose.cpp
--- a/dom/gamepad/GamepadPose.cpp
+++ b/dom/gamepad/GamepadPose.cpp
@@ -36,23 +36,23 @@ GamepadPose::~GamepadPose()
 GamepadPose::WrapObject(JSContext* aJSContext, JS::Handle<JSObject*> aGivenProto)
 {
   return GamepadPose_Binding::Wrap(aJSContext, this, aGivenProto);
 }
 
 bool
 GamepadPose::HasOrientation() const
 {
-  return bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Position);
+  return bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Orientation);
 }
 
 bool
 GamepadPose::HasPosition() const
 {
-  return bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Orientation);
+  return bool(mPoseState.flags & GamepadCapabilityFlags::Cap_Position);
 }
 
 void
 GamepadPose::GetPosition(JSContext* aJSContext,
                          JS::MutableHandle<JSObject*> aRetval,
                          ErrorResult& aRv)
 {
   SetFloat32Array(aJSContext, aRetval, mPosition,