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
--- 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]];
}