Bug 1550092 part 1. Stop using [array] in sendTouchEvent/sendTouchEventToWindow. r=farre
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 10 May 2019 09:03:39 +0000
changeset 532273 043e58831ea8caac3c0d0a8ab19d2f3b892a122f
parent 532272 11474fbdfdbf2d1dee9a0291173671114c6c28f7
child 532274 4dfa19d72c18aaf806e88c01b830ef23955edcb3
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfarre
bugs1550092
milestone68.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 1550092 part 1. Stop using [array] in sendTouchEvent/sendTouchEventToWindow. r=farre Differential Revision: https://phabricator.services.mozilla.com/D30441
dom/base/nsDOMWindowUtils.cpp
dom/base/nsDOMWindowUtils.h
dom/events/test/pointerevents/test_bug1420589_1.html
dom/events/test/pointerevents/test_bug1420589_2.html
dom/events/test/pointerevents/test_bug1420589_3.html
dom/events/test/pointerevents/test_multiple_touches.html
dom/events/test/test_bug603008.html
dom/events/test/test_bug741666.html
dom/events/test/window_bug1429572.html
dom/interfaces/base/nsIDOMWindowUtils.idl
layout/base/tests/bug968148_inner.html
layout/base/tests/bug968148_inner2.html
layout/base/tests/bug970964_inner.html
layout/base/tests/bug970964_inner2.html
layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
layout/base/tests/test_bug993936.html
layout/generic/test/test_selection_touchevents.html
mobile/android/tests/browser/robocop/testAccessibleCarets.js
testing/marionette/listener.js
testing/mochitest/tests/SimpleTest/EventUtils.js
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -757,45 +757,46 @@ nsDOMWindowUtils::SendWheelEvent(float a
     NS_WARNING(debugMsg.get());
   }
 #endif
 
   return (!failedX && !failedY) ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsDOMWindowUtils::SendTouchEvent(const nsAString& aType, uint32_t* aIdentifiers,
-                                 int32_t* aXs, int32_t* aYs, uint32_t* aRxs,
-                                 uint32_t* aRys, float* aRotationAngles,
-                                 float* aForces, uint32_t aCount,
-                                 int32_t aModifiers,
-                                 bool aIgnoreRootScrollFrame,
-                                 bool* aPreventDefault) {
+nsDOMWindowUtils::SendTouchEvent(
+    const nsAString& aType, const nsTArray<uint32_t>& aIdentifiers,
+    const nsTArray<int32_t>& aXs, const nsTArray<int32_t>& aYs,
+    const nsTArray<uint32_t>& aRxs, const nsTArray<uint32_t>& aRys,
+    const nsTArray<float>& aRotationAngles, const nsTArray<float>& aForces,
+    int32_t aModifiers, bool aIgnoreRootScrollFrame, bool* aPreventDefault) {
   return SendTouchEventCommon(aType, aIdentifiers, aXs, aYs, aRxs, aRys,
-                              aRotationAngles, aForces, aCount, aModifiers,
+                              aRotationAngles, aForces, aModifiers,
                               aIgnoreRootScrollFrame, false, aPreventDefault);
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::SendTouchEventToWindow(
-    const nsAString& aType, uint32_t* aIdentifiers, int32_t* aXs, int32_t* aYs,
-    uint32_t* aRxs, uint32_t* aRys, float* aRotationAngles, float* aForces,
-    uint32_t aCount, int32_t aModifiers, bool aIgnoreRootScrollFrame,
-    bool* aPreventDefault) {
+    const nsAString& aType, const nsTArray<uint32_t>& aIdentifiers,
+    const nsTArray<int32_t>& aXs, const nsTArray<int32_t>& aYs,
+    const nsTArray<uint32_t>& aRxs, const nsTArray<uint32_t>& aRys,
+    const nsTArray<float>& aRotationAngles, const nsTArray<float>& aForces,
+    int32_t aModifiers, bool aIgnoreRootScrollFrame, bool* aPreventDefault) {
   return SendTouchEventCommon(aType, aIdentifiers, aXs, aYs, aRxs, aRys,
-                              aRotationAngles, aForces, aCount, aModifiers,
+                              aRotationAngles, aForces, aModifiers,
                               aIgnoreRootScrollFrame, true, aPreventDefault);
 }
 
-NS_IMETHODIMP
-nsDOMWindowUtils::SendTouchEventCommon(
-    const nsAString& aType, uint32_t* aIdentifiers, int32_t* aXs, int32_t* aYs,
-    uint32_t* aRxs, uint32_t* aRys, float* aRotationAngles, float* aForces,
-    uint32_t aCount, int32_t aModifiers, bool aIgnoreRootScrollFrame,
-    bool aToWindow, bool* aPreventDefault) {
+nsresult nsDOMWindowUtils::SendTouchEventCommon(
+    const nsAString& aType, const nsTArray<uint32_t>& aIdentifiers,
+    const nsTArray<int32_t>& aXs, const nsTArray<int32_t>& aYs,
+    const nsTArray<uint32_t>& aRxs, const nsTArray<uint32_t>& aRys,
+    const nsTArray<float>& aRotationAngles, const nsTArray<float>& aForces,
+    int32_t aModifiers, bool aIgnoreRootScrollFrame, bool aToWindow,
+    bool* aPreventDefault) {
   // get the widget to send the event to
   nsPoint offset;
   nsCOMPtr<nsIWidget> widget = GetWidget(&offset);
   if (!widget) {
     return NS_ERROR_NULL_POINTER;
   }
   EventMessage msg;
   if (aType.EqualsLiteral("touchstart")) {
@@ -812,18 +813,24 @@ nsDOMWindowUtils::SendTouchEventCommon(
   WidgetTouchEvent event(true, msg, widget);
   event.mModifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
   event.mTime = PR_Now();
 
   nsPresContext* presContext = GetPresContext();
   if (!presContext) {
     return NS_ERROR_FAILURE;
   }
-  event.mTouches.SetCapacity(aCount);
-  for (uint32_t i = 0; i < aCount; ++i) {
+  uint32_t count = aIdentifiers.Length();
+  if (aXs.Length() != count || aYs.Length() != count ||
+      aRxs.Length() != count || aRys.Length() != count ||
+      aRotationAngles.Length() != count || aForces.Length() != count) {
+    return NS_ERROR_INVALID_ARG;
+  }
+  event.mTouches.SetCapacity(count);
+  for (uint32_t i = 0; i < count; ++i) {
     LayoutDeviceIntPoint pt = nsContentUtils::ToWidgetPoint(
         CSSPoint(aXs[i], aYs[i]), offset, presContext);
     LayoutDeviceIntPoint radius = LayoutDeviceIntPoint::FromAppUnitsRounded(
         CSSPoint::ToAppUnits(CSSPoint(aRxs[i], aRys[i])),
         presContext->AppUnitsPerDevPixel());
 
     RefPtr<Touch> t =
         new Touch(aIdentifiers[i], pt, radius, aRotationAngles[i], aForces[i]);
--- a/dom/base/nsDOMWindowUtils.h
+++ b/dom/base/nsDOMWindowUtils.h
@@ -89,18 +89,18 @@ class nsDOMWindowUtils final : public ns
   NS_IMETHOD SendMouseEventCommon(
       const nsAString& aType, float aX, float aY, int32_t aButton,
       int32_t aClickCount, int32_t aModifiers, bool aIgnoreRootScrollFrame,
       float aPressure, unsigned short aInputSourceArg, uint32_t aIdentifier,
       bool aToWindow, bool* aPreventDefault, bool aIsDOMEventSynthesized,
       bool aIsWidgetEventSynthesized, int32_t aButtons);
 
   MOZ_CAN_RUN_SCRIPT
-  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,
-                                  uint32_t aCount, int32_t aModifiers,
-                                  bool aIgnoreRootScrollFrame, bool aToWindow,
-                                  bool* aPreventDefault);
+  nsresult SendTouchEventCommon(
+      const nsAString& aType, const nsTArray<uint32_t>& aIdentifiers,
+      const nsTArray<int32_t>& aXs, const nsTArray<int32_t>& aYs,
+      const nsTArray<uint32_t>& aRxs, const nsTArray<uint32_t>& aRys,
+      const nsTArray<float>& aRotationAngles, const nsTArray<float>& aForces,
+      int32_t aModifiers, bool aIgnoreRootScrollFrame, bool aToWindow,
+      bool* aPreventDefault);
 };
 
 #endif
--- a/dom/events/test/pointerevents/test_bug1420589_1.html
+++ b/dom/events/test/pointerevents/test_bug1420589_1.html
@@ -78,23 +78,23 @@ function withoutImplicitlyPointerCapture
   let left2 = rect2.left + 5;
 
   let top1 = rect1.top + 5;
   let top2 = rect2.top + 5;
 
   var utils = SpecialPowers.getDOMWindowUtils(window);
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 }
 
 SimpleTest.waitForFocus(() => {
   SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
                                      ["dom.w3c_pointer_events.implicit_capture", false]]},
                             withoutImplicitlyPointerCaptureForTouch);
 });
 
--- a/dom/events/test/pointerevents/test_bug1420589_2.html
+++ b/dom/events/test/pointerevents/test_bug1420589_2.html
@@ -91,27 +91,27 @@ function withoutImplicitlyPointerCapture
   let left2 = rect2.left + 5;
 
   let top1 = rect1.top + 5;
   let top2 = rect2.top + 5;
 
   var utils = SpecialPowers.getDOMWindowUtils(window);
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Move the touch pointers so that we dispatch all of them to content.
   left1++;
   left2++;
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 }
 
 SimpleTest.waitForFocus(() => {
   SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
                                      ["dom.w3c_pointer_events.implicit_capture", false]]},
                             withoutImplicitlyPointerCaptureForTouch);
 });
 
--- a/dom/events/test/pointerevents/test_bug1420589_3.html
+++ b/dom/events/test/pointerevents/test_bug1420589_3.html
@@ -84,27 +84,27 @@ function withoutImplicitlyPointerCapture
   let left2 = rect2.left + 5;
 
   let top1 = rect1.top + 5;
   let top2 = rect2.top + 5;
 
   var utils = SpecialPowers.getDOMWindowUtils(window);
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Move the touch pointers so that we dispatch all of them to content.
   left1++;
   left2++;
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1, left2], [top1, top2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 }
 
 SimpleTest.waitForFocus(() => {
   SpecialPowers.pushPrefEnv({"set": [["dom.w3c_pointer_events.enabled", true],
                                      ["dom.w3c_pointer_events.implicit_capture", false]]},
                             withoutImplicitlyPointerCaptureForTouch);
 });
 
--- a/dom/events/test/pointerevents/test_multiple_touches.html
+++ b/dom/events/test/pointerevents/test_multiple_touches.html
@@ -1,9 +1,9 @@
-<!DOCTYPE HTML>
+<!DOCTYPE HTML>
 <html>
 <head>
   <meta charset="utf-8">
   <title>Test for Multiple Touches</title>
   <script src="/tests/SimpleTest/SimpleTest.js"></script>
   <script src="/tests/SimpleTest/EventUtils.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 </head>
@@ -29,17 +29,17 @@ var touches = {
 function synthesizeTouchEvent(aType, aIds, aLefts, aTops, aRxs, aRys, aAngles, aForces) {
   var utils = _getDOMWindowUtils(window);
   if (!utils) {
     ok(false, "unable to get nsIDOMWindowUtils");
     return;
   }
 
   utils.sendTouchEvent(aType, aIds, aLefts, aTops, aRxs, aRys,
-                       aAngles, aForces, aIds.length, 0 /* modifiers */);
+                       aAngles, aForces, 0 /* modifiers */);
 }
 
 function synthesizeTouchStart(aTarget, aId, aOffsetX, aOffsetY) {
   if (touches.ids.some((aElem) => { return aElem === aId; })) {
     ok(false, `touch with id=${aTouch.id} is already registered`);
     return;
   }
 
--- a/dom/events/test/test_bug603008.html
+++ b/dom/events/test/test_bug603008.html
@@ -88,17 +88,17 @@ function sendTouchEvent(windowUtils, aTy
         rotations.push(aEvent[touchType][i].rotationAngle);
         forces.push(aEvent[touchType][i].force);
       }
     }
   }
   return windowUtils.sendTouchEvent(aType,
                                     ids, xs, ys, rxs, rys,
                                     rotations, forces,
-                                    ids.length, aModifiers, 0);
+                                    aModifiers, 0);
 }
 
 function touchEvent(aOptions) {
   if (!aOptions) {
     aOptions = {};
   }
   this.ctrlKey = aOptions.ctrlKey || false;
   this.altKey = aOptions.altKey || false;
--- a/dom/events/test/test_bug741666.html
+++ b/dom/events/test/test_bug741666.html
@@ -83,17 +83,17 @@ function sendTouchEvent(windowUtils, aTy
         rotations.push(aEvent[touchType][i].rotationAngle);
         forces.push(aEvent[touchType][i].force);
       }
     }
   }
   return windowUtils.sendTouchEvent(aType,
                                     ids, xs, ys, rxs, rys,
                                     rotations, forces,
-                                    ids.length, aModifiers, 0);
+                                    aModifiers, 0);
 }
 
 function touchEvent(aOptions) {
   if (!aOptions) {
     aOptions = {};
   }
   this.ctrlKey = aOptions.ctrlKey || false;
   this.altKey = aOptions.altKey || false;
--- a/dom/events/test/window_bug1429572.html
+++ b/dom/events/test/window_bug1429572.html
@@ -49,19 +49,19 @@
           }
           ys.push(rect.top + (rect.height / 2));
           rxs.push(1);
           rys.push(1);
           angles.push(0);
           forces.push(1);
         }
         winUtils.sendTouchEvent("touchstart",
-          touches, xs, ys, rxs, rys, angles, forces, targets.length, 0);
+          touches, xs, ys, rxs, rys, angles, forces, 0);
         winUtils.sendTouchEvent("touchend",
-          touches, xs, ys, rxs, rys, angles, forces, targets.length, 0);
+          touches, xs, ys, rxs, rys, angles, forces, 0);
       }
 
       function next() {
         if (!tests.length) {
           opener.done();
           window.close();
         } else {
           var test = tests.shift();
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -352,24 +352,23 @@ interface nsIDOMWindowUtils : nsISupport
    * @param aModifiers modifiers pressed, using constants defined as MODIFIER_*
    * @param aIgnoreRootScrollFrame whether the event should ignore viewport bounds
    *                           during dispatch
    *
    * returns true if the page called prevent default on this touch event
    */
   [can_run_script]
   boolean sendTouchEvent(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,
-                         [array, size_is(count)] in uint32_t aRys,
-                         [array, size_is(count)] in float aRotationAngles,
-                         [array, size_is(count)] in float aForces,
-                         in uint32_t count,
+                         in Array<uint32_t> aIdentifiers,
+                         in Array<int32_t> aXs,
+                         in Array<int32_t> aYs,
+                         in Array<uint32_t> aRxs,
+                         in Array<uint32_t> aRys,
+                         in Array<float> aRotationAngles,
+                         in Array<float> aForces,
                          in long aModifiers,
                          [optional] in boolean aIgnoreRootScrollFrame);
 
   /** The same as sendMouseEvent but ensures that the event is dispatched to
    *  this DOM window or one of its children.
    */
   [optional_argc, can_run_script]
   void sendMouseEventToWindow(in AString aType,
@@ -386,24 +385,23 @@ interface nsIDOMWindowUtils : nsISupport
                               [optional] in long aButtons,
                               [optional] in unsigned long aIdentifier);
 
   /** The same as sendTouchEvent but ensures that the event is dispatched to
    *  this DOM window or one of its children.
    */
   [can_run_script]
   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,
-                                 [array, size_is(count)] in uint32_t aRys,
-                                 [array, size_is(count)] in float aRotationAngles,
-                                 [array, size_is(count)] in float aForces,
-                                 in uint32_t count,
+                                 in Array<uint32_t> aIdentifiers,
+                                 in Array<int32_t> aXs,
+                                 in Array<int32_t> aYs,
+                                 in Array<uint32_t> aRxs,
+                                 in Array<uint32_t> aRys,
+                                 in Array<float> aRotationAngles,
+                                 in Array<float> aForces,
                                  in long aModifiers,
                                  [optional] in boolean aIgnoreRootScrollFrame);
 
   /** Synthesize a wheel event for a window. The event types supported is only
    *  wheel.
    *
    * Events are sent in coordinates offset by aX and aY from the window.
    *
--- a/layout/base/tests/bug968148_inner.html
+++ b/layout/base/tests/bug968148_inner.html
@@ -189,96 +189,96 @@ function runTests() {
   test2d2.addEventListener("lostpointercapture", test2d2PointerLostCapture, true);
 
   document.body.offsetLeft;
 
   // This shouldn't enable capturing, since we're not in a right kind of 
   // event listener.
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d2, left2d2], [top1d2, top2d2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // No implicitly / explicitly pointer capture. pointermove should be
   // dispatched to 1d2, 2d2
   is(test1d1pointermovecount, 0, "1d1 shouldn't have got pointermove");
   is(test2d1pointermovecount, 0, "2d1 shouldn't have got pointermove");
   is(test1d2pointermovecount, 1, "1d2 should have got pointermove");
   is(test2d2pointermovecount, 1, "2d2 should have got pointermove");
 
   // Explicitly capture pointer to 1d1, 2d1
   test1d1.addEventListener("pointerdown", test1d1CapturePointer, {capture: true, once: true});
   test2d1.addEventListener("pointerdown", test2d1CapturePointer, {capture: true, once: true});
 
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d2, left2d2], [top1d2, top2d2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Explicitly capture pointer to 1d1, 2d1. pointermove, gotpointercapture
   // should be dispatched to 1d1, 2d1
   is(test1d1pointermovecount, 1, "1d1 should have got pointermove");
   is(test1d1pointergotcapture, 1, "1d1 should have got pointergotcapture");
   is(test1d2pointermovecount, 1, "1d2 shouldn't have got pointermove");
   is(test1d2pointergotcapture, 0, "1d2 shouldn't have got pointergotcapture");
 
   is(test2d1pointermovecount, 1, "2d1 should have got pointermove");
   is(test2d1pointergotcapture, 1, "2d1 should have got pointergotcapture");
   is(test2d2pointermovecount, 1, "2d2 shouldn't have got pointermove");
   is(test2d2pointergotcapture, 0, "2d2 shouldn't have got pointergotcapture");
 
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Explicitly capture pointer to 1d1, 2d1 when pointerdown
   test1d1.addEventListener("pointerdown", test1d1CapturePointer, {capture: true, once: true});
   test2d1.addEventListener("pointerdown", test2d1CapturePointer, {capture: true, once: true});
 
   // Explicitly capture pointer to 1d2, 2d2 when pointermove
   test1d1.addEventListener("pointermove", test1d2CapturePointer, {capture: true, once: true});
   test2d1.addEventListener("pointermove", test2d2CapturePointer, {capture: true, once: true});
 
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // This should send pointer event to test1d1, test2d1.
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // This should send pointer event to test1d2, test2d2.
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d1 + 1, left2d1 + 1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   is(test1d1pointermovecount, 2, "1d1 should have got pointermove");
   is(test1d1pointergotcapture, 2, "1d1 should have got pointergotcapture");
   is(test1d2pointermovecount, 2, "1d2 should have got pointermove");
   is(test1d2pointergotcapture, 1, "1d2 should have got pointergotcapture");
 
   is(test2d1pointermovecount, 2, "2d1 should have got pointermove");
   is(test2d1pointergotcapture, 2, "2d1 should have got pointergotcapture");
   is(test2d2pointermovecount, 2, "2d2 should have got pointermove");
   is(test2d2pointergotcapture, 1, "2d2 should have got pointergotcapture");
 
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   finishTest();
 }
 
 function finishTest() {
   // Let window.onerror have a chance to fire
   setTimeout(function() {
     setTimeout(function() {
--- a/layout/base/tests/bug968148_inner2.html
+++ b/layout/base/tests/bug968148_inner2.html
@@ -189,95 +189,95 @@ function runTests() {
   test2d2.addEventListener("lostpointercapture", test2d2PointerLostCapture, true);
 
   document.body.offsetLeft;
 
   // This shouldn't enable capturing, since we're not in a right kind of
   // event listener.
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d2, left2d2], [top1d2, top2d2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Implicitly pointer capture. pointermove should be dispatched to 1d1, 2d1
   is(test1d1pointermovecount, 1, "1d1 should have got pointermove");
   is(test2d1pointermovecount, 1, "2d1 should have got pointermove");
   is(test1d2pointermovecount, 0, "1d2 shouldn't have got pointermove");
   is(test2d2pointermovecount, 0, "2d2 shouldn't have got pointermove");
 
   // Explicitly capture pointer to 1d1, 2d1
   test1d1.addEventListener("pointerdown", test1d1CapturePointer, {capture: true, once: true});
   test2d1.addEventListener("pointerdown", test2d1CapturePointer, {capture: true, once: true});
 
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d2, left2d2], [top1d2, top2d2], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Explicitly capture pointer to 1d1, 2d1. pointermove, gotpointercapture
   // should be dispatched to 1d1, 2d1
   is(test1d1pointermovecount, 2, "1d1 should have got pointermove");
   is(test1d1pointergotcapture, 2, "1d1 should have got pointergotcapture");
   is(test1d2pointermovecount, 0, "1d2 shouldn't have got pointermove");
   is(test1d2pointergotcapture, 0, "1d2 shouldn't have got pointergotcapture");
 
   is(test2d1pointermovecount, 2, "2d1 should have got pointermove");
   is(test2d1pointergotcapture, 2, "2d1 should have got pointergotcapture");
   is(test2d2pointermovecount, 0, "2d2 shouldn't have got pointermove");
   is(test2d2pointergotcapture, 0, "2d2 shouldn't have got pointergotcapture");
 
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // Explicitly capture pointer to 1d1, 2d1 when pointerdown
   test1d1.addEventListener("pointerdown", test1d1CapturePointer, {capture: true, once: true});
   test2d1.addEventListener("pointerdown", test2d1CapturePointer, {capture: true, once: true});
 
   // Explicitly capture pointer to 1d2, 2d2 when pointermove
   test1d1.addEventListener("pointermove", test1d2CapturePointer, {capture: true, once: true});
   test2d1.addEventListener("pointermove", test2d2CapturePointer, {capture: true, once: true});
 
   utils.sendTouchEvent('touchstart', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // This should send pointer event to test1d1, test2d1.
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   // This should send pointer event to test1d2, test2d2.
   utils.sendTouchEvent('touchmove', [test1PointerId, test2PointerId],
                        [left1d1 + 1, left2d1 + 1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   is(test1d1pointermovecount, 3, "1d1 shouldn't have got pointermove");
   is(test1d1pointergotcapture, 3, "1d1 should have got pointergotcapture");
   is(test1d2pointermovecount, 1, "1d2 should have got pointermove");
   is(test1d2pointergotcapture, 1, "1d2 should have got pointergotcapture");
 
   is(test2d1pointermovecount, 3, "2d1 shouldn't have got pointermove");
   is(test2d1pointergotcapture, 3, "2d1 should have got pointergotcapture");
   is(test2d2pointermovecount, 1, "2d2 should have got pointermove");
   is(test2d2pointergotcapture, 1, "2d2 should have got pointergotcapture");
 
   utils.sendTouchEvent('touchend', [test1PointerId, test2PointerId],
                        [left1d1, left2d1], [top1d1, top2d1], [rx, rx], [ry, ry],
-                       [angle, angle], [force, force], 2, modifiers);
+                       [angle, angle], [force, force], modifiers);
 
   finishTest();
 }
 
 function finishTest() {
   // Let window.onerror have a chance to fire
   setTimeout(function() {
     setTimeout(function() {
--- a/layout/base/tests/bug970964_inner.html
+++ b/layout/base/tests/bug970964_inner.html
@@ -67,17 +67,17 @@ function sendTouchEvent(windowUtils, aTy
         rotations.push(aEvent[touchType][i].rotationAngle);
         forces.push(aEvent[touchType][i].force);
       }
     }
   }
   return windowUtils.sendTouchEvent(aType,
                                     ids, xs, ys, rxs, rys,
                                     rotations, forces,
-                                    ids.length, aModifiers, 0);
+                                    aModifiers, 0);
 }
 
 function getDefaultArgEvent(eventname) {
   return new PointerEvent(eventname, {
     bubbles: true, cancelable: true, view: window,
     detail: 0, screenX: 0, screenY: 0, clientX: 0, clientY: 0,
     ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
     button: 0, relatedTarget: null, pointerId: 0
--- a/layout/base/tests/bug970964_inner2.html
+++ b/layout/base/tests/bug970964_inner2.html
@@ -67,17 +67,17 @@ function sendTouchEvent(windowUtils, aTy
         rotations.push(aEvent[touchType][i].rotationAngle);
         forces.push(aEvent[touchType][i].force);
       }
     }
   }
   return windowUtils.sendTouchEvent(aType,
                                     ids, xs, ys, rxs, rys,
                                     rotations, forces,
-                                    ids.length, aModifiers, 0);
+                                    aModifiers, 0);
 }
 
 function getDefaultArgEvent(eventname) {
   return new PointerEvent(eventname, {
     bubbles: true, cancelable: true, view: window,
     detail: 0, screenX: 0, screenY: 0, clientX: 0, clientY: 0,
     ctrlKey: false, altKey: false, shiftKey: false, metaKey: false,
     button: 0, relatedTarget: null, pointerId: 0
--- a/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
+++ b/layout/base/tests/marionette/test_accessiblecaret_selection_mode.py
@@ -132,22 +132,22 @@ class AccessibleCaretSelectionModeTestCa
         rect = self.rect_relative_to_window(el)
         target_x = rect['x'] + (x if x is not None else rect['width'] // 2)
         target_y = rect['y'] + (y if y is not None else rect['height'] // 2)
 
         self.marionette.execute_script('''
             let utils = window.windowUtils;
             utils.sendTouchEventToWindow('touchstart', [0],
                                          [arguments[0]], [arguments[1]],
-                                         [1], [1], [0], [1], 1, 0);
+                                         [1], [1], [0], [1], 0);
             utils.sendMouseEventToWindow('mouselongtap', arguments[0], arguments[1],
                                           0, 1, 0);
             utils.sendTouchEventToWindow('touchend', [0],
                                          [arguments[0]], [arguments[1]],
-                                         [1], [1], [0], [1], 1, 0);
+                                         [1], [1], [0], [1], 0);
             ''', script_args=[target_x, target_y], sandbox='system')
 
     def long_press_on_word(self, el, wordOrdinal):
         x, y = self.word_location(el, wordOrdinal)
         self.long_press_on_location(el, x, y)
 
     def to_unix_line_ending(self, s):
         """Changes all Windows/Mac line endings in s to UNIX line endings."""
--- a/layout/base/tests/test_bug993936.html
+++ b/layout/base/tests/test_bug993936.html
@@ -54,17 +54,17 @@ function sendTouchEvent(windowUtils, aTy
         rotations.push(aEvent[touchType][i].rotationAngle);
         forces.push(aEvent[touchType][i].force);
       }
     }
   }
   return windowUtils.sendTouchEvent(aType,
                                     ids, xs, ys, rxs, rys,
                                     rotations, forces,
-                                    ids.length, aModifiers, 0);
+                                    aModifiers, 0);
 }
 
 function getSingleTouchEventForTarget(target, cwu) {
   currentId++;
   var bcr = target.getBoundingClientRect();
   var touch = new testtouch({
     page: {x: Math.round(bcr.left + bcr.width/2),
            y: Math.round(bcr.top  + bcr.height/2)},
--- a/layout/generic/test/test_selection_touchevents.html
+++ b/layout/generic/test/test_selection_touchevents.html
@@ -11,17 +11,17 @@
   aaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaa
 </div>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 var div1 = document.getElementById("div1");
 
 function sendTouch(aType, aX, aY) {
   var cwu = SpecialPowers.getDOMWindowUtils(window);
-  cwu.sendTouchEvent(aType, [0], [aX], [aY], [1], [1], [0], [1], 1, 0, true);
+  cwu.sendTouchEvent(aType, [0], [aX], [aY], [1], [1], [0], [1], 0, true);
 }
 
 function test()
 {
   var selection = window.getSelection();
   selection.removeAllRanges();
   var rect = div1.getBoundingClientRect();
 
--- a/mobile/android/tests/browser/robocop/testAccessibleCarets.js
+++ b/mobile/android/tests/browser/robocop/testAccessibleCarets.js
@@ -103,21 +103,21 @@ function getCharPressPoint(doc, element,
  * @param midPoint, The screen coord for the longpress.
  * @return Selection state helper-result object.
  */
 function getLongPressResult(browser, midPoint) {
   let domWinUtils = browser.contentWindow.windowUtils;
 
   // AccessibleCarets expect longtap between touchstart/end.
   domWinUtils.sendTouchEventToWindow("touchstart", [0], [midPoint.x], [midPoint.y],
-                                     [1], [1], [0], [1], 1, 0);
+                                     [1], [1], [0], [1], 0);
   domWinUtils.sendMouseEventToWindow("mouselongtap", midPoint.x, midPoint.y,
                                      0, 1, 0);
   domWinUtils.sendTouchEventToWindow("touchend", [0], [midPoint.x], [midPoint.y],
-                                     [1], [1], [0], [1], 1, 0);
+                                     [1], [1], [0], [1], 0);
 
   return { focusedElement: gActionBarHandler._targetElement,
            text: gActionBarHandler._getSelectedText(),
            selectionID: gActionBarHandler._selectionID,
   };
 }
 
 /**
--- a/testing/marionette/listener.js
+++ b/testing/marionette/listener.js
@@ -702,17 +702,16 @@ function emitTouchEvent(type, touch) {
       type,
       [touch.identifier],
       [touch.clientX],
       [touch.clientY],
       [touch.radiusX],
       [touch.radiusY],
       [touch.rotationAngle],
       [touch.force],
-      1,
       0);
 }
 
 /**
  * Function that perform a single tap
  */
 async function singleTap(el, corx, cory) {
   // after this block, the element will be scrolled into view
--- a/testing/mochitest/tests/SimpleTest/EventUtils.js
+++ b/testing/mochitest/tests/SimpleTest/EventUtils.js
@@ -487,21 +487,21 @@ function synthesizeTouchAtPoint(left, to
     var id = aEvent.id || utils.DEFAULT_TOUCH_POINTER_ID;
     var rx = aEvent.rx || 1;
     var ry = aEvent.ry || 1;
     var angle = aEvent.angle || 0;
     var force = aEvent.force || 1;
     var modifiers = _parseModifiers(aEvent, aWindow);
 
     if (("type" in aEvent) && aEvent.type) {
-      defaultPrevented = utils.sendTouchEvent(aEvent.type, [id], [left], [top], [rx], [ry], [angle], [force], 1, modifiers);
+      defaultPrevented = utils.sendTouchEvent(aEvent.type, [id], [left], [top], [rx], [ry], [angle], [force], modifiers);
     }
     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);
+      utils.sendTouchEvent("touchstart", [id], [left], [top], [rx], [ry], [angle], [force], modifiers);
+      utils.sendTouchEvent("touchend", [id], [left], [top], [rx], [ry], [angle], [force], modifiers);
     }
   }
   return defaultPrevented;
 }
 
 // Call synthesizeMouse with coordinates at the center of aTarget.
 function synthesizeMouseAtCenter(aTarget, aEvent, aWindow)
 {