B2G/gecko/testing/marionette/marionette-listener.js
/**
 * This function emit mouse event
 *   @param: doc is the current document
 *           type is the type of event to dispatch
 *           detail is the number of clicks, button notes the mouse button
 *           elClientX and elClientY are the coordinates of the mouse relative to the viewport
 */
This function emit mouse event
@param: doc is the current document
type is the type of event to dispatch
detail is the number of clicks, button notes the mouse button
elClientX and elClientY are the coordinates of the mouse relative to the viewport
This function emit mouse event @param : doc is the current document type is the type of event to dispatch detail is the number of clicks button notes the mouse button elClientX and elClientY are the coordinates of the mouse relative to the viewport
function emitMouseEvent(doc, type, elClientX, elClientY, detail, button) {
  let loggingInfo = "Marionette: emitting Mouse event of type " + type + " at coordinates (" + elClientX + ", " + elClientY + ") relative to the viewport";
  dump(loggingInfo);
  detail = detail || 1;
  button = button || 0;
  let win = doc.defaultView;
  utils.synthesizeMouseAtPoint(elClientX, elClientY, {type: type, button: button, clickCount: detail}, win);
}
function emitMouseEvent ( doc , type , elClientX , elClientY , detail , button ) { let loggingInfo = "Marionette: emitting Mouse event of type " + type + " at coordinates (" + elClientX + ", " + elClientY + ") relative to the viewport" ; dump ( loggingInfo ) ; detail = detail || 1 ; button = button || 0 ; let win = doc . defaultView ; utils . synthesizeMouseAtPoint ( elClientX , elClientY , { type : type , button : button , clickCount : detail } , win ) ; }
This function emit mouse event
   @param: doc is the current document
           type is the type of event to dispatch
           detail is the number of clicks, button notes the mouse button
           elClientX and elClientY are the coordinates of the mouse relative to the viewport
This function emit mouse event @param : doc is the current document type is the type of event to dispatch detail is the number of clicks button notes the mouse button elClientX and elClientY are the coordinates of the mouse relative to the viewport
/*
  Disabled per bug 888303
  marionetteLogObj.log(loggingInfo, "TRACE");
  sendSyncMessage("Marionette:shareData",
                  {log: elementManager.wrapValue(marionetteLogObj.getLogs())});
  marionetteLogObj.clearLogs();
  */ // Figure out the element the mouse would be over at (x, y)