Bug 1421482 Part2: Replace test utility synthesizePointer with synthesizeMouse. r=smaug.
☠☠ backed out by 554fbb5c6e5b ☠ ☠
authorStone Shih <sshih@mozilla.com>
Fri, 24 Nov 2017 07:50:12 +0800
changeset 447812 a8701e1bd012dab4f95f25df677a25e459d8e473
parent 447811 d774f5fe6e948d73ac15f66bff3e64499c04eb25
child 447813 da352bea6602a09158d0e4d2c2bad81cb6078ee2
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1421482
milestone59.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 1421482 Part2: Replace test utility synthesizePointer with synthesizeMouse. r=smaug. We should follow the real use cases to synthesize mouse or touch events to generate pointer events so that the related logic is covered by these test cases. MozReview-Commit-ID: 9xSgjSL0Azt
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDOMWindowUtils.h
dom/events/test/test_bug967796.html
dom/interfaces/base/nsIDOMWindowUtils.idl
layout/base/tests/bug1078327_inner.html
layout/base/tests/bug1080360_inner.html
layout/base/tests/bug1080361_inner.html
layout/base/tests/bug1153130_inner.html
layout/base/tests/bug1162990_inner_1.html
layout/base/tests/bug1162990_inner_2.html
layout/base/tests/bug977003_inner_1.html
layout/base/tests/bug977003_inner_2.html
layout/base/tests/bug977003_inner_3.html
layout/base/tests/bug977003_inner_4.html
layout/base/tests/bug977003_inner_5.html
layout/base/tests/bug977003_inner_6.html
testing/mochitest/tests/SimpleTest/EventUtils.js
widget/tests/test_assign_event_data.html
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -770,166 +770,16 @@ nsDOMWindowUtils::SendMouseEventCommon(c
   nsCOMPtr<nsIPresShell> presShell = GetPresShell();
   return nsContentUtils::SendMouseEvent(presShell, aType, aX, aY, aButton,
       aButtons, aClickCount, aModifiers, aIgnoreRootScrollFrame, aPressure,
       aInputSourceArg, aPointerId, aToWindow, aPreventDefault,
       aIsDOMEventSynthesized, aIsWidgetEventSynthesized);
 }
 
 NS_IMETHODIMP
-nsDOMWindowUtils::SendPointerEventCommon(const nsAString& aType,
-                                         float aX,
-                                         float aY,
-                                         int32_t aButton,
-                                         int32_t aClickCount,
-                                         int32_t aModifiers,
-                                         bool aIgnoreRootScrollFrame,
-                                         float aPressure,
-                                         unsigned short aInputSourceArg,
-                                         int32_t aPointerId,
-                                         int32_t aWidth,
-                                         int32_t aHeight,
-                                         int32_t aTiltX,
-                                         int32_t aTiltY,
-                                         bool aIsPrimary,
-                                         bool aIsSynthesized,
-                                         uint8_t aOptionalArgCount,
-                                         bool aToWindow,
-                                         bool* aPreventDefault)
-{
-  // get the widget to send the event to
-  nsPoint offset;
-  nsCOMPtr<nsIWidget> widget = GetWidget(&offset);
-  if (!widget) {
-    return NS_ERROR_FAILURE;
-  }
-
-  EventMessage msg;
-  if (aType.EqualsLiteral("pointerdown")) {
-    msg = ePointerDown;
-  } else if (aType.EqualsLiteral("pointerup")) {
-    msg = ePointerUp;
-  } else if (aType.EqualsLiteral("pointermove")) {
-    msg = ePointerMove;
-  } else if (aType.EqualsLiteral("pointerover")) {
-    msg = ePointerOver;
-  } else if (aType.EqualsLiteral("pointerout")) {
-    msg = ePointerOut;
-  } else {
-    return NS_ERROR_FAILURE;
-  }
-
-  if (aInputSourceArg == nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN) {
-    aInputSourceArg = nsIDOMMouseEvent::MOZ_SOURCE_MOUSE;
-  }
-
-  WidgetPointerEvent event(true, msg, widget);
-  event.mModifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
-  event.button = aButton;
-  event.buttons = nsContentUtils::GetButtonsFlagForButton(aButton);
-  event.pressure = aPressure;
-  event.inputSource = aInputSourceArg;
-  event.pointerId = aPointerId;
-  event.mWidth = aWidth;
-  event.mHeight = aHeight;
-  event.tiltX = aTiltX;
-  event.tiltY = aTiltY;
-  event.mIsPrimary =
-    (nsIDOMMouseEvent::MOZ_SOURCE_MOUSE == aInputSourceArg) ? true : aIsPrimary;
-  event.mClickCount = aClickCount;
-  event.mTime = PR_IntervalNow();
-  event.mFlags.mIsSynthesizedForTests = aOptionalArgCount >= 10 ? aIsSynthesized : true;
-
-  nsPresContext* presContext = GetPresContext();
-  if (!presContext) {
-    return NS_ERROR_FAILURE;
-  }
-
-  event.mRefPoint =
-    nsContentUtils::ToWidgetPoint(CSSPoint(aX, aY), offset, presContext);
-  event.mIgnoreRootScrollFrame = aIgnoreRootScrollFrame;
-
-  nsEventStatus status;
-  if (aToWindow) {
-    nsCOMPtr<nsIPresShell> presShell;
-    nsView* view = nsContentUtils::GetViewToDispatchEvent(presContext, getter_AddRefs(presShell));
-    if (!presShell || !view) {
-      return NS_ERROR_FAILURE;
-    }
-    status = nsEventStatus_eIgnore;
-    return presShell->HandleEvent(view->GetFrame(), &event, false, &status);
-  }
-  nsresult rv = widget->DispatchEvent(&event, status);
-  if (aPreventDefault) {
-    *aPreventDefault = (status == nsEventStatus_eConsumeNoDefault);
-  }
-
-  return rv;
-}
-
-NS_IMETHODIMP
-nsDOMWindowUtils::SendPointerEvent(const nsAString& aType,
-                                   float aX,
-                                   float aY,
-                                   int32_t aButton,
-                                   int32_t aClickCount,
-                                   int32_t aModifiers,
-                                   bool aIgnoreRootScrollFrame,
-                                   float aPressure,
-                                   unsigned short aInputSourceArg,
-                                   int32_t aPointerId,
-                                   int32_t aWidth,
-                                   int32_t aHeight,
-                                   int32_t aTiltX,
-                                   int32_t aTiltY,
-                                   bool aIsPrimary,
-                                   bool aIsSynthesized,
-                                   uint8_t aOptionalArgCount,
-                                   bool* aPreventDefault)
-{
-  AUTO_PROFILER_LABEL("nsDOMWindowUtils::SendPointerEvent", EVENTS);
-
-  return SendPointerEventCommon(aType, aX, aY, aButton, aClickCount,
-                                aModifiers, aIgnoreRootScrollFrame,
-                                aPressure, aInputSourceArg, aPointerId,
-                                aWidth, aHeight, aTiltX, aTiltY,
-                                aIsPrimary, aIsSynthesized,
-                                aOptionalArgCount, false, aPreventDefault);
-}
-
-NS_IMETHODIMP
-nsDOMWindowUtils::SendPointerEventToWindow(const nsAString& aType,
-                                           float aX,
-                                           float aY,
-                                           int32_t aButton,
-                                           int32_t aClickCount,
-                                           int32_t aModifiers,
-                                           bool aIgnoreRootScrollFrame,
-                                           float aPressure,
-                                           unsigned short aInputSourceArg,
-                                           int32_t aPointerId,
-                                           int32_t aWidth,
-                                           int32_t aHeight,
-                                           int32_t aTiltX,
-                                           int32_t aTiltY,
-                                           bool aIsPrimary,
-                                           bool aIsSynthesized,
-                                           uint8_t aOptionalArgCount)
-{
-  AUTO_PROFILER_LABEL("nsDOMWindowUtils::SendPointerEventToWindow", EVENTS);
-
-  return SendPointerEventCommon(aType, aX, aY, aButton, aClickCount,
-                                aModifiers, aIgnoreRootScrollFrame,
-                                aPressure, aInputSourceArg, aPointerId,
-                                aWidth, aHeight, aTiltX, aTiltY,
-                                aIsPrimary, aIsSynthesized,
-                                aOptionalArgCount, true, nullptr);
-}
-
-NS_IMETHODIMP
 nsDOMWindowUtils::SendWheelEvent(float aX,
                                  float aY,
                                  double aDeltaX,
                                  double aDeltaY,
                                  double aDeltaZ,
                                  uint32_t aDeltaMode,
                                  int32_t aModifiers,
                                  int32_t aLineOrPageDeltaX,
--- a/dom/base/nsDOMWindowUtils.h
+++ b/dom/base/nsDOMWindowUtils.h
@@ -95,36 +95,16 @@ protected:
                                   unsigned short aInputSourceArg,
                                   uint32_t aIdentifier,
                                   bool aToWindow,
                                   bool *aPreventDefault,
                                   bool aIsDOMEventSynthesized,
                                   bool aIsWidgetEventSynthesized,
                                   int32_t aButtons);
 
-  NS_IMETHOD SendPointerEventCommon(const nsAString& aType,
-                                    float aX,
-                                    float aY,
-                                    int32_t aButton,
-                                    int32_t aClickCount,
-                                    int32_t aModifiers,
-                                    bool aIgnoreRootScrollFrame,
-                                    float aPressure,
-                                    unsigned short aInputSourceArg,
-                                    int32_t aPointerId,
-                                    int32_t aWidth,
-                                    int32_t aHeight,
-                                    int32_t aTiltX,
-                                    int32_t aTiltY,
-                                    bool aIsPrimary,
-                                    bool aIsSynthesized,
-                                    uint8_t aOptionalArgCount,
-                                    bool aToWindow,
-                                    bool* aPreventDefault);
-
   NS_IMETHOD SendTouchEventCommon(const nsAString& aType,
                                   uint32_t* aIdentifiers,
                                   int32_t* aXs,
                                   int32_t* aYs,
                                   uint32_t* aRxs,
                                   uint32_t* aRys,
                                   float* aRotationAngles,
                                   float* aForces,
--- a/dom/events/test/test_bug967796.html
+++ b/dom/events/test/test_bug967796.html
@@ -38,19 +38,19 @@ var iframe;
 var checkRelatedTarget = false;
 var expectedRelatedEnter = null;
 var expectedRelatedLeave = null;
 var pointerentercount = 0;
 var pointerleavecount = 0;
 var pointerovercount = 0;
 var pointeroutcount = 0;
 
-function sendPointerEvent(t, elem) {
+function sendMouseEventToElement(t, elem) {
   var r = elem.getBoundingClientRect();
-  synthesizePointer(elem, r.width / 2, r.height / 2, {type: t});
+  synthesizeMouse(elem, r.width / 2, r.height / 2, {type: t});
 }
 
 var expectedPointerEnterTargets = [];
 var expectedPointerLeaveTargets = [];
 
 function runTests() {
   outer = document.getElementById("outertest");
   middle = document.getElementById("middletest");
@@ -63,60 +63,60 @@ function runTests() {
   iframe.height=50;
   container.appendChild(iframe);
   iframe.addEventListener("pointerenter", penter);
   iframe.addEventListener("pointerleave", pleave);
   iframe.addEventListener("pointerout", pout);
   iframe.addEventListener("pointerover", pover);
 
   // Make sure ESM thinks pointer is outside the test elements.
-  sendPointerEvent("pointermove", outside);
+  sendMouseEventToElement("mousemove", outside);
 
   pointerentercount = 0;
   pointerleavecount = 0;
   pointerovercount = 0;
   pointeroutcount = 0;
   checkRelatedTarget = true;
   expectedRelatedEnter = outside;
   expectedRelatedLeave = inner;
   expectedPointerEnterTargets = ["outertest", "middletest", "innertest"];
-  sendPointerEvent("pointermove", inner);
+  sendMouseEventToElement("mousemove", inner);
   is(pointerentercount, 3, "Unexpected pointerenter event count!");
   is(pointerovercount, 1, "Unexpected pointerover event count!");
   is(pointeroutcount, 0, "Unexpected pointerout event count!");
   is(pointerleavecount, 0, "Unexpected pointerleave event count!");
   expectedRelatedEnter = inner;
   expectedRelatedLeave = outside;
   expectedPointerLeaveTargets = ["innertest", "middletest", "outertest"];
-  sendPointerEvent("pointermove", outside);
+  sendMouseEventToElement("mousemove", outside);
   is(pointerentercount, 3, "Unexpected pointerenter event count!");
   is(pointerovercount, 1, "Unexpected pointerover event count!");
   is(pointeroutcount, 1, "Unexpected pointerout event count!");
   is(pointerleavecount, 3, "Unexpected pointerleave event count!");
 
   // Event handling over native anonymous content.
   var r = file.getBoundingClientRect();
   expectedRelatedEnter = outside;
   expectedRelatedLeave = file;
-  synthesizePointer(file, r.width / 6, r.height / 2, {type: "pointermove"});
+  synthesizeMouse(file, r.width / 6, r.height / 2, {type: "mousemove"});
   is(pointerentercount, 4, "Unexpected pointerenter event count!");
   is(pointerovercount, 2, "Unexpected pointerover event count!");
   is(pointeroutcount, 1, "Unexpected pointerout event count!");
   is(pointerleavecount, 3, "Unexpected pointerleave event count!");
 
   // Moving pointer over type="file" shouldn't cause pointerover/out/enter/leave events
-  synthesizePointer(file, r.width - (r.width / 6), r.height / 2, {type: "pointermove"});
+  synthesizeMouse(file, r.width - (r.width / 6), r.height / 2, {type: "mousemove"});
   is(pointerentercount, 4, "Unexpected pointerenter event count!");
   is(pointerovercount, 2, "Unexpected pointerover event count!");
   is(pointeroutcount, 1, "Unexpected pointerout event count!");
   is(pointerleavecount, 3, "Unexpected pointerleave event count!");
 
   expectedRelatedEnter = file;
   expectedRelatedLeave = outside;
-  sendPointerEvent("pointermove", outside);
+  sendMouseEventToElement("mousemove", outside);
   is(pointerentercount, 4, "Unexpected pointerenter event count!");
   is(pointerovercount, 2, "Unexpected pointerover event count!");
   is(pointeroutcount, 2, "Unexpected pointerout event count!");
   is(pointerleavecount, 4, "Unexpected pointerleave event count!");
 
   // Initialize iframe
   iframe.contentDocument.documentElement.style.overflow = "hidden";
   iframe.contentDocument.body.style.margin = "0px";
@@ -130,47 +130,47 @@ function runTests() {
   iframe.contentDocument.body.firstChild.onpointerenter = penter;
   iframe.contentDocument.body.firstChild.onpointerleave = pleave;
   iframe.contentDocument.body.lastChild.onpointerenter = penter;
   iframe.contentDocument.body.lastChild.onpointerleave = pleave;
   r = iframe.getBoundingClientRect();
   expectedRelatedEnter = outside;
   expectedRelatedLeave = iframe;
   // Move pointer inside the iframe.
-  synthesizePointer(iframe.contentDocument.body, r.width / 2, r.height / 4, {type: "pointermove"},
-                    iframe.contentWindow);
+  synthesizeMouse(iframe.contentDocument.body, r.width / 2, r.height / 4, {type: "mousemove"},
+                  iframe.contentWindow);
   is(pointerentercount, 6, "Unexpected pointerenter event count!");
   is(pointerleavecount, 4, "Unexpected pointerleave event count!");
-  synthesizePointer(iframe.contentDocument.body, r.width / 2, r.height - (r.height / 4), {type: "pointermove"},
-                    iframe.contentWindow);
+  synthesizeMouse(iframe.contentDocument.body, r.width / 2, r.height - (r.height / 4), {type: "mousemove"},
+                  iframe.contentWindow);
   is(pointerentercount, 7, "Unexpected pointerenter event count!");
   is(pointerleavecount, 5, "Unexpected pointerleave event count!");
   expectedRelatedEnter = iframe;
   expectedRelatedLeave = outside;
-  sendPointerEvent("pointermove", outside);
+  sendMouseEventToElement("mousemove", outside);
   is(pointerentercount, 7, "Unexpected pointerenter event count!");
   is(pointerleavecount, 7, "Unexpected pointerleave event count!");
 
   // pointerdown must produce pointerenter event
   expectedRelatedEnter = outside;
   expectedRelatedLeave = iframe;
   // Move pointer inside the iframe.
-  synthesizePointer(iframe.contentDocument.body, r.width / 2, r.height / 4, {type: "pointerdown"},
-                    iframe.contentWindow);
-  synthesizePointer(iframe.contentDocument.body, r.width / 2, r.height - (r.height / 4), {type: "pointerdown"},
-                    iframe.contentWindow);
+  synthesizeMouse(iframe.contentDocument.body, r.width / 2, r.height / 4, {type: "mousedown"},
+                  iframe.contentWindow);
+  synthesizeMouse(iframe.contentDocument.body, r.width / 2, r.height - (r.height / 4), {type: "mousedown"},
+                  iframe.contentWindow);
   is(pointerentercount, 10, "Unexpected pointerenter event count!");
 
   // pointerdown + pointermove must produce single pointerenter event
   expectedRelatedEnter = outside;
   expectedRelatedLeave = iframe;
-  synthesizePointer(iframe.contentDocument.body, r.width / 2, r.height / 4, {type: "pointerdown"},
-                    iframe.contentWindow);
-  synthesizePointer(iframe.contentDocument.body, r.width / 2 + 1, r.height / 4 + 1, {type: "pointermove"},
-                    iframe.contentWindow);
+  synthesizeMouse(iframe.contentDocument.body, r.width / 2, r.height / 4, {type: "mousedown"},
+                  iframe.contentWindow);
+  synthesizeMouse(iframe.contentDocument.body, r.width / 2 + 1, r.height / 4 + 1, {type: "mousemove"},
+                  iframe.contentWindow);
   is(pointerentercount, 11, "Unexpected pointerenter event count!");
 
   Array.from(document.querySelectorAll('*'))
     .concat([iframe.contentDocument.body.firstChild, iframe.contentDocument.body.lastChild])
     .forEach((elt) => {
       elt.onpointerenter = null;
       elt.onpointerleave = null;
       elt.onpointerenter = null;
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -337,83 +337,16 @@ interface nsIDOMWindowUtils : nsISupport
                          [optional] in boolean aIgnoreRootScrollFrame,
                          [optional] in float aPressure,
                          [optional] in unsigned short aInputSourceArg,
                          [optional] in boolean aIsDOMEventSynthesized,
                          [optional] in boolean aIsWidgetEventSynthesized,
                          [optional] in long aButtons,
                          [optional] in unsigned long aIdentifier);
 
-
-  /** Synthesize a pointer event. The event types supported are:
-   *    pointerdown, pointerup, pointermove, pointerover, pointerout
-   *
-   * Events are sent in coordinates offset by aX and aY from the window.
-   *
-   * Note that additional events may be fired as a result of this call. For
-   * instance, typically a click event will be fired as a result of a
-   * mousedown and mouseup in sequence.
-   *
-   * Normally at this level of events, the pointerover and pointerout events are
-   * only fired when the window is entered or exited. For inter-element
-   * pointerover and pointerout events, a movemove event fired on the new element
-   * should be sufficient to generate the correct over and out events as well.
-   *
-   * Cannot be accessed from unprivileged context (not content-accessible)
-   * Will throw a DOM security error if called without chrome privileges.
-   *
-   * The event is dispatched via the toplevel window, so it could go to any
-   * window under the toplevel window, in some cases it could never reach this
-   * window at all.
-   *
-   * @param aType event type
-   * @param aX x offset in CSS pixels
-   * @param aY y offset in CSS pixels
-   * @param aButton button to synthesize
-   * @param aClickCount number of clicks that have been performed
-   * @param aModifiers modifiers pressed, using constants defined as MODIFIER_*
-   * @param aIgnoreRootScrollFrame whether the event should ignore viewport bounds
-   *                           during dispatch
-   * @param aPressure touch input pressure: 0.0 -> 1.0
-   * @param aInputSourceArg input source, see nsIDOMMouseEvent for values,
-   *        defaults to mouse input.
-   * @param aPointerId A unique identifier for the pointer causing the event,
-   *                   defaulting to nsIDOMWindowUtils::DEFAULT_MOUSE_POINTER_ID.
-   * @param aWidth The width (magnitude on the X axis), default is 0
-   * @param aHeight The height (magnitude on the Y axis), default is 0
-   * @param aTilt The plane angle between the Y-Z plane
-   *        and the plane containing both the transducer (e.g. pen stylus) axis and the Y axis. default is 0
-   * @param aTiltX The plane angle between the X-Z plane
-   *        and the plane containing both the transducer (e.g. pen stylus) axis and the X axis. default is 0
-   * @param aIsPrimary  Indicates if the pointer represents the primary pointer of this pointer type.
-   * @param aIsSynthesized controls nsIDOMEvent.isSynthesized value
-   *                       that helps identifying test related events,
-   *                       defaults to true
-   *
-   * returns true if the page called prevent default on this event
-   */
-
-  [optional_argc]
-  boolean sendPointerEvent(in AString aType,
-                           in float aX,
-                           in float aY,
-                           in long aButton,
-                           in long aClickCount,
-                           in long aModifiers,
-                           [optional] in boolean aIgnoreRootScrollFrame,
-                           [optional] in float aPressure,
-                           [optional] in unsigned short aInputSourceArg,
-                           [optional] in long aPointerId,
-                           [optional] in long aWidth,
-                           [optional] in long aHeight,
-                           [optional] in long aTiltX,
-                           [optional] in long aTiltY,
-                           [optional] in boolean aIsPrimary,
-                           [optional] in boolean aIsSynthesized);
-
   /** Synthesize a touch event. The event types supported are:
    *    touchstart, touchend, touchmove, and touchcancel
    *
    * Events are sent in coordinates offset by aX and aY from the window.
    *
    * Cannot be accessed from unprivileged context (not content-accessible)
    * Will throw a DOM security error if called without chrome privileges.
    *
@@ -460,37 +393,16 @@ interface nsIDOMWindowUtils : nsISupport
                               [optional] in boolean aIgnoreRootScrollFrame,
                               [optional] in float aPressure,
                               [optional] in unsigned short aInputSourceArg,
                               [optional] in boolean aIsDOMEventSynthesized,
                               [optional] in boolean aIsWidgetEventSynthesized,
                               [optional] in long aButtons,
                               [optional] in unsigned long aIdentifier);
 
-  /** The same as sendPointerEvent but ensures that the event
-   *  is dispatched to this DOM window or one of its children.
-   */
-  [optional_argc]
-  void sendPointerEventToWindow(in AString aType,
-                                in float aX,
-                                in float aY,
-                                in long aButton,
-                                in long aClickCount,
-                                in long aModifiers,
-                                [optional] in boolean aIgnoreRootScrollFrame,
-                                [optional] in float aPressure,
-                                [optional] in unsigned short aInputSourceArg,
-                                [optional] in long aPointerId,
-                                [optional] in long aWidth,
-                                [optional] in long aHeight,
-                                [optional] in long aTiltX,
-                                [optional] in long aTiltY,
-                                [optional] in boolean aIsPrimary,
-                                [optional] in boolean aIsSynthesized);
-
   /** The same as sendTouchEvent but ensures that the event is dispatched to
    *  this DOM window or one of its children.
    */
   boolean sendTouchEventToWindow(in AString aType,
                                  [array, size_is(count)] in uint32_t aIdentifiers,
                                  [array, size_is(count)] in int32_t aXs,
                                  [array, size_is(count)] in int32_t aYs,
                                  [array, size_is(count)] in uint32_t aRxs,
--- a/layout/base/tests/bug1078327_inner.html
+++ b/layout/base/tests/bug1078327_inner.html
@@ -69,24 +69,24 @@ https://bugzilla.mozilla.org/show_bug.cg
       mediator.addEventListener("pointerover",        MediatorHandler);
       mediator.addEventListener("pointermove",        MediatorHandler);
       mediator.addEventListener("pointerout",         MediatorHandler);
       mediator.addEventListener("lostpointercapture", MediatorHandler);
       listener.addEventListener("pointermove",        ListenerHandler);
       var rect_t = target.getBoundingClientRect();
       var rect_m = mediator.getBoundingClientRect();
       var rect_l = listener.getBoundingClientRect();
-      synthesizePointer(target,   rect_t.width/2, rect_t.height/20, {type: "pointerdown"});
-      synthesizePointer(target,   rect_t.width/2, rect_t.height/20, {type: "pointermove"});
-      synthesizePointer(mediator, rect_m.width/2, rect_m.height/20, {type: "pointermove"});
-      synthesizePointer(listener, rect_l.width/2, rect_l.height/20, {type: "pointermove"});
-      synthesizePointer(mediator, rect_m.width/2, rect_m.height/20, {type: "pointermove"});
-      synthesizePointer(target,   rect_t.width/2, rect_t.height/20, {type: "pointermove"});
-      synthesizePointer(target,   rect_t.width/2, rect_t.height/20, {type: "pointerup"});
-      synthesizePointer(target,   rect_t.width/2, rect_t.height/20, {type: "pointermove"});
+      synthesizeMouse(target,   rect_t.width/2, rect_t.height/20, {type: "mousedown"});
+      synthesizeMouse(target,   rect_t.width/2, rect_t.height/20, {type: "mousemove"});
+      synthesizeMouse(mediator, rect_m.width/2, rect_m.height/20, {type: "mousemove"});
+      synthesizeMouse(listener, rect_l.width/2, rect_l.height/20, {type: "mousemove"});
+      synthesizeMouse(mediator, rect_m.width/2, rect_m.height/20, {type: "mousemove"});
+      synthesizeMouse(target,   rect_t.width/2, rect_t.height/20, {type: "mousemove"});
+      synthesizeMouse(target,   rect_t.width/2, rect_t.height/20, {type: "mouseup"});
+      synthesizeMouse(target,   rect_t.width/2, rect_t.height/20, {type: "mousemove"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_target,        true,   "pointerdown event should be received by target");
       parent.is(test_lost_capture,  true,   "mediator should receive lostpointercapture");
       parent.is(test_mediator_over, 1,      "mediator should receive pointerover event only once");
       parent.is(test_mediator_move, 5,      "mediator should receive pointermove event five times");
       parent.is(test_mediator_out,  1,      "mediator should receive pointerout event only once");
--- a/layout/base/tests/bug1080360_inner.html
+++ b/layout/base/tests/bug1080360_inner.html
@@ -54,19 +54,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       logger("executeTest");
       target = document.getElementById("target");
       listener = document.getElementById("listener");
       target.addEventListener("pointerdown",          TargetHandler);
       listener.addEventListener("gotpointercapture",  ListenerHandler);
       listener.addEventListener("lostpointercapture", ListenerHandler);
       document.addEventListener("lostpointercapture", DocumentHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2,  {type: "pointerdown"});
-      synthesizePointer(target, rect.width/2, rect.height/2,  {type: "pointermove"});
-      synthesizePointer(target, rect.width/2, rect.height/2,  {type: "pointerup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2,  {type: "mousedown"});
+      synthesizeMouse(target, rect.width/2, rect.height/2,  {type: "mousemove"});
+      synthesizeMouse(target, rect.width/2, rect.height/2,  {type: "mouseup"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_target,        true,   "pointerdown event should be received by target");
       parent.is(test_listener_got,  true,   "gotpointercapture event should be received by listener");
       parent.is(test_listener_lost, false,  "listener should not receive lostpointercapture event");
       parent.is(test_document,      true,   "document should receive lostpointercapture event");
       logger("finishTest");
--- a/layout/base/tests/bug1080361_inner.html
+++ b/layout/base/tests/bug1080361_inner.html
@@ -78,19 +78,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       logger("executeTest");
       target = document.getElementById("target");
       mediator = document.getElementById("mediator");
       listener = document.getElementById("listener");
       target.addEventListener("pointerdown",          TargetDownHandler);
       target.addEventListener("pointerup",            TargetUpHandler);
       listener.addEventListener("gotpointercapture",  ListenerHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointermove"});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousemove"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mouseup"});
       finishTest();
     }
     function finishTest() {
       setTimeout(function() {
         parent.is(test_target_down, true,   "pointerdown event should be received by target");
         parent.is(test_target_up,   true,   "pointerup event should be received by target");
         parent.is(test_first_exc,   true,   "first exception should be thrown");
         parent.is(test_second_exc,  true,   "second exception should be thrown");
--- a/layout/base/tests/bug1153130_inner.html
+++ b/layout/base/tests/bug1153130_inner.html
@@ -41,22 +41,22 @@ https://bugzilla.mozilla.org/show_bug.cg
     }
     function executeTest() {
       logger("executeTest");
       target = document.getElementById("target");
       target.addEventListener("pointerdown",        TargetHandler);
       target.addEventListener("gotpointercapture",  TargetHandler);
       target.addEventListener("pointermove",        TargetHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/5, rect.height/5,  {type: "pointermove"});
-      synthesizePointer(target, rect.width/5, rect.height/5,  {type: "pointerdown"});
-      synthesizePointer(target, rect.width/4, rect.height/4,  {type: "pointermove"});
-      synthesizePointer(target, rect.width/3, rect.height/3,  {type: "pointermove"});
-      synthesizePointer(target, rect.width/3, rect.height/3,  {type: "pointerup"});
-      synthesizePointer(target, rect.width/2, rect.height/2,  {type: "pointermove"});
+      synthesizeMouse(target, rect.width/5, rect.height/5,  {type: "mousemove"});
+      synthesizeMouse(target, rect.width/5, rect.height/5,  {type: "mousedown"});
+      synthesizeMouse(target, rect.width/4, rect.height/4,  {type: "mousemove"});
+      synthesizeMouse(target, rect.width/3, rect.height/3,  {type: "mousemove"});
+      synthesizeMouse(target, rect.width/3, rect.height/3,  {type: "mouseup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2,  {type: "mousemove"});
       test_success = true;
       finishTest();
     }
     function finishTest() {
       parent.is(test_down,    true, "pointerdown event should be received by target");
       parent.is(test_capture, true, "gotpointercapture event should be received by target");
       parent.is(test_move,    true, "pointermove event should be received by target while pointer capture is active");
       parent.is(test_success, true, "Firefox should be live!");
--- a/layout/base/tests/bug1162990_inner_1.html
+++ b/layout/base/tests/bug1162990_inner_1.html
@@ -95,23 +95,23 @@ https://bugzilla.mozilla.org/show_bug.cg
     }
 
     function executeTest()
     {
       logger("executeTest");
       setEventHandlers();
       var rectCd = child.getBoundingClientRect();
       var rectLr = listener.getBoundingClientRect();
-      synthesizePointer(listener, rectLr.width/3, rectLr.height/2,  {type: "pointerdown"});
-      synthesizePointer(child,    rectCd.width/3, rectCd.height/2,  {type: "pointermove"});
-      synthesizePointer(listener, rectLr.width/3, rectLr.height/2,  {type: "pointermove"});
-      synthesizePointer(child,    rectCd.width/3, rectCd.height/2,  {type: "pointermove"});
-      synthesizePointer(listener, rectLr.width/3, rectLr.height/2,  {type: "pointermove"});
-      synthesizePointer(listener, rectLr.width/3, rectLr.height/2,  {type: "pointerup"});
-      synthesizePointer(listener, rectLr.width/3, rectLr.height/3,  {type: "pointermove"});
+      synthesizeMouse(listener, rectLr.width/3, rectLr.height/2,  {type: "mousedown"});
+      synthesizeMouse(child,    rectCd.width/3, rectCd.height/2,  {type: "mousemove"});
+      synthesizeMouse(listener, rectLr.width/3, rectLr.height/2,  {type: "mousemove"});
+      synthesizeMouse(child,    rectCd.width/3, rectCd.height/2,  {type: "mousemove"});
+      synthesizeMouse(listener, rectLr.width/3, rectLr.height/2,  {type: "mousemove"});
+      synthesizeMouse(listener, rectLr.width/3, rectLr.height/2,  {type: "mouseup"});
+      synthesizeMouse(listener, rectLr.width/3, rectLr.height/3,  {type: "mousemove"});
       finishTest();
     }
 
     function finishTest() {
       parent.is(test_basketLeave,       1, "Part1: basket should receive pointerleave event after pointer capturing");
       parent.is(test_targetGotCapture,  1, "Part1: target should receive gotpointercapture event");
       parent.is(test_targetLostCapture, 1, "Part1: target should receive lostpointercapture event");
       parent.is(test_targetLeave,       1, "Part1: target should receive pointerleave event only one time");
--- a/layout/base/tests/bug1162990_inner_2.html
+++ b/layout/base/tests/bug1162990_inner_2.html
@@ -96,23 +96,23 @@ https://bugzilla.mozilla.org/show_bug.cg
 
     function executeTest()
     {
       logger("executeTest");
       setEventHandlers();
       var rectTg = target.getBoundingClientRect();
       var rectCd = child.getBoundingClientRect();
       var rectLr = listener.getBoundingClientRect();
-      synthesizePointer(target,   rectTg.width/3, rectTg.height/7,  {type: "pointerdown"});
-      synthesizePointer(child,    rectCd.width/3, rectCd.height/2,  {type: "pointermove"});
-      synthesizePointer(listener, rectLr.width/3, rectLr.height/2,  {type: "pointermove"});
-      synthesizePointer(child,    rectCd.width/3, rectCd.height/2,  {type: "pointermove"});
-      synthesizePointer(target,   rectTg.width/3, rectTg.height/7,  {type: "pointermove"});
-      synthesizePointer(target,   rectTg.width/3, rectTg.height/7,  {type: "pointerup"});
-      synthesizePointer(target,   rectTg.width/3, rectTg.height/9,  {type: "pointermove"});
+      synthesizeMouse(target,   rectTg.width/3, rectTg.height/7,  {type: "mousedown"});
+      synthesizeMouse(child,    rectCd.width/3, rectCd.height/2,  {type: "mousemove"});
+      synthesizeMouse(listener, rectLr.width/3, rectLr.height/2,  {type: "mousemove"});
+      synthesizeMouse(child,    rectCd.width/3, rectCd.height/2,  {type: "mousemove"});
+      synthesizeMouse(target,   rectTg.width/3, rectTg.height/7,  {type: "mousemove"});
+      synthesizeMouse(target,   rectTg.width/3, rectTg.height/7,  {type: "mouseup"});
+      synthesizeMouse(target,   rectTg.width/3, rectTg.height/9,  {type: "mousemove"});
       finishTest();
     }
 
     function finishTest() {
       parent.is(test_basketLeave,       0, "Part2: basket should not receive pointerleave event after pointer capturing");
       parent.is(test_targetDown,        1, "Part2: target should receive pointerdown event");
       parent.is(test_targetGotCapture,  1, "Part2: target should receive gotpointercapture event");
       parent.is(test_targetLostCapture, 1, "Part2: target should receive lostpointercapture event");
--- a/layout/base/tests/bug977003_inner_1.html
+++ b/layout/base/tests/bug977003_inner_1.html
@@ -63,18 +63,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     function executeTest()
     {
       logger("executeTest");
       target = document.getElementById("target");
       target.addEventListener("pointerdown",        DownHandler);
       target.addEventListener("gotpointercapture",  GotPCHandler);
       target.addEventListener("lostpointercapture", LostPCHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mouseup"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_send_got,        1, "Part 1: gotpointercapture event should be sent once");
       parent.is(test_got_async,       1, "Part 1: gotpointercapture event should be asynchronous");
       parent.is(test_got_type,  "mouse", "Part 1: gotpointercapture event should have pointerType mouse");
       parent.is(test_got_primary,  true, "Part 1: gotpointercapture event should have isPrimary as true");
       parent.is(test_send_lost,       1, "Part 1: lostpointercapture event should be sent once");
--- a/layout/base/tests/bug977003_inner_2.html
+++ b/layout/base/tests/bug977003_inner_2.html
@@ -45,18 +45,18 @@ https://bugzilla.mozilla.org/show_bug.cg
     {
       logger("executeTest");
       target = document.getElementById("target");
       listener = document.getElementById("listener");
       target.addEventListener("pointerdown",          TargetDownHandler);
       listener.addEventListener("gotpointercapture",  ListenerHandler);
       listener.addEventListener("lostpointercapture", ListenerHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mouseup"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_down_got,  true,  "Part 2: pointerdown event should be received by target");
       parent.is(test_listener,  false, "Part 2: listener should not receive any events");
       logger("finishTest");
       parent.finishTest();
     }
--- a/layout/base/tests/bug977003_inner_3.html
+++ b/layout/base/tests/bug977003_inner_3.html
@@ -61,19 +61,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       mediator = document.getElementById("mediator");
       listener = document.getElementById("listener");
       target.addEventListener("pointerdown",          TargetDownHandler);
       mediator.addEventListener("gotpointercapture",  MediatorGotPCHandler);
       mediator.addEventListener("lostpointercapture", MediatorLostPCHandler);
       listener.addEventListener("gotpointercapture",  ListenerHandler);
       listener.addEventListener("lostpointercapture", ListenerHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"});
-      synthesizePointer(target, rect.width/3, rect.height/3, {type: "pointermove"});
-      synthesizePointer(target, rect.width/4, rect.height/4, {type: "pointermove"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown"});
+      synthesizeMouse(target, rect.width/3, rect.height/3, {type: "mousemove"});
+      synthesizeMouse(target, rect.width/4, rect.height/4, {type: "mousemove"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_down_got,      true,  "Part 3: pointerdown event should be received");
       parent.is(test_mediator_got,  true,  "Part 3: gotpointercapture event should be received by Mediator");
       parent.is(test_mediator_lost, true,  "Part 3: lostpointercapture event should be received by Mediator");
       parent.is(test_listener,      false, "Part 3: listener should not receive any events");
       logger("finishTest");
--- a/layout/base/tests/bug977003_inner_4.html
+++ b/layout/base/tests/bug977003_inner_4.html
@@ -64,20 +64,20 @@ https://bugzilla.mozilla.org/show_bug.cg
       mediator = document.getElementById("mediator");
       listener = document.getElementById("listener");
       target.addEventListener("pointerdown",          TargetDownHandler);
       mediator.addEventListener("gotpointercapture",  MediatorGotPCHandler);
       mediator.addEventListener("lostpointercapture", MediatorLostPCHandler);
       listener.addEventListener("gotpointercapture",  ListenerGotHandler);
       listener.addEventListener("lostpointercapture", ListenerLostHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"});
-      synthesizePointer(target, rect.width/3, rect.height/3, {type: "pointermove"});
-      synthesizePointer(target, rect.width/4, rect.height/4, {type: "pointermove"});
-      synthesizePointer(target, rect.width/4, rect.height/4, {type: "pointerup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown"});
+      synthesizeMouse(target, rect.width/3, rect.height/3, {type: "mousemove"});
+      synthesizeMouse(target, rect.width/4, rect.height/4, {type: "mousemove"});
+      synthesizeMouse(target, rect.width/4, rect.height/4, {type: "mouseup"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_down_got,      true,  "Part 4: pointerdown event should be received");
       parent.is(test_mediator_got,  true,  "Part 4: gotpointercapture event should be received by Mediator");
       parent.is(test_mediator_lost, true,  "Part 4: lostpointercapture event should be received by Mediator");
       parent.is(test_listener_got,  true,  "Part 4: gotpointercapture event should be received by listener");
       parent.is(test_listener_lost, true,  "Part 4: lostpointercapture event should be received by listener");
--- a/layout/base/tests/bug977003_inner_5.html
+++ b/layout/base/tests/bug977003_inner_5.html
@@ -79,19 +79,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       target.addEventListener("pointerdown",          TargetDownHandler);
       listener.addEventListener("gotpointercapture",  ListenerGotPCHandler);
       listener.addEventListener("lostpointercapture", ListenerLostPCHandler);
       listener.addEventListener("pointerover",        ListenerOverHandler);
       listener.addEventListener("pointermove",        ListenerMoveHandler);
       listener.addEventListener("pointerup",          ListenerHandler);
       listener.addEventListener("pointerout",         ListenerHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown", isPrimary: true, inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointermove", isPrimary: true, inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerup",   isPrimary: true, inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown", isPrimary: true, inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousemove", isPrimary: true, inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mouseup",   isPrimary: true, inputSource: SpecialPowers.Ci.nsIDOMMouseEvent.MOZ_SOURCE_TOUCH});
       finishTest();
     }
     function finishTest() {
       parent.is(test_down_target,     true, "Part 5: pointerdown event should be received by target");
       parent.is(test_got_listener,    true, "Part 5: listener should receive gotpointercapture event");
       parent.is(test_got_type,     "touch", "Part 5: gotpointercapture event should have pointerType touch");
       parent.is(test_got_primary,     true, "Part 5: gotpointercapture event should have isPrimary as true");
       parent.is(test_lost_listener,   true, "Part 5: listener should receive lostpointercapture event");
--- a/layout/base/tests/bug977003_inner_6.html
+++ b/layout/base/tests/bug977003_inner_6.html
@@ -69,19 +69,19 @@ https://bugzilla.mozilla.org/show_bug.cg
       listener.addEventListener("gotpointercapture",  ListenerHandler);
       listener.addEventListener("pointerdown",        ListenerHandler);
       listener.addEventListener("pointerover",        ListenerHandler);
       listener.addEventListener("pointermove",        ListenerHandler);
       listener.addEventListener("pointerup",          ListenerHandler);
       listener.addEventListener("pointerout",         ListenerHandler);
       listener.addEventListener("lostpointercapture", ListenerHandler);
       var rect = target.getBoundingClientRect();
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerdown"});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointermove"});
-      synthesizePointer(target, rect.width/2, rect.height/2, {type: "pointerup"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousedown"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mousemove"});
+      synthesizeMouse(target, rect.width/2, rect.height/2, {type: "mouseup"});
       finishTest();
     }
     function finishTest() {
       parent.is(test_target,    true,   "Part 6: pointerdown event should be received by target");
       // PE level 2 defines that the pending pointer capture is processed when firing next pointer events.
       // In this test case, pointer capture release is processed when firing pointermove
       parent.is(test_move,      true,   "Part 6: gotpointercapture should be triggered by pointermove");
       parent.is(test_over,      true,   "Part 6: pointerover should be received when capturing pointer");
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -5,17 +5,16 @@
  *  sendDragEvent
  *  sendChar
  *  sendString
  *  sendKey
  *  sendWheelAndPaint
  *  sendWheelAndPaintNoFlush
  *  synthesizeMouse
  *  synthesizeMouseAtCenter
- *  synthesizePointer
  *  synthesizeWheel
  *  synthesizeWheelAtPoint
  *  synthesizeKey
  *  synthesizeNativeKey
  *  synthesizeMouseExpectEvent
  *  synthesizeKeyExpectEvent
  *  synthesizeNativeOSXClick
  *  synthesizeDragOver
@@ -358,22 +357,16 @@ function synthesizeMouse(aTarget, aOffse
        aEvent, aWindow);
 }
 function synthesizeTouch(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
 {
   var rect = aTarget.getBoundingClientRect();
   synthesizeTouchAtPoint(rect.left + aOffsetX, rect.top + aOffsetY,
        aEvent, aWindow);
 }
-function synthesizePointer(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
-{
-  var rect = aTarget.getBoundingClientRect();
-  return synthesizePointerAtPoint(rect.left + aOffsetX, rect.top + aOffsetY,
-       aEvent, aWindow);
-}
 
 /*
  * Synthesize a mouse event at a particular point in aWindow.
  *
  * aEvent is an object which may contain the properties:
  *   shiftKey, ctrlKey, altKey, metaKey, accessKey, clickCount, button, type
  *
  * If the type is specified, an mouse event of that type is fired. Otherwise,
@@ -449,45 +442,16 @@ function synthesizeTouchAtPoint(left, to
     }
     else {
       utils.sendTouchEvent("touchstart", [id], [left], [top], [rx], [ry], [angle], [force], 1, modifiers);
       utils.sendTouchEvent("touchend", [id], [left], [top], [rx], [ry], [angle], [force], 1, modifiers);
     }
   }
 }
 
-function synthesizePointerAtPoint(left, top, aEvent, aWindow = window)
-{
-  var utils = _getDOMWindowUtils(aWindow);
-  var defaultPrevented = false;
-
-  if (utils) {
-    var button = computeButton(aEvent);
-    var clickCount = aEvent.clickCount || 1;
-    var modifiers = _parseModifiers(aEvent, aWindow);
-    var pressure = ("pressure" in aEvent) ? aEvent.pressure : 0;
-    var inputSource = ("inputSource" in aEvent) ? aEvent.inputSource : 0;
-    var synthesized = ("isSynthesized" in aEvent) ? aEvent.isSynthesized : true;
-    var isPrimary = ("isPrimary" in aEvent) ? aEvent.isPrimary : false;
-
-    if (("type" in aEvent) && aEvent.type) {
-      defaultPrevented = utils.sendPointerEventToWindow(aEvent.type, left, top, button,
-                                                        clickCount, modifiers, false,
-                                                        pressure, inputSource,
-                                                        synthesized, 0, 0, 0, 0, isPrimary);
-    }
-    else {
-      utils.sendPointerEventToWindow("pointerdown", left, top, button, clickCount, modifiers, false, pressure, inputSource);
-      utils.sendPointerEventToWindow("pointerup", left, top, button, clickCount, modifiers, false, pressure, inputSource);
-    }
-  }
-
-  return defaultPrevented;
-}
-
 // Call synthesizeMouse with coordinates at the center of aTarget.
 function synthesizeMouseAtCenter(aTarget, aEvent, aWindow)
 {
   var rect = aTarget.getBoundingClientRect();
   return synthesizeMouse(aTarget, rect.width / 2, rect.height / 2, aEvent,
                          aWindow);
 }
 function synthesizeTouchAtCenter(aTarget, aEvent, aWindow)
--- a/widget/tests/test_assign_event_data.html
+++ b/widget/tests/test_assign_event_data.html
@@ -618,35 +618,35 @@ const kTests = [
       document.getElementById("animated-div").removeChild(document.getElementById("inserted-div"));
     },
     canRun: function () {
       return true;
     },
     todoMismatch: [],
   },
   { description: "PointerEvent (pointerdown)",
-    targetID: "pointer-target", eventType: "pointerdown",
+    targetID: "pointer-target", eventType: "mousedown",
     dispatchEvent: function () {
       var elem = document.getElementById(this.targetID);
       var rect = elem.getBoundingClientRect();
-      synthesizePointer(elem, rect.width/2, rect.height/2,
-                        { type: this.eventType, button: 1, clickCount: 1, inputSource: 2, pressure: 0.25, isPrimary: true });
+      synthesizeMouse(elem, rect.width/2, rect.height/2,
+                      { type: this.eventType, button: 1, clickCount: 1, inputSource: 2, pressure: 0.25, isPrimary: true });
     },
     canRun: function () {
       return true;
     },
     todoMismatch: [],
   },
   { description: "PointerEvent (pointerup)",
-    targetID: "pointer-target", eventType: "pointerup",
+    targetID: "pointer-target", eventType: "mouseup",
     dispatchEvent: function () {
       var elem = document.getElementById(this.targetID);
       var rect = elem.getBoundingClientRect();
-      synthesizePointer(elem, rect.width/2, rect.height/2,
-                        { type: this.eventType, button: -1, ctrlKey: true, shiftKey: true, altKey: true, isSynthesized: false });
+      synthesizeMouse(elem, rect.width/2, rect.height/2,
+                      { type: this.eventType, button: -1, ctrlKey: true, shiftKey: true, altKey: true, isSynthesized: false });
     },
     canRun: function () {
       return true;
     },
     todoMismatch: [],
   },
 ];