mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 865452 - Don't capture scripted mouse events. r=yzen
This commit is contained in:
parent
364147b1af
commit
d0809e0e80
@ -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;
|
||||||
|
@ -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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user