Bug 1436508 part 16. Remove nsIDOMSimpleGestureEvent. r=masayuki
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 09 Feb 2018 11:17:10 -0500
changeset 403188 f882418b2d05
parent 403187 9c5e16dfd42e
child 403189 c4ab27e652df
push id33416
push userarchaeopteryx@coole-files.de
push dateFri, 09 Feb 2018 22:32:39 +0000
treeherdermozilla-central@c2cddb0cbb20 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1436508
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1436508 part 16. Remove nsIDOMSimpleGestureEvent. r=masayuki MozReview-Commit-ID: 8JDovhthKtx
dom/events/SimpleGestureEvent.cpp
dom/events/SimpleGestureEvent.h
dom/interfaces/base/nsIDOMWindowUtils.idl
dom/interfaces/events/moz.build
dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
dom/webidl/SimpleGestureEvent.webidl
widget/TouchEvents.h
widget/android/nsWindow.cpp
widget/cocoa/SwipeTracker.mm
widget/cocoa/nsChildView.mm
widget/windows/nsWinGesture.cpp
xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
--- a/dom/events/SimpleGestureEvent.cpp
+++ b/dom/events/SimpleGestureEvent.cpp
@@ -32,82 +32,48 @@ SimpleGestureEvent::SimpleGestureEvent(E
       nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 }
 
 NS_IMPL_ADDREF_INHERITED(SimpleGestureEvent, MouseEvent)
 NS_IMPL_RELEASE_INHERITED(SimpleGestureEvent, MouseEvent)
 
 NS_INTERFACE_MAP_BEGIN(SimpleGestureEvent)
-  NS_INTERFACE_MAP_ENTRY(nsIDOMSimpleGestureEvent)
 NS_INTERFACE_MAP_END_INHERITING(MouseEvent)
 
 uint32_t
-SimpleGestureEvent::AllowedDirections()
+SimpleGestureEvent::AllowedDirections() const
 {
   return mEvent->AsSimpleGestureEvent()->mAllowedDirections;
 }
 
-NS_IMETHODIMP
-SimpleGestureEvent::GetAllowedDirections(uint32_t* aAllowedDirections)
-{
-  NS_ENSURE_ARG_POINTER(aAllowedDirections);
-  *aAllowedDirections = AllowedDirections();
-  return NS_OK;
-}
-
-NS_IMETHODIMP
+void
 SimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
 {
   mEvent->AsSimpleGestureEvent()->mAllowedDirections = aAllowedDirections;
-  return NS_OK;
 }
 
 uint32_t
-SimpleGestureEvent::Direction()
+SimpleGestureEvent::Direction() const
 {
   return mEvent->AsSimpleGestureEvent()->mDirection;
 }
 
-NS_IMETHODIMP
-SimpleGestureEvent::GetDirection(uint32_t* aDirection)
-{
-  NS_ENSURE_ARG_POINTER(aDirection);
-  *aDirection = Direction();
-  return NS_OK;
-}
-
 double
-SimpleGestureEvent::Delta()
+SimpleGestureEvent::Delta() const
 {
   return mEvent->AsSimpleGestureEvent()->mDelta;
 }
 
-NS_IMETHODIMP
-SimpleGestureEvent::GetDelta(double* aDelta)
-{
-  NS_ENSURE_ARG_POINTER(aDelta);
-  *aDelta = Delta();
-  return NS_OK;
-}
-
 uint32_t
-SimpleGestureEvent::ClickCount()
+SimpleGestureEvent::ClickCount() const
 {
   return mEvent->AsSimpleGestureEvent()->mClickCount;
 }
 
-NS_IMETHODIMP
-SimpleGestureEvent::GetClickCount(uint32_t* aClickCount)
-{
-  NS_ENSURE_ARG_POINTER(aClickCount);
-  *aClickCount = ClickCount();
-  return NS_OK;
-}
-
 void
 SimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
                                            bool aCanBubbleArg,
                                            bool aCancelableArg,
                                            nsGlobalWindowInner* aViewArg,
                                            int32_t aDetailArg,
                                            int32_t aScreenX,
                                            int32_t aScreenY,
--- a/dom/events/SimpleGestureEvent.h
+++ b/dom/events/SimpleGestureEvent.h
@@ -2,50 +2,44 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_dom_SimpleGestureEvent_h_
 #define mozilla_dom_SimpleGestureEvent_h_
 
-#include "nsIDOMSimpleGestureEvent.h"
 #include "mozilla/dom/MouseEvent.h"
 #include "mozilla/dom/SimpleGestureEventBinding.h"
 #include "mozilla/EventForwards.h"
 
 class nsPresContext;
 
 namespace mozilla {
 namespace dom {
 
-class SimpleGestureEvent : public MouseEvent,
-                           public nsIDOMSimpleGestureEvent
+class SimpleGestureEvent : public MouseEvent
 {
 public:
   SimpleGestureEvent(EventTarget* aOwner,
                      nsPresContext* aPresContext,
                      WidgetSimpleGestureEvent* aEvent);
 
   NS_DECL_ISUPPORTS_INHERITED
 
-  NS_DECL_NSIDOMSIMPLEGESTUREEVENT
-
-  // Forward to base class
-  NS_FORWARD_TO_MOUSEEVENT
-
   virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
   {
     return SimpleGestureEventBinding::Wrap(aCx, this, aGivenProto);
   }
 
-  uint32_t AllowedDirections();
-  uint32_t Direction();
-  double Delta();
-  uint32_t ClickCount();
+  uint32_t AllowedDirections() const;
+  void SetAllowedDirections(uint32_t aAllowedDirections);
+  uint32_t Direction() const;
+  double Delta() const;
+  uint32_t ClickCount() const;
 
   void InitSimpleGestureEvent(const nsAString& aType,
                               bool aCanBubble,
                               bool aCancelable,
                               nsGlobalWindowInner* aView,
                               int32_t aDetail,
                               int32_t aScreenX,
                               int32_t aScreenY,
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -773,17 +773,17 @@ interface nsIDOMWindowUtils : nsISupport
    *
    * Cannot be accessed from unprivileged context (not
    * content-accessible) Will throw a DOM security error if called
    * without chrome privileges.
    *
    * @param aType event type
    * @param aX x offset in CSS pixels
    * @param aY y offset in CSS pixels
-   * @param aDirection direction, using constants defined in nsIDOMSimpleGestureEvent
+   * @param aDirection direction, using constants defined in SimpleGestureEvent.webidl
    * @param aDelta  amount of magnification or rotation for magnify and rotation events
    * @param aModifiers modifiers pressed, using constants defined in nsIDOMNSEvent
    * @param aClickCount For tap gestures, the number of taps.
    */
   void sendSimpleGestureEvent(in AString aType,
                               in float aX,
                               in float aY,
                               in unsigned long aDirection,
--- a/dom/interfaces/events/moz.build
+++ b/dom/interfaces/events/moz.build
@@ -17,15 +17,14 @@ XPIDL_SOURCES += [
     'nsIDOMEventTarget.idl',
     'nsIDOMFocusEvent.idl',
     'nsIDOMMouseEvent.idl',
     'nsIDOMMouseScrollEvent.idl',
     'nsIDOMNotifyPaintEvent.idl',
     'nsIDOMNSEvent.idl',
     'nsIDOMPaintRequest.idl',
     'nsIDOMScrollAreaEvent.idl',
-    'nsIDOMSimpleGestureEvent.idl',
     'nsIDOMUIEvent.idl',
     'nsIDOMWheelEvent.idl',
 ]
 
 XPIDL_MODULE = 'dom_events'
 
deleted file mode 100644
--- a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-#include "nsIDOMMouseEvent.idl"
-
-/**
- * The nsIDOMSimpleGestureEvent interface is the datatype for all
- * Mozilla-specific simple gesture events in the Document Object Model.
- *
- * The following events are generated:
- *
- * MozSwipeGestureMayStart - Generated when the user starts a horizontal
- * swipe across the input device, but before we know whether the user
- * is actually scrolling past a scroll edge.
- * This event asks two questions:  Should a swipe really be started, and
- * in which directions should the user be able to swipe?  The first
- * question is answered by event listeners by calling or not calling
- * preventDefault() on the event.  Since a swipe swallows all scroll
- * events, the default action of the swipe start event is *not* to
- * start a swipe. Call preventDefault() if you want a swipe to be
- * started. Doing so won't necessarily result in a swipe being started,
- * it only communicates an intention. Once Gecko determines whether a
- * swipe should actually be started, it will send a MozSwipeGestureStart
- * event.
- * The second question (swipe-able directions) is answered in the
- * allowedDirections field.
- *
- * MozSwipeGestureStart - This event signals the start of a swipe.
- * It guarantees a future MozSwipeGestureEnd event that will signal
- * the end of a swipe animation.
- *
- * MozSwipeGestureUpdate - Generated periodically while the user is
- * continuing a horizontal swipe gesture.  The "delta" value represents
- * the current absolute gesture amount.  This event may even be sent
- * after a MozSwipeGesture event fired in order to allow for fluid
- * completion of a swipe animation.  The direction value is meaningless
- * on swipe update events.
- *
- * MozSwipeGestureEnd - Generated when the swipe animation is completed.
- *
- * MozSwipeGesture - Generated when the user releases a swipe across
- * across the input device.  This event signals that the actual swipe
- * operation is complete, even though the animation might not be finished
- * yet.  This event can be sent without accompanying start / update / end
- * events, and it can also be handled on its own if the consumer doesn't
- * want to handle swipe animation events.
- * Only the direction value has any significance, the delta value is
- * meaningless.
- *
- * MozMagnifyGestureStart - Generated when the user begins the magnify
- * ("pinch") gesture.  The "delta" value represents the initial
- * movement.
- *
- * MozMagnifyGestureUpdate - Generated periodically while the user is
- * continuing the magnify ("pinch") gesture.  The "delta" value
- * represents the movement since the last MozMagnifyGestureStart or
- * MozMagnifyGestureUpdate event.
- *
- * MozMagnifyGesture - Generated when the user has completed the
- * magnify ("pinch") gesture.  If you only want to receive a single
- * event when the magnify gesture is complete, you only need to hook
- * this event and can safely ignore the MozMagnifyGestureStart and the
- * MozMagnifyGestureUpdate events. The "delta" value is the cumulative
- * amount represented by the user's gesture.
- *
- * MozRotateGestureStart - Generated when the user begins the rotation
- * gesture.  The "delta" value represents the initial rotation.
- *
- * MozRotateGestureUpdate - Generated periodically while the user is
- * continuing the rotation gesture.  The "delta" value represents the
- * rotation since the last MozRotateGestureStart or
- * MozRotateGestureUpdate event.
- *
- * MozRotateGesture - Generated when the user has completed the
- * rotation gesture.  If you only want to receive a single event when
- * the rotation gesture is complete, you only need to hook this event
- * and can safely ignore the MozRotateGestureStart and the
- * MozRotateGestureUpdate events.  The "delta" value is the cumulative
- * amount of rotation represented by the user's gesture.
- *
- * MozTapGesture - Generated when the user executes a two finger
- * tap gesture on the input device. Client coordinates contain the
- * center point of the tap.
- * (XXX On OS X, only Lion (10.7) and up)
- *
- * MozPressTapGesture - Generated when the user executes a press
- * and tap two finger gesture (first finger down, second finger down,
- * second finger up, first finger up) on the input device.
- * Client coordinates contain the center pivot point of the action.
- * (XXX Not implemented on Mac)
- *
- * MozEdgeUIGesture - Generated when the user swipes the display to
- * invoke edge ui.
- * (XXX Win8 only)
- *
- * Default behavior:
- *
- * Some operating systems support default behaviors for gesture events
- * when they are not handled by the application. Consumers should
- * use event.preventDefault() to prevent default behavior when
- * consuming events.
- */
-
-[builtinclass, uuid(c397f9a2-4266-4291-b282-3efd6d7afc57)]
-interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent
-{
-  /* Swipe direction constants */
-  const unsigned long DIRECTION_UP = 1;
-  const unsigned long DIRECTION_DOWN = 2;
-  const unsigned long DIRECTION_LEFT = 4;
-  const unsigned long DIRECTION_RIGHT = 8;
-
-  /* Rotational direction constants */
-  const unsigned long ROTATION_COUNTERCLOCKWISE = 1;
-  const unsigned long ROTATION_CLOCKWISE = 2;
-
-  /* Read-write value for swipe events.
-   *
-   * Reports the directions that can be swiped to; multiple directions
-   * should be OR'ed together.
-   *
-   * The allowedDirections field is designed to be set on SwipeGestureMayStart
-   * events by event listeners.  Its value after event dispatch determines
-   * the behavior of the swipe animation that might be about to begin.
-   * Specifically, if the user swipes in a direction that can't be swiped
-   * to, the animation will have a bounce effect.
-   * Future SwipeGestureUpdate, SwipeGesture and SwipeGestureEnd events
-   * will carry the allowDirections value that was set on the SwipeMayStart
-   * event.  Changing this field on non-SwipeGestureMayStart events doesn't
-   * have any effect.
-   */
-  attribute unsigned long allowedDirections;
-
-  /* Direction of a gesture. Diagonals are indicated by OR'ing the
-   * applicable constants together.
-   *
-   * Swipes gestures may occur in any direction.
-   *
-   * Magnify gestures do not have a direction.
-   *
-   * Rotation gestures will be either ROTATION_COUNTERCLOCKWISE or
-   * ROTATION_CLOCKWISE.
-   */
-  readonly attribute unsigned long direction;
-
-  /* Delta value for magnify, rotate and swipe gestures.
-   *
-   * For rotation, the value is in degrees and is positive for
-   * clockwise rotation and negative for counterclockwise
-   * rotation.
-   *
-   * For magnification, the value will be positive for a "zoom in"
-   * (i.e, increased magnification) and negative for a "zoom out"
-   * (i.e., decreased magnification).  The particular units
-   * represented by the "delta" are currently implementation specific.
-   *
-   * XXX - The units for measuring magnification are currently
-   * unspecified because the units used by Mac OS X are currently
-   * undocumented.  The values are typically in the range of 0.0 to
-   * 100.0, but it is only safe currently to rely on the delta being
-   * positive or negative.
-   *
-   * For swipe start, update and end events, the value is a fraction
-   * of one "page".  If the resulting swipe will have DIRECTION_LEFT, the
-   * delta value will be positive; for DIRECTION_RIGHT, delta is negative.
-   * If this seems backwards to you, look at it this way:  If the current
-   * page is pushed to the right during the animation (positive delta),
-   * the page left to the current page will be visible after the swipe
-   * (DIRECTION_LEFT).
-   *
-   * Units on Windows represent the difference between the initial
-   * and current/final width between the two touch points on the input
-   * device and are measured in pixels.
-   */
-  readonly attribute double delta;
-
-  /* Click count value for taps. */
-  readonly attribute unsigned long clickCount;
-};
--- a/dom/webidl/SimpleGestureEvent.webidl
+++ b/dom/webidl/SimpleGestureEvent.webidl
@@ -1,33 +1,186 @@
 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/**
+ * The SimpleGestureEvent interface is the datatype for all
+ * Mozilla-specific simple gesture events in the Document Object Model.
  *
- * For more information see nsIDOMSimpleGestureEvent.idl.
+ * The following events are generated:
+ *
+ * MozSwipeGestureMayStart - Generated when the user starts a horizontal
+ * swipe across the input device, but before we know whether the user
+ * is actually scrolling past a scroll edge.
+ * This event asks two questions:  Should a swipe really be started, and
+ * in which directions should the user be able to swipe?  The first
+ * question is answered by event listeners by calling or not calling
+ * preventDefault() on the event.  Since a swipe swallows all scroll
+ * events, the default action of the swipe start event is *not* to
+ * start a swipe. Call preventDefault() if you want a swipe to be
+ * started. Doing so won't necessarily result in a swipe being started,
+ * it only communicates an intention. Once Gecko determines whether a
+ * swipe should actually be started, it will send a MozSwipeGestureStart
+ * event.
+ * The second question (swipe-able directions) is answered in the
+ * allowedDirections field.
+ *
+ * MozSwipeGestureStart - This event signals the start of a swipe.
+ * It guarantees a future MozSwipeGestureEnd event that will signal
+ * the end of a swipe animation.
+ *
+ * MozSwipeGestureUpdate - Generated periodically while the user is
+ * continuing a horizontal swipe gesture.  The "delta" value represents
+ * the current absolute gesture amount.  This event may even be sent
+ * after a MozSwipeGesture event fired in order to allow for fluid
+ * completion of a swipe animation.  The direction value is meaningless
+ * on swipe update events.
+ *
+ * MozSwipeGestureEnd - Generated when the swipe animation is completed.
+ *
+ * MozSwipeGesture - Generated when the user releases a swipe across
+ * across the input device.  This event signals that the actual swipe
+ * operation is complete, even though the animation might not be finished
+ * yet.  This event can be sent without accompanying start / update / end
+ * events, and it can also be handled on its own if the consumer doesn't
+ * want to handle swipe animation events.
+ * Only the direction value has any significance, the delta value is
+ * meaningless.
+ *
+ * MozMagnifyGestureStart - Generated when the user begins the magnify
+ * ("pinch") gesture.  The "delta" value represents the initial
+ * movement.
+ *
+ * MozMagnifyGestureUpdate - Generated periodically while the user is
+ * continuing the magnify ("pinch") gesture.  The "delta" value
+ * represents the movement since the last MozMagnifyGestureStart or
+ * MozMagnifyGestureUpdate event.
+ *
+ * MozMagnifyGesture - Generated when the user has completed the
+ * magnify ("pinch") gesture.  If you only want to receive a single
+ * event when the magnify gesture is complete, you only need to hook
+ * this event and can safely ignore the MozMagnifyGestureStart and the
+ * MozMagnifyGestureUpdate events. The "delta" value is the cumulative
+ * amount represented by the user's gesture.
+ *
+ * MozRotateGestureStart - Generated when the user begins the rotation
+ * gesture.  The "delta" value represents the initial rotation.
+ *
+ * MozRotateGestureUpdate - Generated periodically while the user is
+ * continuing the rotation gesture.  The "delta" value represents the
+ * rotation since the last MozRotateGestureStart or
+ * MozRotateGestureUpdate event.
+ *
+ * MozRotateGesture - Generated when the user has completed the
+ * rotation gesture.  If you only want to receive a single event when
+ * the rotation gesture is complete, you only need to hook this event
+ * and can safely ignore the MozRotateGestureStart and the
+ * MozRotateGestureUpdate events.  The "delta" value is the cumulative
+ * amount of rotation represented by the user's gesture.
+ *
+ * MozTapGesture - Generated when the user executes a two finger
+ * tap gesture on the input device. Client coordinates contain the
+ * center point of the tap.
+ * (XXX On OS X, only Lion (10.7) and up)
+ *
+ * MozPressTapGesture - Generated when the user executes a press
+ * and tap two finger gesture (first finger down, second finger down,
+ * second finger up, first finger up) on the input device.
+ * Client coordinates contain the center pivot point of the action.
+ * (XXX Not implemented on Mac)
+ *
+ * MozEdgeUIGesture - Generated when the user swipes the display to
+ * invoke edge ui.
+ * (XXX Win8 only)
+ *
+ * Default behavior:
+ *
+ * Some operating systems support default behaviors for gesture events
+ * when they are not handled by the application. Consumers should
+ * use event.preventDefault() to prevent default behavior when
+ * consuming events.
  */
 
 [Func="IsChromeOrXBL"]
 interface SimpleGestureEvent : MouseEvent
 {
+  /* Swipe direction constants */
   const unsigned long DIRECTION_UP = 1;
   const unsigned long DIRECTION_DOWN = 2;
   const unsigned long DIRECTION_LEFT = 4;
   const unsigned long DIRECTION_RIGHT = 8;
 
+  /* Rotational direction constants */
   const unsigned long ROTATION_COUNTERCLOCKWISE = 1;
   const unsigned long ROTATION_CLOCKWISE = 2;
 
+  /* Read-write value for swipe events.
+   *
+   * Reports the directions that can be swiped to; multiple directions
+   * should be OR'ed together.
+   *
+   * The allowedDirections field is designed to be set on SwipeGestureMayStart
+   * events by event listeners.  Its value after event dispatch determines
+   * the behavior of the swipe animation that might be about to begin.
+   * Specifically, if the user swipes in a direction that can't be swiped
+   * to, the animation will have a bounce effect.
+   * Future SwipeGestureUpdate, SwipeGesture and SwipeGestureEnd events
+   * will carry the allowDirections value that was set on the SwipeMayStart
+   * event.  Changing this field on non-SwipeGestureMayStart events doesn't
+   * have any effect.
+   */
   attribute unsigned long allowedDirections;
 
+  /* Direction of a gesture. Diagonals are indicated by OR'ing the
+   * applicable constants together.
+   *
+   * Swipes gestures may occur in any direction.
+   *
+   * Magnify gestures do not have a direction.
+   *
+   * Rotation gestures will be either ROTATION_COUNTERCLOCKWISE or
+   * ROTATION_CLOCKWISE.
+   */
   readonly attribute unsigned long direction;
 
+  /* Delta value for magnify, rotate and swipe gestures.
+   *
+   * For rotation, the value is in degrees and is positive for
+   * clockwise rotation and negative for counterclockwise
+   * rotation.
+   *
+   * For magnification, the value will be positive for a "zoom in"
+   * (i.e, increased magnification) and negative for a "zoom out"
+   * (i.e., decreased magnification).  The particular units
+   * represented by the "delta" are currently implementation specific.
+   *
+   * XXX - The units for measuring magnification are currently
+   * unspecified because the units used by Mac OS X are currently
+   * undocumented.  The values are typically in the range of 0.0 to
+   * 100.0, but it is only safe currently to rely on the delta being
+   * positive or negative.
+   *
+   * For swipe start, update and end events, the value is a fraction
+   * of one "page".  If the resulting swipe will have DIRECTION_LEFT, the
+   * delta value will be positive; for DIRECTION_RIGHT, delta is negative.
+   * If this seems backwards to you, look at it this way:  If the current
+   * page is pushed to the right during the animation (positive delta),
+   * the page left to the current page will be visible after the swipe
+   * (DIRECTION_LEFT).
+   *
+   * Units on Windows represent the difference between the initial
+   * and current/final width between the two touch points on the input
+   * device and are measured in pixels.
+   */
   readonly attribute double delta;
 
+  /* Click count value for taps. */
   readonly attribute unsigned long clickCount;
 
   void initSimpleGestureEvent(DOMString typeArg,
                               optional boolean canBubbleArg = false,
                               optional boolean cancelableArg = false,
                               optional Window? viewArg = null,
                               optional long detailArg = 0,
                               optional long screenXArg = 0,
--- a/widget/TouchEvents.h
+++ b/widget/TouchEvents.h
@@ -6,17 +6,16 @@
 #ifndef mozilla_TouchEvents_h__
 #define mozilla_TouchEvents_h__
 
 #include <stdint.h>
 
 #include "mozilla/dom/Touch.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/RefPtr.h"
-#include "nsIDOMSimpleGestureEvent.h"
 #include "nsTArray.h"
 
 namespace mozilla {
 
 /******************************************************************************
  * mozilla::WidgetGestureNotifyEvent
  *
  * This event is the first event generated when the user touches
@@ -123,19 +122,19 @@ public:
     // Not copying widget, it is a weak reference.
     WidgetSimpleGestureEvent* result =
       new WidgetSimpleGestureEvent(false, mMessage, nullptr);
     result->AssignSimpleGestureEventData(*this, true);
     result->mFlags = mFlags;
     return result;
   }
 
-  // See nsIDOMSimpleGestureEvent for values
+  // See SimpleGestureEvent.webidl for values
   uint32_t mAllowedDirections;
-  // See nsIDOMSimpleGestureEvent for values
+  // See SimpleGestureEvent.webidl for values
   uint32_t mDirection;
   // The number of taps for tap events
   uint32_t mClickCount;
   // Delta for magnify and rotate events
   double mDelta;
 
   // XXX Not tested by test_assign_event_data.html
   void AssignSimpleGestureEventData(const WidgetSimpleGestureEvent& aEvent,
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -42,18 +42,16 @@ using mozilla::Unused;
 #include "nsFocusManager.h"
 #include "nsIdleService.h"
 #include "nsLayoutUtils.h"
 #include "nsViewManager.h"
 
 #include "nsContentUtils.h"
 #include "WidgetUtils.h"
 
-#include "nsIDOMSimpleGestureEvent.h"
-
 #include "nsGkAtoms.h"
 #include "nsWidgetsCID.h"
 #include "nsGfxCIID.h"
 
 #include "gfxContext.h"
 
 #include "Layers.h"
 #include "mozilla/layers/LayerManagerComposite.h"
--- a/widget/cocoa/SwipeTracker.mm
+++ b/widget/cocoa/SwipeTracker.mm
@@ -5,16 +5,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "SwipeTracker.h"
 
 #include "InputData.h"
 #include "mozilla/FlushType.h"
 #include "mozilla/TimeStamp.h"
 #include "mozilla/TouchEvents.h"
+#include "mozilla/dom/SimpleGestureEventBinding.h"
 #include "nsAlgorithm.h"
 #include "nsChildView.h"
 #include "UnitTransforms.h"
 
 // These values were tweaked to make the physics feel similar to the native swipe.
 static const double kSpringForce = 250.0;
 static const double kVelocityTwitchTolerance = 0.0000001;
 static const double kWholePagePixelSize = 1000.0;
@@ -65,26 +66,31 @@ SwipeTracker::Destroy()
 SwipeTracker::~SwipeTracker()
 {
   MOZ_ASSERT(!mRegisteredWithRefreshDriver, "Destroy needs to be called before deallocating");
 }
 
 double
 SwipeTracker::SwipeSuccessTargetValue() const
 {
-  return (mSwipeDirection == nsIDOMSimpleGestureEvent::DIRECTION_RIGHT) ? -1.0 : 1.0;
+  return (mSwipeDirection == dom::SimpleGestureEventBinding::DIRECTION_RIGHT) ?
+    -1.0 : 1.0;
 }
 
 double
 SwipeTracker::ClampToAllowedRange(double aGestureAmount) const
 {
   // gestureAmount needs to stay between -1 and 0 when swiping right and
   // between 0 and 1 when swiping left.
-  double min = (mSwipeDirection == nsIDOMSimpleGestureEvent::DIRECTION_RIGHT) ? -1.0 : 0.0;
-  double max = (mSwipeDirection == nsIDOMSimpleGestureEvent::DIRECTION_LEFT) ? 1.0 : 0.0;
+  double min =
+    (mSwipeDirection == dom::SimpleGestureEventBinding::DIRECTION_RIGHT) ?
+      -1.0 : 0.0;
+  double max =
+    (mSwipeDirection == dom::SimpleGestureEventBinding::DIRECTION_LEFT) ?
+      1.0 : 0.0;
   return clamped(aGestureAmount, min, max);
 }
 
 bool
 SwipeTracker::ComputeSwipeSuccess() const
 {
   double targetValue = SwipeSuccessTargetValue();
 
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -12,33 +12,33 @@
 
 #include "nsChildView.h"
 #include "nsCocoaWindow.h"
 
 #include "mozilla/MiscEvents.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/TextEvents.h"
 #include "mozilla/TouchEvents.h"
+#include "mozilla/dom/SimpleGestureEventBinding.h"
 
 #include "nsArrayUtils.h"
 #include "nsExceptionHandler.h"
 #include "nsObjCExceptions.h"
 #include "nsCOMPtr.h"
 #include "nsThreadUtils.h"
 #include "nsToolkit.h"
 #include "nsCRT.h"
 
 #include "nsFontMetrics.h"
 #include "nsIRollupListener.h"
 #include "nsViewManager.h"
 #include "nsIInterfaceRequestor.h"
 #include "nsIFile.h"
 #include "nsILocalFileMac.h"
 #include "nsGfxCIID.h"
-#include "nsIDOMSimpleGestureEvent.h"
 #include "nsThemeConstants.h"
 #include "nsIWidgetListener.h"
 #include "nsIPresShell.h"
 #include "nsIScreen.h"
 
 #include "nsDragService.h"
 #include "nsClipboard.h"
 #include "nsCursorManager.h"
@@ -2697,18 +2697,18 @@ nsChildView::EnsureVibrancyManager()
 }
 
 nsChildView::SwipeInfo
 nsChildView::SendMayStartSwipe(const mozilla::PanGestureInput& aSwipeStartEvent)
 {
   nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
 
   uint32_t direction = (aSwipeStartEvent.mPanDisplacement.x > 0.0)
-    ? (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_RIGHT
-    : (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
+    ? (uint32_t)dom::SimpleGestureEventBinding::DIRECTION_RIGHT
+    : (uint32_t)dom::SimpleGestureEventBinding::DIRECTION_LEFT;
 
   // We're ready to start the animation. Tell Gecko about it, and at the same
   // time ask it if it really wants to start an animation for this event.
   // This event also reports back the directions that we can swipe in.
   LayoutDeviceIntPoint position =
     RoundedToInt(aSwipeStartEvent.mPanStartPoint * ScreenToLayoutDeviceScale(1));
   WidgetSimpleGestureEvent geckoEvent =
     SwipeTracker::CreateSwipeGestureEvent(eSwipeGestureMayStart, this,
@@ -2731,18 +2731,18 @@ nsChildView::TrackScrollEventAsSwipe(con
   // by another gesture event.
   if (mSwipeTracker) {
     mSwipeTracker->CancelSwipe(aSwipeStartEvent.mTimeStamp);
     mSwipeTracker->Destroy();
     mSwipeTracker = nullptr;
   }
 
   uint32_t direction = (aSwipeStartEvent.mPanDisplacement.x > 0.0)
-    ? (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_RIGHT
-    : (uint32_t)nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
+    ? (uint32_t)dom::SimpleGestureEventBinding::DIRECTION_RIGHT
+    : (uint32_t)dom::SimpleGestureEventBinding::DIRECTION_LEFT;
 
   mSwipeTracker = new SwipeTracker(*this, aSwipeStartEvent,
                                    aAllowedDirections, direction);
 
   if (!mAPZC) {
     mCurrentPanGestureBelongsToSwipe = true;
   }
 }
@@ -4172,25 +4172,25 @@ NSEvent* gLastDragMouseDownEvent = nil;
   float deltaY = [anEvent deltaY];  // up=1.0, down=-1.0
 
   // Setup the "swipe" event.
   WidgetSimpleGestureEvent geckoEvent(true, eSwipeGesture, mGeckoChild);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
 
   // Record the left/right direction.
   if (deltaX > 0.0)
-    geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
+    geckoEvent.mDirection |= dom::SimpleGestureEventBinding::DIRECTION_LEFT;
   else if (deltaX < 0.0)
-    geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
+    geckoEvent.mDirection |= dom::SimpleGestureEventBinding::DIRECTION_RIGHT;
 
   // Record the up/down direction.
   if (deltaY > 0.0)
-    geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_UP;
+    geckoEvent.mDirection |= dom::SimpleGestureEventBinding::DIRECTION_UP;
   else if (deltaY < 0.0)
-    geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_DOWN;
+    geckoEvent.mDirection |= dom::SimpleGestureEventBinding::DIRECTION_DOWN;
 
   // Send the event.
   mGeckoChild->DispatchWindowEvent(geckoEvent);
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 // Pinch zoom gesture.
@@ -4319,19 +4319,20 @@ NSEvent* gLastDragMouseDownEvent = nil;
     return;
   }
 
   // Setup the event.
   WidgetSimpleGestureEvent geckoEvent(true, msg, mGeckoChild);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
   geckoEvent.mDelta = -rotation;
   if (rotation > 0.0) {
-    geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
+    geckoEvent.mDirection =
+      dom::SimpleGestureEventBinding::ROTATION_COUNTERCLOCKWISE;
   } else {
-    geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
+    geckoEvent.mDirection = dom::SimpleGestureEventBinding::ROTATION_CLOCKWISE;
   }
 
   // Send the event.
   mGeckoChild->DispatchWindowEvent(geckoEvent);
 
   // Keep track of the cumulative rotation for the final "rotate" event.
   mCumulativeRotation += rotation;
 
@@ -4411,19 +4412,21 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   case eGestureState_RotateGesture:
     {
       // Setup the "rotate" event.
       WidgetSimpleGestureEvent geckoEvent(true, eRotateGesture, mGeckoChild);
       [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
       geckoEvent.mDelta = -mCumulativeRotation;
       if (mCumulativeRotation > 0.0) {
-        geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
+        geckoEvent.mDirection =
+          dom::SimpleGestureEventBinding::ROTATION_COUNTERCLOCKWISE;
       } else {
-        geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
+        geckoEvent.mDirection =
+          dom::SimpleGestureEventBinding::ROTATION_CLOCKWISE;
       }
 
       // Send the event.
       mGeckoChild->DispatchWindowEvent(geckoEvent);
     }
     break;
 
   case eGestureState_None:
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -5,22 +5,22 @@
 
 /*
  * nsWinGesture - Touch input handling for tablet displays.
  */
 
 #include "nscore.h"
 #include "nsWinGesture.h"
 #include "nsUXThemeData.h"
-#include "nsIDOMSimpleGestureEvent.h"
 #include "nsIDOMWheelEvent.h"
 #include "mozilla/Logging.h"
 #include "mozilla/MouseEvents.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/TouchEvents.h"
+#include "mozilla/dom/SimpleGestureEventBinding.h"
 
 #include <cmath>
 
 using namespace mozilla;
 using namespace mozilla::widget;
 
 extern mozilla::LazyLogModule gWindowsLog;
 
@@ -202,20 +202,23 @@ nsWinGesture::ProcessGestureMessage(HWND
           // along with delta. It's useful.
           degrees = mRotateIntermediate = 0.0;
       }
 
       evt.mDirection = 0;
       evt.mDelta = degrees - mRotateIntermediate;
       mRotateIntermediate = degrees;
 
-      if (evt.mDelta > 0)
-        evt.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
-      else if (evt.mDelta < 0)
-        evt.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
+      if (evt.mDelta > 0) {
+        evt.mDirection =
+          dom::SimpleGestureEventBinding::ROTATION_COUNTERCLOCKWISE;
+      }
+      else if (evt.mDelta < 0) {
+        evt.mDirection = dom::SimpleGestureEventBinding::ROTATION_CLOCKWISE;
+      }
 
       if (gi.dwFlags & GF_BEGIN) {
         evt.mMessage = eRotateGestureStart;
       } else if (gi.dwFlags & GF_END) {
         evt.mMessage = eRotateGesture;
       } else {
         evt.mMessage = eRotateGestureUpdate;
       }
--- a/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
+++ b/xpcom/reflect/xptinfo/ShimInterfaceInfo.cpp
@@ -47,17 +47,16 @@
 #include "nsIDOMOfflineResourceList.h"
 #include "nsIDOMPaintRequest.h"
 #include "nsIDOMParser.h"
 #include "nsIDOMProcessingInstruction.h"
 #include "nsIDOMRange.h"
 #include "nsIDOMScreen.h"
 #include "nsIDOMScrollAreaEvent.h"
 #include "nsIDOMSerializer.h"
-#include "nsIDOMSimpleGestureEvent.h"
 #include "nsIDOMText.h"
 #include "nsIDOMTimeRanges.h"
 #include "nsIDOMUIEvent.h"
 #include "nsIDOMValidityState.h"
 #include "nsIDOMWheelEvent.h"
 #include "nsIDOMXMLDocument.h"
 #include "nsIDOMXULCommandEvent.h"
 #include "nsIDOMXULElement.h"
@@ -127,17 +126,16 @@
 #include "mozilla/dom/PositionErrorBinding.h"
 #include "mozilla/dom/ProcessingInstructionBinding.h"
 #include "mozilla/dom/RangeBinding.h"
 #include "mozilla/dom/RectBinding.h"
 #include "mozilla/dom/ScreenBinding.h"
 #include "mozilla/dom/ScrollBoxObjectBinding.h"
 #include "mozilla/dom/SelectionBinding.h"
 #include "mozilla/dom/ScrollAreaEventBinding.h"
-#include "mozilla/dom/SimpleGestureEventBinding.h"
 #include "mozilla/dom/StorageEventBinding.h"
 #include "mozilla/dom/StyleSheetBinding.h"
 #include "mozilla/dom/StyleSheetListBinding.h"
 #include "mozilla/dom/SVGElementBinding.h"
 #include "mozilla/dom/TextBinding.h"
 #include "mozilla/dom/TimeEventBinding.h"
 #include "mozilla/dom/TimeRangesBinding.h"
 #include "mozilla/dom/TreeBoxObjectBinding.h"
@@ -251,17 +249,16 @@ const ComponentsInterfaceShimEntry kComp
   DEFINE_SHIM(PaintRequest),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMParser, DOMParser),
   DEFINE_SHIM(ProcessingInstruction),
   DEFINE_SHIM(Range),
   DEFINE_SHIM(Screen),
   DEFINE_SHIM(ScrollAreaEvent),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIScrollBoxObject, ScrollBoxObject),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIDOMSerializer, XMLSerializer),
-  DEFINE_SHIM(SimpleGestureEvent),
   DEFINE_SHIM(Text),
   DEFINE_SHIM(TimeRanges),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsITreeBoxObject, TreeBoxObject),
   DEFINE_SHIM(UIEvent),
   DEFINE_SHIM(ValidityState),
   DEFINE_SHIM_WITH_CUSTOM_INTERFACE(nsIWebBrowserPersistable, FrameLoader),
   DEFINE_SHIM(WheelEvent),
   DEFINE_SHIM(XMLDocument),