Bug 865452 - Don't capture scripted mouse events. r=yzen

This commit is contained in:
Eitan Isaacson 2013-04-25 12:39:16 -07:00
parent 364147b1af
commit d0809e0e80
2 changed files with 15 additions and 4 deletions

View File

@ -106,6 +106,10 @@ this.TouchAdapter = {
return; return;
} }
if (aEvent.mozInputSource == Ci.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN) {
return;
}
if (this._delayedEvent) { if (this._delayedEvent) {
Utils.win.clearTimeout(this._delayedEvent); Utils.win.clearTimeout(this._delayedEvent);
delete this._delayedEvent; delete this._delayedEvent;

View File

@ -121,10 +121,17 @@ function activateCurrent(aMessage) {
let x = Math.round((objX.value - docX.value) + objW.value / 2); let x = Math.round((objX.value - docX.value) + objW.value / 2);
let y = Math.round((objY.value - docY.value) + objH.value / 2); let y = Math.round((objY.value - docY.value) + objH.value / 2);
let cwu = content.QueryInterface(Ci.nsIInterfaceRequestor). let node = aAccessible.DOMNode || aAccessible.parent.DOMNode;
getInterface(Ci.nsIDOMWindowUtils);
cwu.sendMouseEventToWindow('mousedown', x, y, 0, 1, 0, false); function dispatchMouseEvent(aEventType) {
cwu.sendMouseEventToWindow('mouseup', x, y, 0, 1, 0, false); let evt = content.document.createEvent("MouseEvents");
evt.initMouseEvent(aEventType, true, true, content,
x, y, 0, 0, 0, false, false, false, false, 0, null);
node.dispatchEvent(evt);
}
dispatchMouseEvent("mousedown");
dispatchMouseEvent("mouseup");
} }
} }