зеркало из https://github.com/mozilla/pjs.git
Add method to synthesize mouse events at the center of elements. (Bug 595652) r=Mossop a2.0=blocking2.0:betaN
This commit is contained in:
Родитель
d58906d861
Коммит
540dbc7814
|
@ -230,6 +230,14 @@ function synthesizeMouse(aTarget, aOffsetX, aOffsetY, aEvent, aWindow)
|
|||
}
|
||||
}
|
||||
|
||||
// Call synthesizeMouse with coordinates at the center of aTarget.
|
||||
function synthesizeMouseAtCenter(aTarget, aEvent, aWindow)
|
||||
{
|
||||
var rect = aTarget.getBoundingClientRect();
|
||||
synthesizeMouse(aTarget, rect.width / 2, rect.height / 2, aEvent,
|
||||
aWindow);
|
||||
}
|
||||
|
||||
/**
|
||||
* Synthesize a mouse scroll event on a target. The actual client point is determined
|
||||
* by taking the aTarget's client box and offseting it by aOffsetX and
|
||||
|
|
Загрузка…
Ссылка в новой задаче