Bug 722144 - Allow dblclick on EventUtils.sendMouseEvent. r=smaug

This commit is contained in:
Reuben Morais 2012-01-29 05:01:00 -08:00
Родитель c817023f11
Коммит e9519cdff6
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -32,7 +32,7 @@ function getElement(id) {
this.$ = this.getElement;
function sendMouseEvent(aEvent, aTarget, aWindow) {
if (['click', 'mousedown', 'mouseup', 'mouseover', 'mouseout'].indexOf(aEvent.type) == -1) {
if (['click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout'].indexOf(aEvent.type) == -1) {
throw new Error("sendMouseEvent doesn't know about event type '" + aEvent.type + "'");
}
@ -52,7 +52,8 @@ function sendMouseEvent(aEvent, aTarget, aWindow) {
var viewArg = aWindow;
var detailArg = aEvent.detail || (aEvent.type == 'click' ||
aEvent.type == 'mousedown' ||
aEvent.type == 'mouseup' ? 1 : 0);
aEvent.type == 'mouseup' ? 1 :
aEvent.type == 'dblclick'? 2 : 0);
var screenXArg = aEvent.screenX || 0;
var screenYArg = aEvent.screenY || 0;
var clientXArg = aEvent.clientX || 0;