Bug 1179335: Remove unused Marionette mouse scroll functions; r=whimboo
authorDavid Burns <dburns@mozilla.com>
Mon, 29 May 2017 13:57:05 +0100
changeset 409217 0b4e233d48c1554786dc8b5b098d2fd73be50f20
parent 409216 c605d84491f8cf7529cbb084341feafe3f3f906a
child 409218 740d674779eb4dada7c7f47ef03fb3aaaa65d212
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1179335
milestone55.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 1179335: Remove unused Marionette mouse scroll functions; r=whimboo The underlying code that this method calls from nsIDOMWindowUtils was removed and has not caused issues in here. This is dead code. MozReview-Commit-ID: K245et5SmxJ
testing/marionette/event.js
--- a/testing/marionette/event.js
+++ b/testing/marionette/event.js
@@ -279,84 +279,16 @@ event.synthesizeMouseAtCenter = function
   event.synthesizeMouse(
       element,
       rect.width / 2,
       rect.height / 2,
       event,
       window);
 };
 
-/**
- * Synthesise a mouse scroll event on a target.
- *
- * The actual client point is determined by taking the target's client
- * box and offseting it by |offsetX| and |offsetY|.
- *
- * If the |type| property is specified for the |event| argument, a mouse
- * scroll event of that type is fired.  Otherwise, DOMMouseScroll is used.
- *
- * If the |axis| is specified, it must be one of "horizontal" or
- * "vertical". If not specified, "vertical" is used.
- *
- * |delta| is the amount to scroll by (can be positive or negative).
- * It must be specified.
- *
- * |hasPixels| specifies whether kHasPixels should be set in the
- * |scrollFlags|.
- *
- * |isMomentum| specifies whether kIsMomentum should be set in the
- * |scrollFlags|.
- *
- * @param {Element} target
- * @param {number} offsetY
- * @param {number} offsetY
- * @param {Object.<string, ?>} event
- *     Object which may contain the properties shiftKey, ctrlKey, altKey,
- *     metaKey, accessKey, button, type, axis, delta, and hasPixels.
- * @param {Window=} window
- *     Window object.  Defaults to the current window.
- */
-event.synthesizeMouseScroll = function (
-    target, offsetX, offsetY, ev, window = undefined) {
-
-  let domutils = getDOMWindowUtils(window);
-
-  // see nsMouseScrollFlags in nsGUIEvent.h
-  const kIsVertical = 0x02;
-  const kIsHorizontal = 0x04;
-  const kHasPixels = 0x08;
-  const kIsMomentum = 0x40;
-
-  let button = ev.button || 0;
-  let modifiers = event.parseModifiers_(ev);
-
-  let rect = target.getBoundingClientRect();
-  let left = rect.left;
-  let top = rect.top;
-
-  let type = (("type" in ev) && ev.type) || "DOMMouseScroll";
-  let axis = ev.axis || "vertical";
-  let scrollFlags = (axis == "horizontal") ? kIsHorizontal : kIsVertical;
-  if (ev.hasPixels) {
-    scrollFlags |= kHasPixels;
-  }
-  if (ev.isMomentum) {
-    scrollFlags |= kIsMomentum;
-  }
-
-  domutils.sendMouseScrollEvent(
-      type,
-      left + offsetX,
-      top + offsetY,
-      button,
-      scrollFlags,
-      ev.delta,
-      modifiers);
-};
-
 function computeKeyCodeFromChar_(char) {
   if (char.length != 1) {
     return 0;
   }
 
   if (char in VIRTUAL_KEYCODE_LOOKUP) {
     return Ci.nsIDOMKeyEvent["DOM_" + VIRTUAL_KEYCODE_LOOKUP[char]];
   }